source: sasmodels/doc/guide/pd/polydispersity.rst @ d712a0f

core_shell_microgelsmagnetic_modelticket-1257-vesicle-productticket_1156ticket_1265_superballticket_822_more_unit_tests
Last change on this file since d712a0f was d712a0f, checked in by smk78, 6 years ago

Further tweaks to polydispersity.rst

  • Property mode set to 100644
File size: 11.6 KB
RevLine 
[990d8df]1.. pd_help.rst
2
3.. This is a port of the original SasView html help file to ReSTructured text
4.. by S King, ISIS, during SasView CodeCamp-III in Feb 2015.
5
6.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
7
[eda8b30]8.. _polydispersityhelp:
9
[990d8df]10Polydispersity Distributions
11----------------------------
12
[eda8b30]13With some models in sasmodels we can calculate the average intensity for a
[990d8df]14population of particles that exhibit size and/or orientational
[eda8b30]15polydispersity. The resultant intensity is normalized by the average
[990d8df]16particle volume such that
17
18.. math::
19
20  P(q) = \text{scale} \langle F^* F \rangle / V + \text{background}
21
[d712a0f]22where $F$ is the scattering amplitude and $\langle\cdot\rangle$ denotes an
23average over the size distribution $f(x; \bar x, \sigma)$, giving
24
25.. math::
26
27  P(q) = \frac{\text{scale}}{V} \int_\mathbb{R}
28  f(x; \bar x, \sigma) F^2(q, x)\, dx + \text{background}
[990d8df]29
[ed5b109]30Each distribution is characterized by a center value $\bar x$ or
31$x_\text{med}$, a width parameter $\sigma$ (note this is *not necessarily*
32the standard deviation, so read the description carefully), the number of
33sigmas $N_\sigma$ to include from the tails of the distribution, and the
34number of points used to compute the average. The center of the distribution
[29afc50]35is set by the value of the model parameter. The meaning of a polydispersity
36parameter *PD* (not to be confused with a molecular weight distributions
37in polymer science) in a model depends on the type of parameter it is being
38applied too.
[ed5b109]39
[29afc50]40The distribution width applied to *volume* (ie, shape-describing) parameters
41is relative to the center value such that $\sigma = \mathrm{PD} \cdot \bar x$.
42However, the distribution width applied to *orientation* (ie, angle-describing)
43parameters is just $\sigma = \mathrm{PD}$.
[ed5b109]44
45$N_\sigma$ determines how far into the tails to evaluate the distribution,
46with larger values of $N_\sigma$ required for heavier tailed distributions.
[990d8df]47The scattering in general falls rapidly with $qr$ so the usual assumption
[d712a0f]48that $f(r - 3\sigma_r)$ is tiny and therefore $f(r - 3\sigma_r)f(r - 3\sigma_r)$
[990d8df]49will not contribute much to the average may not hold when particles are large.
50This, too, will require increasing $N_\sigma$.
51
52Users should note that the averaging computation is very intensive. Applying
53polydispersion to multiple parameters at the same time or increasing the
54number of points in the distribution will require patience! However, the
55calculations are generally more robust with more data points or more angles.
56
[22279a4]57The following distribution functions are provided:
[990d8df]58
[75e4319]59*  *Uniform Distribution*
[5026e05]60*  *Rectangular Distribution*
[990d8df]61*  *Gaussian Distribution*
[5026e05]62*  *Boltzmann Distribution*
[990d8df]63*  *Lognormal Distribution*
64*  *Schulz Distribution*
65*  *Array Distribution*
66
67These are all implemented as *number-average* distributions.
68
[5026e05]69Additional distributions are under consideration.
[990d8df]70
[d712a0f]71.. note:: In 2009 IUPAC decided to introduce the new term 'dispersity' to replace
72           the term 'polydispersity' (see `Pure Appl. Chem., (2009), 81(2),
73           351-353 <http://media.iupac.org/publications/pac/2009/pdf/8102x0351.pdf>`_
74           in order to make the terminology describing distributions of properties
75           unambiguous. Throughout the SasView documentation we continue to use the
76           term polydispersity because one of the consequences of the IUPAC change is
77           that orientational polydispersity would not meet their new criteria (which
78           requires dispersity to be dimensionless).
79
[5026e05]80Suggested Applications
81^^^^^^^^^^^^^^^^^^^^^^
[990d8df]82
[ed5b109]83If applying polydispersion to parameters describing particle sizes, use
[5026e05]84the Lognormal or Schulz distributions.
[990d8df]85
[ed5b109]86If applying polydispersion to parameters describing interfacial thicknesses
[5026e05]87or angular orientations, use the Gaussian or Boltzmann distributions.
[990d8df]88
[29afc50]89If applying polydispersion to parameters describing angles, use the Uniform
90distribution. Beware of using distributions that are always positive (eg, the
91Lognormal) because angles can be negative!
92
[5026e05]93The array distribution allows a user-defined distribution to be applied.
[990d8df]94
[5026e05]95.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
[990d8df]96
[5026e05]97Uniform Distribution
98^^^^^^^^^^^^^^^^^^^^
[990d8df]99
[5026e05]100The Uniform Distribution is defined as
[990d8df]101
[f4ae8c4]102.. math::
[990d8df]103
[f4ae8c4]104    f(x) = \frac{1}{\text{Norm}}
105    \begin{cases}
106        1 & \text{for } |x - \bar x| \leq \sigma \\
107        0 & \text{for } |x - \bar x| > \sigma
108    \end{cases}
[990d8df]109
[f4ae8c4]110where $\bar x$ ($x_\text{mean}$ in the figure) is the mean of the
111distribution, $\sigma$ is the half-width, and *Norm* is a normalization
112factor which is determined during the numerical calculation.
[990d8df]113
[f4ae8c4]114The polydispersity in sasmodels is given by
[990d8df]115
[f4ae8c4]116.. math:: \text{PD} = \sigma / \bar x
[92d330fd]117
[f4ae8c4]118.. figure:: pd_uniform.jpg
[3d58247]119
[f4ae8c4]120    Uniform distribution.
[990d8df]121
[5026e05]122The value $N_\sigma$ is ignored for this distribution.
123
124.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
125
126Rectangular Distribution
[75e4319]127^^^^^^^^^^^^^^^^^^^^^^^^
128
[5026e05]129The Rectangular Distribution is defined as
[75e4319]130
[f4ae8c4]131.. math::
[75e4319]132
[f4ae8c4]133    f(x) = \frac{1}{\text{Norm}}
134    \begin{cases}
135        1 & \text{for } |x - \bar x| \leq w \\
136        0 & \text{for } |x - \bar x| > w
137    \end{cases}
[75e4319]138
[f4ae8c4]139where $\bar x$ ($x_\text{mean}$ in the figure) is the mean of the
140distribution, $w$ is the half-width, and *Norm* is a normalization
141factor which is determined during the numerical calculation.
[75e4319]142
[f4ae8c4]143Note that the standard deviation and the half width $w$ are different!
[75e4319]144
[f4ae8c4]145The standard deviation is
[75e4319]146
[f4ae8c4]147.. math:: \sigma = w / \sqrt{3}
[75e4319]148
[f4ae8c4]149whilst the polydispersity in sasmodels is given by
[92d330fd]150
[f4ae8c4]151.. math:: \text{PD} = \sigma / \bar x
[5026e05]152
[f4ae8c4]153.. figure:: pd_rectangular.jpg
[5026e05]154
[f4ae8c4]155    Rectangular distribution.
[ed5b109]156
[f4ae8c4]157.. note:: The Rectangular Distribution is deprecated in favour of the
158            Uniform Distribution above and is described here for backwards
159            compatibility with earlier versions of SasView only.
[75e4319]160
[990d8df]161.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
162
163Gaussian Distribution
164^^^^^^^^^^^^^^^^^^^^^
165
166The Gaussian Distribution is defined as
167
[f4ae8c4]168.. math::
[5026e05]169
[f4ae8c4]170    f(x) = \frac{1}{\text{Norm}}
171            \exp\left(-\frac{(x - \bar x)^2}{2\sigma^2}\right)
[990d8df]172
[f4ae8c4]173where $\bar x$ ($x_\text{mean}$ in the figure) is the mean of the
174distribution and *Norm* is a normalization factor which is determined
175during the numerical calculation.
[990d8df]176
[f4ae8c4]177The polydispersity in sasmodels is given by
[990d8df]178
[f4ae8c4]179.. math:: \text{PD} = \sigma / \bar x
[5026e05]180
[f4ae8c4]181.. figure:: pd_gaussian.jpg
[5026e05]182
[f4ae8c4]183    Normal distribution.
[5026e05]184
185.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
186
187Boltzmann Distribution
188^^^^^^^^^^^^^^^^^^^^^^
189
190The Boltzmann Distribution is defined as
[990d8df]191
[f4ae8c4]192.. math::
[990d8df]193
[f4ae8c4]194    f(x) = \frac{1}{\text{Norm}}
195            \exp\left(-\frac{ | x - \bar x | }{\sigma}\right)
[990d8df]196
[f4ae8c4]197where $\bar x$ ($x_\text{mean}$ in the figure) is the mean of the
198distribution and *Norm* is a normalization factor which is determined
199during the numerical calculation.
[5026e05]200
[f4ae8c4]201The width is defined as
[5026e05]202
[f4ae8c4]203.. math:: \sigma=\frac{k T}{E}
[5026e05]204
[f4ae8c4]205which is the inverse Boltzmann factor, where $k$ is the Boltzmann constant,
206$T$ the temperature in Kelvin and $E$ a characteristic energy per particle.
[5026e05]207
[f4ae8c4]208.. figure:: pd_boltzmann.jpg
[5026e05]209
[f4ae8c4]210    Boltzmann distribution.
[990d8df]211
212.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
213
214Lognormal Distribution
215^^^^^^^^^^^^^^^^^^^^^^
216
[ed5b109]217The Lognormal Distribution describes a function of $x$ where $\ln (x)$ has
218a normal distribution. The result is a distribution that is skewed towards
219larger values of $x$.
[5026e05]220
[990d8df]221The Lognormal Distribution is defined as
222
[f4ae8c4]223.. math::
[990d8df]224
[f4ae8c4]225    f(x) = \frac{1}{\text{Norm}}\frac{1}{x\sigma}
226            \exp\left(-\frac{1}{2}
227                        \bigg(\frac{\ln(x) - \mu}{\sigma}\bigg)^2\right)
[990d8df]228
[f4ae8c4]229where *Norm* is a normalization factor which will be determined during
230the numerical calculation, $\mu=\ln(x_\text{med})$ and $x_\text{med}$
231is the *median* value of the *lognormal* distribution, but $\sigma$ is
232a parameter describing the width of the underlying *normal* distribution.
[ed5b109]233
[f4ae8c4]234$x_\text{med}$ will be the value given for the respective size parameter
235in sasmodels, for example, *radius=60*.
[990d8df]236
[f4ae8c4]237The polydispersity in sasmodels is given by
[990d8df]238
[29afc50]239.. math:: \text{PD} = \sigma = p / x_\text{med}
[990d8df]240
[29afc50]241The mean value of the distribution is given by $\bar x = \exp(\mu+ \sigma^2/2)$
242and the peak value by $\max x = \exp(\mu - \sigma^2)$.
[990d8df]243
[f4ae8c4]244The variance (the square of the standard deviation) of the *lognormal*
245distribution is given by
[990d8df]246
[f4ae8c4]247.. math::
[990d8df]248
[f4ae8c4]249    \nu = [\exp({\sigma}^2) - 1] \exp({2\mu + \sigma^2})
[990d8df]250
[f4ae8c4]251Note that larger values of PD might need a larger number of points
252and $N_\sigma$.
[ed5b109]253
[f4ae8c4]254.. figure:: pd_lognormal.jpg
[990d8df]255
[29afc50]256    Lognormal distribution for PD=0.1.
[990d8df]257
[5026e05]258For further information on the Lognormal distribution see:
[ed5b109]259http://en.wikipedia.org/wiki/Log-normal_distribution and
[5026e05]260http://mathworld.wolfram.com/LogNormalDistribution.html
[990d8df]261
262.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
263
264Schulz Distribution
265^^^^^^^^^^^^^^^^^^^
266
[ed5b109]267The Schulz (sometimes written Schultz) distribution is similar to the
268Lognormal distribution, in that it is also skewed towards larger values of
269$x$, but which has computational advantages over the Lognormal distribution.
[5026e05]270
[990d8df]271The Schulz distribution is defined as
272
[f4ae8c4]273.. math::
[990d8df]274
[f4ae8c4]275    f(x) = \frac{1}{\text{Norm}} (z+1)^{z+1}(x/\bar x)^z
276            \frac{\exp[-(z+1)x/\bar x]}{\bar x\Gamma(z+1)}
[990d8df]277
[f4ae8c4]278where $\bar x$ ($x_\text{mean}$ in the figure) is the mean of the
279distribution, *Norm* is a normalization factor which is determined
280during the numerical calculation, and $z$ is a measure of the width
281of the distribution such that
[990d8df]282
[f4ae8c4]283.. math:: z = (1-p^2) / p^2
[990d8df]284
[f4ae8c4]285where $p$ is the polydispersity in sasmodels given by
[990d8df]286
[f4ae8c4]287.. math:: PD = p = \sigma / \bar x
[990d8df]288
[f4ae8c4]289and $\sigma$ is the RMS deviation from $\bar x$.
[ed5b109]290
[f4ae8c4]291Note that larger values of PD might need a larger number of points
292and $N_\sigma$. For example, for PD=0.7 with radius=60 |Ang|, at least
293Npts>=160 and Nsigmas>=15 are required.
[990d8df]294
[f4ae8c4]295.. figure:: pd_schulz.jpg
[990d8df]296
[f4ae8c4]297    Schulz distribution.
[990d8df]298
299For further information on the Schulz distribution see:
[5026e05]300M Kotlarchyk & S-H Chen, *J Chem Phys*, (1983), 79, 2461 and
[ed5b109]301M Kotlarchyk, RB Stephens, and JS Huang, *J Phys Chem*, (1988), 92, 1533
[990d8df]302
303.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
304
305Array Distribution
306^^^^^^^^^^^^^^^^^^
307
[a5a12ca]308This user-definable distribution should be given as a simple ASCII text
[990d8df]309file where the array is defined by two columns of numbers: $x$ and $f(x)$.
310The $f(x)$ will be normalized to 1 during the computation.
311
312Example of what an array distribution file should look like:
313
314====  =====
315 30    0.1
316 32    0.3
317 35    0.4
318 36    0.5
319 37    0.6
320 39    0.7
321 41    0.9
322====  =====
323
324Only these array values are used computation, therefore the parameter value
325given for the model will have no affect, and will be ignored when computing
326the average.  This means that any parameter with an array distribution will
[a5a12ca]327not be fitable.
328
329.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
330
[990d8df]331Note about DLS polydispersity
332^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
333
334Many commercial Dynamic Light Scattering (DLS) instruments produce a size
[1f058ea]335polydispersity parameter, sometimes even given the symbol $p$\ ! This
[990d8df]336parameter is defined as the relative standard deviation coefficient of
337variation of the size distribution and is NOT the same as the polydispersity
338parameters in the Lognormal and Schulz distributions above (though they all
339related) except when the DLS polydispersity parameter is <0.13.
340
[5026e05]341.. math::
342
343    p_{DLS} = \sqrt(\nu / \bar x^2)
344
[ed5b109]345where $\nu$ is the variance of the distribution and $\bar x$ is the mean
[f4ae8c4]346value of $x$.
[5026e05]347
[990d8df]348For more information see:
349S King, C Washington & R Heenan, *Phys Chem Chem Phys*, (2005), 7, 143
350
351.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
352
353*Document History*
354
355| 2015-05-01 Steve King
356| 2017-05-08 Paul Kienzle
[5026e05]357| 2018-03-20 Steve King
[29afc50]358| 2018-04-04 Steve King
Note: See TracBrowser for help on using the repository browser.