computer programs
accessPRINSAS 2.0: a Python-based graphical user interface tool for fitting polydisperse spherical pore models in small-angle scattering analysis of porous materials
aSchool of Materials Science and Engineering, UNSW Sydney, Sydney, New South Wales 2052, Australia, bWA School of Mines: Minerals, Energy and Chemical Engineering, Curtin University, Perth, Western Australia 6102, Australia, and cQueensland Micro Nanotechnology Centre, Griffith University, Nathan, Queensland 4111, Australia
*Correspondence e-mail: [email protected]
Despite the growing use of small- and ultra-small-angle scattering (SAS/USAS) across various fields, data processing remains challenging due to the complexity of SAS analysis and the limited accessibility of existing analysis software. These issues are addressed with PRINSAS 2.0, a portable Python-based tool with an intuitive graphical user interface. It enables efficient fitting of the polydisperse spherical pore model to SAS data and is specifically designed for porous materials often encountered in geoscience. This paper outlines the scientific and mathematical foundations of the software, along with its numerical implementation, to provide users with theoretical context and to support future development. The software was tested and validated using data from a range of geological and engineered porous samples measured at various neutron scattering facilities, ensuring broad compatibility. Additional validation using synthetic data sets, along with comparisons with existing pore size distribution fitting tools, confirmed its robustness in recovering predefined pore size distributions. PRINSAS 2.0 offers wide accessibility while ensuring that the fit results adhere closely to the underlying theoretical model, making it a practical tool for non-specialist users of SAS techniques. It also integrates seamlessly with larger Python-based SAS analysis frameworks, while remaining fully functional as a standalone application.
Keywords: small-angle scattering; polydisperse spherical pore models; porous media; data analysis software; PRINSAS 2.0.
1. Introduction
Recent advances in neutron source technology – including gains in intensity (Oak Ridge National Laboratory, 2023
; ANSTO, 2024
) and enhanced stability through more rigorously reviewed practices (International Atomic Energy Agency, 2024
) – have established small- and ultra-small-angle scattering (SAS/USAS) as powerful techniques for studying micro- and nanoscale structures. These advancements have led to (i) improved reliability, (ii) faster data acquisition enabling sub-millisecond temporal sampling, and (iii) increased resolution and signal-to-noise ratio, allowing studies from ångström to micrometre scales. The integration of automatic multi-sample changers has further improved the user experience and increased sample throughput (Rehm et al., 2018
; Wood et al., 2018
).
Originally adopted by the biophysical community for protein studies (Engelman & Moore, 1975
), SAS later found widespread application in materials science (Schelten et al., 1976
) and geology (Radlinski et al., 1996
), particularly for analysing porous structures and nanoscale sorption behaviour. One of SAS's key advantages is its non-destructive nature (Radlinski, 2006
), and this coupled with the ability to distinguish between open and closed porosity through contrast matching techniques (Bahadur et al., 2018
; Radlinski et al., 2021
; Vu et al., 2024
) makes it especially valuable for studying complex material systems.
Despite these experimental advancements, data analysis remains a critical bottleneck. Modern SAS instruments generate tens to hundreds of gigabytes of multidimensional data sets [e.g. I(Q, t) for time-resolved studies], yet extracting physically meaningful parameters remains labour intensive and often requires a high level of expertise. Traditionally, a strong foundation in mathematical computing was essential for the effective interpretation of these large data sets. However, over the years, various software packages have been developed to streamline this process, which can be broadly classified two main categories:
(i) Large-scale software, ranging from (a) internationally developed open-source projects such as SASView (https://www.sasview.org/) and Mantid (Arnold et al., 2014
) to (b) facility-developed suites like Irena (Ilavsky & Jemian, 2009
), GSAS-II (Toby & Von Dreele, 2013
; Von Dreele, 2014
) and SAXSutilities2 (https://www.saxsutilities.eu/mediawiki/index.php?title=Overview). These programs offer comprehensive functionality – including both data reduction and analysis – but often come with steep learning curves.
(ii) Specialized packages, such as PRINSAS (Hinde, 2004
), McSAS (Bressler et al., 2015
) and MatSAS (Rezaeyan et al., 2021
), which are typically developed by small teams or individual researchers. Though offering specialized capabilities, some of these tools can suffer from inconsistent coding practices and inadequate documentation, presenting challenges for new users who are unfamiliar with the original development framework.
Accessibility of (U)SAS data analysis is further hindered by reliance on proprietary software, with MATLAB (https://www.mathworks.com/products/matlab.html) and Igor (https://www.wavemetrics.com/) being the most prominent. While MATLAB is available through unrestricted academic licences, Igor only provides its users with a 30-day free trial, limiting the reach of packages developed through Igor. Most recently, ScatterX (Xie et al., 2024
) has emerged as a promising standalone program with a user-friendly graphical user interface (GUI); however, unclear input data format specifications and the lack of an English version hinder broader adoption.
Compounding these issues, existing literature on SAS software primarily focuses on mathematical and physical foundations rather than algorithmic implementations. Greater communication in software design would facilitate improvements by external contributors from outside the original team of developers, thus enhancing accuracy and efficiency. Well-documented implementations, alongside open-source code, would also aid troubleshooting when results appear questionable, helping to differentiate between measurement errors, fit parameter issues and algorithmic inconsistencies.
The polydisperse spherical pore (PDSP) model [equation (1
) below; see also Radlinski (2006
)] is widely used to extract structural information from porous materials, such as sedimentary rocks with broad pore size distributions and fractal characteristics (Radlinski et al., 2000
). This model converts SAS data from reciprocal space into a pore size distribution function f(r) in real space, while also solving for key parameters such as the total porosity and specific surface area. Although there exist numerous software packages for pore distribution calculations (e.g. McSAS, Irena), tools specifically designed for the PDSP model – particularly valuable for geoscientists, a growing subset of SANS users – are uncommon. Historically, PRINSAS, a program based on Microsoft Excel, was widely used for solving the PDSP model (Radlinski et al., 2004b
; Bahadur et al., 2015
), but updates to Excel in 2008 rendered the program non-functional due to changes made in the solver function. Since then, the only available alternative has been MatSAS, a MATLAB-based script-driven program that inherits the limitations of MATLAB dependency and scripting-based workflows, posing challenges for users without a computing background.
We here introduce PRINSAS 2.0, an open-source standalone Python GUI program designed to fit the PDSP model to reduced one-dimensional SAS data, specifically addressing the needs of geoscientists and researchers studying porous systems. Tailored for users with limited coding expertise, PRINSAS 2.0 prioritizes accessibility through an intuitive GUI and simplified input/output formats aligned with geological workflows. While optimized for ease of use, the program's core computational engine, the fit_PDSP_model() function, is modularly designed to facilitate integration into broader Python-based analysis frameworks, ensuring flexibility for advanced users.
This paper presents the underlying mathematical background of the PDSP model. More details on the computational design and implementation are provided in Section S2 in the supporting information, allowing future enhancements to be more seamlessly incorporated. Comparison with fit results obtained from existing tools found in the literature, as well as validation of the software's capabilities, was done using a range of modelled data sets. The Python implementation of the core fit_PDSP_model() function mirrors MATLAB's computational logic, facilitating adaptation for MATLAB users into their own code base. Practical guidance on using the GUI, configuring inputs and interpreting results is provided in Section S3, with step-by-step instructions for users. PRINSAS 2.0 and its source code are available for download from the PRINSAS GitHub repository (https://github.com/henry-pnhvu/PRINSAS-2.0) and will be continually supported to enhance usability and improve workflow efficiency for its users.
2. The PDSP model
For a two-phase system where the density is uniform and scale independent (e.g. homogeneous matrix and pores/air), the structure can be approximated as a collection of polydisperse spherical objects. The differential scattering (dΣ/dΩ), spanning a sufficiently broad Q range (length scales) where Q = (4π/λ)sin(θ/2) (θ being the scattering angle and λ the wavelength of the incident radiation), can be described using the PDSP model (Hinde, 2004
; Radlinski et al., 2004a
),
Here is the scattering contrast between the two phases [where
and
are the scattering length density (SLD) of the first and the second phase, respectively], ϕ is the total porosity (i.e. the ratio of pore volume to sample volume),
is the average pore volume, Vr is the pore volume corresponding to pores of radius r and f(r) is the probability density function (number-weighted distribution) of the pore sizes. [rmax, rmin] is the range of the examined feature sizes and corresponds to the investigated Q range; for fractal- and near-fractal-like scattering geological materials, it is assumed that rmax ≃ 2.5/Qmin and rmin ≃ 2.5/Qmax (Radliński et al., 2000
).
For spherical pores, the form factor Fsph is written as
Equation (1)
is derived from Debye's law for two-phase systems (Melnichenko, 2016
), where ϕ(1 − ϕ) is approximated as ϕ for systems with low porosity (<∼5%). For systems with higher porosity, equation (1)
is written as
The continuous range of pore radius r in the number-weighted pore distribution f(r) in equation (3)
can be divided into discrete ri values, where i denotes the index (position) of each discrete value within the range. The scattering intensity of the overall (U)SAS profile can be numerically expressed as the sum of the scattering contributions from each ri value as
where Rmini and Rmaxi denote the limits of the continuous pore size distribution corresponding to the discrete pore radius value ri, Vri is the spherical volume corresponding to the pore radius ri, and Fsph(Q, ri) is the spherical form factor corresponding to the current scattering vector magnitude Q and pore radius ri. IQ0(ri) is the scattering intensity at Q = 0 corresponding to ri and has the form of
where the average pore volume of the entire examined Q range is calculated as
The PDSP model, which assumes that all pores are spherical, and the fitting result represent a simplified approximation of complex porous systems. Moreover, the PDSP model describes a dilute system of isolated, non-interacting spheres, which, taken strictly, implies the absence of connected porosity. This is inconsistent with (i) microscopy and modern tomography results (Cnudde & Boone, 2013
), where real porous systems appear far more complex and interconnected than the model suggests, and (ii) fluid intrusion techniques, such as mercury intrusion porosimetry and gas sorption, which inherently rely on pore connectivity. Nevertheless, the PDSP model enables comparison between different samples or for a single sample under different experimental conditions and helps correlate SANS microstructural data with those obtained using other characterization methods, such as the aforementioned intrusion techniques..
3. Sample scattering data
The combined small- and ultra-small-angle neutron scattering (SANS and USANS) data used in this study for demonstrating the fitting procedure of PRINSAS 2.0 were obtained from a marginally mature Devonian New Albany Shale sample with a fractal pore size distribution, collected from a core drilled in Indiana, USA (Blach et al., 2021
). Scattering measurements were carried out on a thinned wafer sample using the Quokka and Kookaburra instruments at the Australian Nuclear Science and Technology Organisation (ANSTO) (Rehm et al., 2018
; Wood et al., 2018
), covering a combined Q range from 2 × 10−5 to 0.5 Å−1 (Fig. 1
).
| Figure 1 Combined SANS and USANS data for a New Albany Shale sample. Data after subtraction of the high-Q incoherent background are used to demonstrate the fitting procedure. |
In addition to the experimental data, synthetic data with predefined pore size distributions were generated and tested using the software to verify its ability to give an accurate reconstruction of the original input pore size distributions. The software's compatibility with diverse input formats was assessed by testing
(i) reduced one-dimensional data sets generated by instruments Quokka (SANS), Kookaburra (USANS) and Bilby [time-of-flight SANS; Sokolova et al. (2019
)] at ANSTO, and beamlines D11 (SANS) and S18 (USANS) at the Institut Laue–Langevin (Lindner et al., 1992
; Kroupa et al., 2000
; Lindner & Schweins, 2010
), and
(ii) additional synthetic data sets available in the McSAS GitHub repository (Pauw, 2015
) with varying file structures, such as different header sizes and delimiters.
4. Fitting of the PDSP model in the core fitting function fit_PDSP_model()
The process of fitting the PDSP model to (U)SAS data follows the sequence of steps outlined below, with further details provided in the respective sections quoted:
(i) Estimate the r limits rmax and rmin of the result from the background-subtracted SAS data input, approximately as rmax = 2.5/Qmin and rmin = 2.5/Qmax. The discrete radius ri can be obtained by dividing the continuous r range between rmin and rmax into equal intervals on a logarithmic scale (Section 4.1
and Section S2.1).
(ii) Form a matrix of all possible Q and ri values and numerically calculate γ(Q, ri) in equation (4)
(Section S2.2); the list of Q values is obtained directly from the input SAS data.
(iii) Estimate the starting values of IQ0(ri), [IQ0(ri)]start, prior to the fitting procedure, done by assuming that each measured I(Q) value consists solely of the scattering contribution at ri = 2.5/Q (Section 4.2
).
(iv) Iteratively adjust the individual IQ0(ri) values, such that the sum of the squares of the residuals between I(Q)calc [calculated using equation (4)
] and I(Q)measure, weighted by the measurement error, reaches a minimum (Section 4.3
).
(v) Use the thus-fitted IQ0(ri) to calculate the dependent parameters, such as the porosity, pore volume and other structural variables (Section 4.6
).
4.1. Determining the r range and ri values
The r range [rmin, rmax] of the fitting results, corresponding to the Q range of the input (U)SAS data, is determined as rmin = 2.5/Qmax and rmax = 2.5/Qmin. A set of ri values is generated within this [rmin, rmax] interval by discretizing the continuous r range. The density of these values, which determines how finely the pore size distribution is subdivided, is controlled by specifying the number of ri values per decade of r.
For optimal fit results, the number of ri values within the r limits should be chosen (by users) such that the total count of ri remains less than half the number of (U)SAS data points. This constraint serves two purposes:
(i) limiting the number of ri values prevents overfitting, where the model becomes overly sensitive to experimental noise rather than capturing the true structural characteristics of the sample, while
(ii) ensuring a sufficient number of ri values allows for an accurate and reliable representation of the sample's pore size distribution.
4.2. Initialization of IQ0i values
Prior to the fitting procedure, the determination of the starting value of IQ0(ri), [IQ0(ri)]start, is required. This process serves as the foundation for subsequent iterative optimization of IQ0(ri), ensuring that the model begins with a reasonable approximation of the experimental data, forming a `bias' for the fitting procedure.
This initial estimate is obtained by assuming that the scattering intensity at a given Q originates entirely from pores with radii ri = 2.5/Q, rather than the up to 66% contribution in reality (Radlinski et al., 2004a
). Under this assumption, [IQ0(ri)]start can then be estimated from equation (4)
as
Since there are many possible solutions for the nonlinear fit of IQ0(ri), starting with a value closest to the most physically probable one helps eliminate less realistic alternatives. In systems with fewer distinct features – commonly encountered in geological materials – the initial estimate often closely approximates the final solution, as demonstrated in Figs. 2 and 3.
4.3. The iterative fitting procedure
Once the [IQ0(ri)]start values have been determined, they are substituted into equation (4)
alongside the computed values of γ(Q, ri) to generate a calculated scattering intensity profile I(Q)calc. The fitting procedure aims to minimize the misfit between the calculated and measured intensity I(Q)measure, defined as
where dI(Q) is the measurement error associated with each I(Q) value.
Equation (8)
is adapted from equation (4) of Potton et al. (1988
), modified to account for the power-law nature of the scattering signal. This transforms the fitting problem into a more balanced and approximately linear one, while retaining the original weighting by dI(Q). To increase linearity further, prior to the calculation of χ2, all of I(Q)calc, I(Q)measure and dI(Q) in equation (8)
are multiplied by Q−n, where n is the linear slope fitted through the measured scattering data on a log–log plot.
In addition, to ensure that the fitting process properly accounts for variations in IQ0(ri) values across all scales, the variation of IQ0(ri) during the optimization process is performed on a logarithmic scale. This approach accounts for the power-law distribution of pore sizes common in geological systems, where the intensity contributed by smaller pores is significantly lower than that from larger ones. This prevents the disproportionate weighting of larger pores, which would otherwise skew the results.
The fitting procedure commences by cycling through the different values of IQ0(ri) over the entire ri range, such that χ2 reaches a minimum. This optimization procedure is performed automatically using the minimize() function in the Python SciPy library (The SciPy community, 2024
).
The allowed range of fitted values IQ0(ri)fit is set arbitrarily to span five orders of magnitude above and below the initial [IQ0(ri)]start estimates (Fig. 2). This range is chosen to provide sufficient flexibility for the optimization algorithm to explore potential solutions while maintaining numerical stability. A narrower range could lead to local minima trapping the optimization, whereas an excessively wide range might introduce instability or unrealistic solutions.
4.4. Smoothing of the fit result
An additional smoothing procedure can be applied to improve the fit quality further and reduce the noise level in the fitted values of IQ0(ri)fit. This helps minimize artificial variations caused by overfitting to minor inconsistencies (noise) in the measured data. To achieve this, a simple regularization term is introduced into the optimization equation (8)
, resulting in
where λ is a scaling factor. The regularization term is defined as the sum of squared gradients between adjacent points in the fit result. This regularization term is chosen under the assumption that the transition in pore size distribution at different r values in a geological system is smooth and continuous, taking the form of
Here, the normalized pore size distribution p(ri) is obtained by multiplying IQ0(ri) by , where m is the linear slope fitted through the IQ0(ri) versus r plot on a log–log scale at the current fit iteration. This transformation linearizes the power-law distribution of IQ0(ri), ensuring a more balanced weighting across the ri values.
Smoothing is introduced by altering the scaling factor λ in equation (9)
such that the regularization term carries greater weight in the calculation of Ξ, causing the fitting algorithm to prioritize minimizing the value of
over χ2. As
corresponds to the sum of squared gradients in the fitted result, a lower
value results in a smoother IQ0(ri) curve. However, this smoothing comes potentially at the cost of a higher χ2 value, reflecting greater deviation between I(Q)calc and I(Q)measure.
Comparisons between the stated values [IQ0(ri)]start (determined in Section 4.2
) and the fitted values IQ0(ri)fit, both with and without the smoothing factor λ, are demonstrated in Figs. 2
and 3
. The results indicate that the fitted IQ0(ri)fit values in the r range between 200 and 2000 nm are the noisiest, corresponding to Q between 10−4 and 10−3 Å−1. This Q range primarily consists of USANS data, which often exhibit structure-unrelated fluctuations due to (i) shifts in the Si crystal used for USANS experiments caused by temperature changes, (ii) weaker scattering at large USANS angles and (iii) numerical artefacts introduced during the USANS desmearing process. Consequently, the smoothing effect is most prominent in this region, evident from the significantly lower fluctuation level of IQ0(ri)fit and the increased deviation between I(Q)calc and I(Q)measure for λ > 0.
| Figure 2 Comparison between the starting IQ0(ri) values prior to the optimization process and the fitted IQ0(ri) values, with and without the smoothing factor λ. Upper and lower solid black lines, along with shaded area in between, indicate the permissible fitting range for IQ0(ri), spanning five orders of magnitude above and below the starting values. For clarity, the fit results at λ = 0 and λ > 0 are divided by a factor of 100. |
| Figure 3 (a) Comparison between (i) the measured I(Q) values with background subtracted, (ii) the starting I(Q) values prior to the fitting procedure, and (iii) the fitted I(Q) values with and without the smoothing factor λ. The starting and fitted values were calculated using equation (4) |
4.5. Error estimation
The error in the fit results is approximated using equation (7)
, with I(Q) being replaced by σ(Q). Here, σ(Q) at each Q value is defined as the greater of (i) the relative deviation between I(Q)fit and I(Q)measure and (ii) the measurement error dI(Q), with both expressed as percentages of I(Q)measure. Using this approach, the error in the pore size distribution at each ri is assumed to inherit the uncertainty from the scattering intensity at the corresponding Q = 2.5/ri. Note that this error estimate reflects only the numerical quality of the fit and does not serve as a formal confidence interval for IQ0(ri)fit. It also does not account for measurement artefacts, such as those introduced by USANS desmearing exceeding experimental errors, or errors at large Q values resulting from background subtraction.
4.6. Calculation of sample properties from the PDSP fit result
Once the values of IQ0i are obtained, the remaining physical properties of the measured sample can be calculated, including the probability density function of the pore sizes (also known as the number-weighted pore size distribution) f(r), porosity ϕ, average pore volume , specific surface area (SSA) and differential pore volume distribution dV/dr.
Since
for a continuous function of the pore distribution f(r) with respect to r, the discrete f(ri) values can be estimated, deriving from equation (5)![]()
Next, the average pore volume can be calculated as
The value of the porosity ϕ can then be determined by substituting the result of f(ri) and into equation (5)
, given a known contrast. Since equation (5)
is symmetric with respect to phase 1 (with ϕ) and phase 2 [with volume fraction (1 − ϕ)], the value of IQ0i will not change if each phase is replaced by its counterpart with the corresponding (Babinet, 1837
). To determine accurately the volume fractions of the solid matrix and void from the PDSP model, independently obtained structural information about the measured sample is required. This may include data from helium porosimeters for systems with high percentages of accessible porosity relative to total porosity.
The SSA, determined using a probe with radius R, is defined as the sum of the SSAs of all pores with radii larger than R and is estimated as
where rk < rk+1.
Finally, the differential pore volume per unit weight is calculated as
where ρ is the matrix average bulk density, determined as msample/Vsample.
Importantly, the porosity ϕ and its dependent parameters SSA(R) and dV/dr determined from the PDSP model are directly calculated from (and therefore are functions of) the SLD and absolute scattering intensity. Hence, obtaining reliable values for these fitted parameters requires accurate determination of both the SLD and the absolute intensity. However, this is not always achievable, especially for powdered samples.
5. Assessing the capabilities and limitations of the fitting algorithm
To assess the reliability of the fitting algorithm, a series of simulated SAS profiles were generated using different predefined profiles of IQ0(ri) called IQ0(ri)sim. These IQ0(ri)sim profiles include (i) an ideal power-law size distribution with and without the addition of random noise, and (ii) a power-law size distribution with the addition or subtraction of monodispersed and bidispersed pore components. The uneven Q spacing in the simulated I(Q) profiles was chosen to reflect experimental data, where SAS exhibits much higher point density than USAS.
The fit results of these modelled data sets, performed without any smoothing, were then compared with the fit results acquired using
(a) the maximum entropy algorithm (called MaxEnt), as used in Irena and GSAS-II, adapted from GSAS-II's source code (Advanced Photon Source, 2024
), with a maximum iteration number of 104, and
(b) Monte Carlo simulation, obtained directly from McSAS (Bressler et al., 2015
), with a maximum of 106 iterations.
Both methods were run using an identical pore size range and binning to PRINSAS. Representative examples are shown in Figs. 4–7, with the remaining test cases shown in Section S1. Results from MaxEnt and McSAS are displayed on either linear or logarithmic scales, depending on which best represents the fit.
For structures with broad but distinct features, PRINSAS can reliably reconstruct the input volume-weighted size distribution, with only minor discrepancies near the edges of the r range, and produces results comparable to those from MaxEnt and McSAS (Fig. 4
). However, in cases involving SAS data with sharp features (Fig. 5
), PRINSAS, while accurately capturing the position and magnitude of the dominant peak, introduces an artificial smaller feature on the left-hand side of the dominant peak, which does not exist in IQ0(ri)sim.
| Figure 4 Fitting of the PDSP model to a power-law pore network superimposed with a bidisperse pore distribution. (a) Comparison between the simulated and fitted pore distributions. Simulated data and PRINSAS results are plotted on a log scale on the left-hand axis, whereas MaxEnt and McSAS results are plotted on a linear scale on the right-hand axis. (b) Comparison between the corresponding simulated and fitted I(Q). |
| Figure 5 Fitting of the PDSP model to a power-law pore network superimposed with a sharp monodispersed pore distribution. (a) Comparison between the simulated and fitted pore distributions. Simulated data and PRINSAS results are plotted on a log scale (left-hand axis), whereas MaxEnt and McSAS results are plotted on a linear scale (right-hand axis). The inset shows the PRINSAS fit result with a smoothing factor λ > 0. (b) Comparison between the corresponding simulated and fitted I(Q). |
We postulate that this artefact arises from the large intensity difference between the peak and its surrounding regions. In cases where the scattering intensity is dominated by sharp features, these features primarily influence the overall scattering profile. As a result, beyond a certain threshold difference in pore concentration between the dominant-size feature and its surroundings, contributions from non-dominant pores become negligible. Consequently, the convergence of the fitted I(Q) curve to the simulated I(Q) in the Q regions surrounding the peak occurs without requiring a perfect match between IQ0(ri)fit and the original IQ0(ri)sim. Introducing a smoothing factor suppresses this artefact while preserving the dominant structural feature [inset of Fig. 5
(a)]; nevertheless, mismatches in the regions surrounding the sharp peak remain unresolved.
The high discrepancy in concentration across different r values affecting the fit results is also evident in Fig. S4, where the fitting algorithm overestimates the density at a sharp local minimum in the middle of the IQ0(ri) profile. There appears to be no clear threshold for peak sharpness that triggers significant discrepancies between IQ0(ri)fit and IQ0(ri)sim. Consequently, when applying the PDSP model to systems with strongly preferential pore size distributions, the fit results are reliable for identifying the sizes of the dominant pores and their corresponding concentration and SSA values. The fitted results of the underlying structure, on the other hand, should be interpreted with caution.
For systems consisting of non-distinct pore features (Fig. 6
), commonly encountered in geological materials, or those lacking clear Gaussian-like combinations of pore populations (Fig. 7
), we could not obtain a satisfactory fit using McSAS, while both PRINSAS and MaxEnt show good agreement with each other and are capable of accurately reconstructing the original pore size distribution.
| Figure 6 Fitting of the PDSP model to a power-law pore network with the addition of random noise values. (a) Comparison between the simulated and fitted pore distributions. McSAS fit results could not be obtained after 106 iterations. (b) Comparison between the corresponding simulated and fitted I(Q). |
| Figure 7 Fitting of the PDSP model to a power-law pore network with a bidisperse pore distribution subtracted to introduce two valleys in the data; such a system does not have real-life analogues and is used here to assess the software's stability. (a) Comparison between the simulated and fitted pore distributions. McSAS fit results could not be obtained after 106 iterations. (b) Comparison between the corresponding simulated and fitted I(Q). |
6. Conclusion
PRINSAS 2.0 delivers critical updates to the original 2004 software by transitioning from proprietary Microsoft Excel and Access frameworks to an open-source Python platform. Redesigned explicitly for geoscientists analysing porous materials, the new software streamlines the polydisperse spherical pore model fitting process via an intuitive graphical user interface. Its modular architecture allows further development of additional application-specific features, including seamless integration of the core fitting function fit_PDSP_model() into other Python-based SAS analysis tools.
This paper outlines the scientific background and design rationale underpinning the PDSP fitting procedure, facilitating future enhancements and integration with other software packages. Validation against synthetic data sets and experimental SANS/USANS profiles, along with comparisons with other established tools, demonstrates the software's robust performance in reconstructing complex pore size distributions. Additionally, its compatibility with diverse input data formats ensures broad applicability.
By prioritizing accessibility without compromising analytical precision, PRINSAS 2.0 allows non-specialist users to employ neutron scattering data more effectively for advanced nanoscale characterization of porous systems. Future software developments may extend the model to incorporate non-spherical pore geometries, further enhancing its utility across interdisciplinary research domains.
Supporting information
Additional results and user instructions. DOI: https://doi.org/10.1107/S1600576725004315/vb5093sup1.pdf
Acknowledgements
The authors would like to thank Dr Yeping Ji (CSIRO), Dr Liliana de Campo (ANSTO), Dr Mihaela Grigore (CSIRO) and Dr Anna Sokolova (ANSTO) for their valuable feedback and suggestions on both the manuscript and the program, as well as for their assistance in testing the program. We also thank the co-editor and anonymous reviewers for their in-depth technical feedback, which has significantly improved the scientific basis and performance of the program. PRINSAS's logo neutron_bear.ico was illustrated by Nhu Pham upon the authors' request, based on their ideas and sketches. Open access publishing facilitated by University of New South Wales, as part of the Wiley–University of New South Wales agreement via the Council of Australian University Librarians.
Funding information
The following funding is acknowledged: Australian Research Council, Centre of Excellence for Carbon Science Innovation (grant No. CE230100032 to Klaus Regenauer-Lieb); Australian Research Council, Linkage Infrastructure, Equipment and Facilities Grant (grant No. LE200100209 to Klaus Regenauer-Lieb).
References
Advanced Photon Source (2024). GSASIIsasd.py, https://github.com/AdvancedPhotonSource/GSAS-II/blob/master/GSASII/GSASIIsasd.py. Google Scholar
ANSTO (2024). OPAL 2024 upgrade – cold neutron source replacement, https://vimeo.com/901758770. Google Scholar
Arnold, O., Bilheux, J. C., Borreguero, J. M., Buts, A., Campbell, S. I., Chapon, L., Doucet, M., Draper, N., Ferraz Leal, R., Gigg, M. A., Lynch, V. E., Markvardsen, A., Mikkelson, D. J., Mikkelson, R. L., Miller, R., Palmen, K., Parker, P., Passos, G., Perring, T. G., Peterson, P. F., Ren, S., Reuter, M. A., Savici, A. T., Taylor, J. W., Taylor, R. J., Tolchenov, R., Zhou, W. & Zikovsky, J. (2014). Nucl. Instrum. Methods Phys. Res. A 764, 156–166. CrossRef CAS Google Scholar
Babinet (1837). Annal. Phys. 118, 30–37. Google Scholar
Bahadur, J., Radlinski, A. P., Melnichenko, Y. B., Mastalerz, M. & Schimmelmann, A. (2015). Energy Fuels 29, 567–576. CrossRef CAS Google Scholar
Bahadur, J., Ruppert, L. F., Pipich, V., Sakurovs, R. & Melnichenko, Y. B. (2018). Int. J. Coal Geol. 188, 156–164. Web of Science CrossRef CAS Google Scholar
Blach, T., Radlinski, A. P., Vu, P., Ji, Y., de Campo, L., Gilbert, E. P., Regenauer-Lieb, K. & Mastalerz, M. (2021). Energies 14, 8438. CrossRef Google Scholar
Bressler, I., Pauw, B. R. & Thünemann, A. F. (2015). J. Appl. Cryst. 48, 962–969. Web of Science CrossRef CAS IUCr Journals Google Scholar
Cnudde, V. & Boone, M. N. (2013). Earth-Sci. Rev. 123, 1–17. Web of Science CrossRef Google Scholar
Engelman, D. M. & Moore, P. B. (1975). Annu. Rev. Biophys. 4, 219–241. CAS Google Scholar
Hinde, A. L. (2004). J. Appl. Cryst. 37, 1020–1024. Web of Science CrossRef CAS IUCr Journals Google Scholar
Ilavsky, J. & Jemian, P. R. (2009). J. Appl. Cryst. 42, 347–353. Web of Science CrossRef CAS IUCr Journals Google Scholar
International Atomic Energy Agency (2024). Optimization of research reactor availability and reliability: recommended practices. Vienna: International Atomic Energy Agency. Google Scholar
Kroupa, G., Bruckner, G., Bolik, O., Zawisky, M., Hainbuchner, M., Badurek, G., Buchelt, R. J., Schricker, A. & Rauch, H. (2000). Nucl. Instrum. Methods Phys. Res. A 440, 604–608. CrossRef CAS Google Scholar
Lindner, P., May, R. P. & Timmins, P. A. (1992). Physica B 180–181, 967–972. CrossRef Google Scholar
Lindner, P. & Schweins, R. (2010). Neutron News 21(2), 15–18. CrossRef Google Scholar
Melnichenko, Y. (2016). Small-angle scattering from confined and interfacial fluids: applications to energy storage and environmental science. Heidelberg: Springer. Google Scholar
Oak Ridge National Laboratory (2023). Spallation Neutron Source accelerator achieves world-record 1.7-megawatt power level to enable more scientific discoveries, https://www.ornl.gov/news/spallation-neutron-source-accelerator-achieves-world-record-17-megawatt-power-level-enable. Google Scholar
Pauw, B. R. (2015). BAMresearch/McSAS, test data, https://github.com/BAMresearch/McSAS/tree/main/testdata. Google Scholar
Potton, J. A., Daniell, G. J. & Rainford, B. D. (1988). J. Appl. Cryst. 21, 663–668. CrossRef Web of Science IUCr Journals Google Scholar
Radlinski, A. P. (2006). Rev. Mineral. Geochem. 63, 363–397. Web of Science CrossRef CAS Google Scholar
Radlinski, A. P., Blach, T., Vu, P., Ji, Y., de Campo, L., Gilbert, E. P., Regenauer-Lieb, K. & Mastalerz, M. (2021). Int. J. Coal Geol. 248, 103850. Web of Science CrossRef Google Scholar
Radliński, A. P., Boreham, C. J., Lindner, P., Randl, O., Wignall, G. D., Hinde, A. & Hope, J. M. (2000). Org. Geochem. 31, 1–14. Google Scholar
Radlinski, A. P., Boreham, C. J., Wignall, G. D. & Lin, J. S. (1996). Phys. Rev. B 53, 14152–14160. CrossRef CAS Google Scholar
Radlinski, A. P., Ioannidis, M. A., Hinde, A. L., Hainbuchner, M., Baron, M., Rauch, H. & Kline, S. R. (2004a). J. Colloid Interface Sci. 274, 607–612. Web of Science CrossRef PubMed CAS Google Scholar
Radlinski, A. P., Mastalerz, M., Hinde, A. L., Hainbuchner, M., Rauch, H., Baron, M., Lin, J. S., Fan, L. & Thiyagarajan, P. (2004b). Int. J. Coal Geol. 59, 245–271. Web of Science CrossRef CAS Google Scholar
Radlinski, A. P., Radlinska, E. Z., Agamalian, M., Wignall, G. D., Lindner, P. & Randl, O. G. (2000). J. Appl. Cryst. 33, 860–862. CrossRef CAS IUCr Journals Google Scholar
Rehm, C., de Campo, L., Brûlé, A., Darmann, F., Bartsch, F. & Berry, A. (2018). J. Appl. Cryst. 51, 1–8. Web of Science CrossRef CAS IUCr Journals Google Scholar
Rezaeyan, A., Pipich, V. & Busch, A. (2021). J. Appl. Cryst. 54, 697–706. CrossRef CAS IUCr Journals Google Scholar
Schelten, J., Ballard, D. G. H., Wignall, G. D., Longman, G. & Schmatz, W. (1976). Polymer 17, 751–757. CrossRef CAS Google Scholar
Sokolova, A., Whitten, A. E., de Campo, L., Christoforidis, J., Eltobaji, A., Barnes, J., Darmann, F. & Berry, A. (2019). J. Appl. Cryst. 52, 1–12. CrossRef CAS IUCr Journals Google Scholar
Toby, B. H. & Von Dreele, R. B. (2013). J. Appl. Cryst. 46, 544–549. Web of Science CrossRef CAS IUCr Journals Google Scholar
The SciPy community (2024). minimize. https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.minimize.html. Google Scholar
Von Dreele, R. B. (2014). J. Appl. Cryst. 47, 1784–1789. Web of Science CrossRef CAS IUCr Journals Google Scholar
Vu, P. N. H., Radlinski, A. P., Blach, T., Schweins, R., Lemmel, H., Daniels, J. & Regenauer-Lieb, K. (2024). J. Appl. Cryst. 57, 1311–1322. CrossRef CAS IUCr Journals Google Scholar
Wood, K., Mata, J. P., Garvey, C. J., Wu, C.-M., Hamilton, W. A., Abbeywick, P., Bartlett, D., Bartsch, F., Baxter, P., Booth, N., Brown, W., Christoforidis, J., Clowes, D., d'Adam, T., Darmann, F., Deura, M., Harrison, S., Hauser, N., Horton, G., Federici, D., Franceschini, F., Hanson, P., Imamovic, E., Imperia, P., Jones, M., Kennedy, S., Kim, S., Lam, T., Lee, W. T., Lesha, M., Mannicke, D., Noakes, T., Olsen, S. R., Osborn, J. C., Penny, D., Perry, M., Pullen, S. A., Robinson, R. A., Schulz, J. C., Xiong, N. & Gilbert, E. P. (2018). J. Appl. Cryst. 51, 294–314. Web of Science CrossRef CAS IUCr Journals Google Scholar
Xie, F., Xie, M., Song, B., Guo, Q. & Jiao, X. (2024). Chin. Phys. B 33, 120101. Google Scholar
This is an open-access article distributed under the terms of the Creative Commons Attribution (CC-BY) Licence, which permits unrestricted use, distribution, and reproduction in any medium, provided the original authors and source are cited.
access
journal menu



