source: sasmodels/doc/guide/pd/polydispersity.rst @ 75e4319

core_shell_microgelsmagnetic_modelticket-1257-vesicle-productticket_1156ticket_1265_superballticket_822_more_unit_tests
Last change on this file since 75e4319 was 75e4319, checked in by dirk, 6 years ago

create uniform distribution and docs ticket addresses #764

  • Property mode set to 100644
File size: 8.2 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
8Polydispersity Distributions
9----------------------------
10
11With some models in sasmodels we can calculate the average form factor for a
12population of particles that exhibit size and/or orientational
13polydispersity. The resultant form factor is normalized by the average
14particle volume such that
15
16.. math::
17
18  P(q) = \text{scale} \langle F^* F \rangle / V + \text{background}
19
20where $F$ is the scattering amplitude and $\langle\cdot\rangle$ denotes an
21average over the size distribution.
22
23Each distribution is characterized by its center $\bar x$, its width $\sigma$,
24the number of sigmas $N_\sigma$ to include from the tails, and the number of
25points used to compute the average. The center of the distribution is set by the
26value of the model parameter.  Volume parameters have polydispersity *PD*
27(not to be confused with a molecular weight distributions in polymer science)
28leading to a size distribution of width $\text{PD} = \sigma / \bar x$, but
29orientation parameters use an angular distributions of width $\sigma$.
30$N_\sigma$ determines how far into the tails to evaluate the distribution, with
31larger values of $N_\sigma$ required for heavier tailed distributions.
32The scattering in general falls rapidly with $qr$ so the usual assumption
33that $G(r - 3\sigma_r)$ is tiny and therefore $f(r - 3\sigma_r)G(r - 3\sigma_r)$
34will not contribute much to the average may not hold when particles are large.
35This, too, will require increasing $N_\sigma$.
36
37Users should note that the averaging computation is very intensive. Applying
38polydispersion to multiple parameters at the same time or increasing the
39number of points in the distribution will require patience! However, the
40calculations are generally more robust with more data points or more angles.
41
[a5a12ca]42The following six distribution functions are provided:
[990d8df]43
44*  *Rectangular Distribution*
[75e4319]45*  *Uniform Distribution*
[990d8df]46*  *Gaussian Distribution*
47*  *Lognormal Distribution*
48*  *Schulz Distribution*
49*  *Array Distribution*
[a5a12ca]50*  *Boltzmann Distribution*
[990d8df]51
52These are all implemented as *number-average* distributions.
53
54.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
55
56Rectangular Distribution
57^^^^^^^^^^^^^^^^^^^^^^^^
58
59The Rectangular Distribution is defined as
60
61.. math::
62
63    f(x) = \frac{1}{\text{Norm}}
64    \begin{cases}
65      1 & \text{for } |x - \bar x| \leq w \\
66      0 & \text{for } |x - \bar x| > w
67    \end{cases}
68
69where $\bar x$ is the mean of the distribution, $w$ is the half-width, and
70*Norm* is a normalization factor which is determined during the numerical
71calculation.
72
73Note that the standard deviation and the half width $w$ are different!
74
75The standard deviation is
76
77.. math:: \sigma = w / \sqrt{3}
78
79whilst the polydispersity is
80
81.. math:: \text{PD} = \sigma / \bar x
82
83.. figure:: pd_rectangular.jpg
84
85    Rectangular distribution.
86
[75e4319]87Uniform Distribution
88^^^^^^^^^^^^^^^^^^^^^^^^
89
90The Uniform Distribution is defined as
91
92    .. math::
93
94        f(x) = \frac{1}{\text{Norm}}
95        \begin{cases}
96          1 & \text{for } |x - \bar x| \leq \sigma \\
97          0 & \text{for } |x - \bar x| > \sigma
98        \end{cases}
99
100    where $\bar x$ is the mean of the distribution, $\sigma$ is the half-width, and
101    *Norm* is a normalization factor which is determined during the numerical
102    calculation.
103
104    Note that the polydispersity is given by
105
106    .. math:: \text{PD} = \sigma / \bar x
107
108    .. figure:: pd_uniform.jpg
109
110        Uniform distribution.
111
[990d8df]112.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
113
114Gaussian Distribution
115^^^^^^^^^^^^^^^^^^^^^
116
117The Gaussian Distribution is defined as
118
119.. math::
120
121    f(x) = \frac{1}{\text{Norm}}
122           \exp\left(-\frac{(x - \bar x)^2}{2\sigma^2}\right)
123
[1f058ea]124where $\bar x$ is the mean of the distribution and *Norm* is a normalization
125factor which is determined during the numerical calculation.
[990d8df]126
127The polydispersity is
128
129.. math:: \text{PD} = \sigma / \bar x
130
131.. figure:: pd_gaussian.jpg
132
133    Normal distribution.
134
135.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
136
137Lognormal Distribution
138^^^^^^^^^^^^^^^^^^^^^^
139
140The Lognormal Distribution is defined as
141
142.. math::
143
144    f(x) = \frac{1}{\text{Norm}}
145           \frac{1}{xp}\exp\left(-\frac{(\ln(x) - \mu)^2}{2p^2}\right)
146
147where $\mu=\ln(x_\text{med})$ when $x_\text{med}$ is the median value of the
148distribution, and *Norm* is a normalization factor which will be determined
149during the numerical calculation.
150
[1f058ea]151The median value for the distribution will be the value given for the
152respective size parameter, for example, *radius=60*.
[990d8df]153
154The polydispersity is given by $\sigma$
155
156.. math:: \text{PD} = p
157
158For the angular distribution
159
160.. math:: p = \sigma / x_\text{med}
161
162The mean value is given by $\bar x = \exp(\mu+ p^2/2)$. The peak value
163is given by $\max x = \exp(\mu - p^2)$.
164
165.. figure:: pd_lognormal.jpg
166
167    Lognormal distribution.
168
169This distribution function spreads more, and the peak shifts to the left, as
170$p$ increases, so it requires higher values of $N_\sigma$ and more points
171in the distribution.
172
173.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
174
175Schulz Distribution
176^^^^^^^^^^^^^^^^^^^
177
178The Schulz distribution is defined as
179
180.. math::
181
182    f(x) = \frac{1}{\text{Norm}}
183           (z+1)^{z+1}(x/\bar x)^z\frac{\exp[-(z+1)x/\bar x]}{\bar x\Gamma(z+1)}
184
185where $\bar x$ is the mean of the distribution and *Norm* is a normalization
186factor which is determined during the numerical calculation, and $z$ is a
187measure of the width of the distribution such that
188
189.. math:: z = (1-p^2) / p^2
190
191The polydispersity is
192
193.. math:: p = \sigma / \bar x
194
195Note that larger values of PD might need larger number of points and $N_\sigma$.
196For example, at PD=0.7 and radius=60 |Ang|, Npts>=160 and Nsigmas>=15 at least.
197
198.. figure:: pd_schulz.jpg
199
200    Schulz distribution.
201
202For further information on the Schulz distribution see:
203M Kotlarchyk & S-H Chen, *J Chem Phys*, (1983), 79, 2461.
204
205.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
206
207Array Distribution
208^^^^^^^^^^^^^^^^^^
209
[a5a12ca]210This user-definable distribution should be given as a simple ASCII text
[990d8df]211file where the array is defined by two columns of numbers: $x$ and $f(x)$.
212The $f(x)$ will be normalized to 1 during the computation.
213
214Example of what an array distribution file should look like:
215
216====  =====
217 30    0.1
218 32    0.3
219 35    0.4
220 36    0.5
221 37    0.6
222 39    0.7
223 41    0.9
224====  =====
225
226Only these array values are used computation, therefore the parameter value
227given for the model will have no affect, and will be ignored when computing
228the average.  This means that any parameter with an array distribution will
[a5a12ca]229not be fitable.
230
231.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
232
233Boltzmann Distribution
234^^^^^^^^^^^^^^^^^^^^^^
235
236The Boltzmann Distribution is defined as
237
238.. math::
239
240    f(x) = \frac{1}{\text{Norm}}
241           \exp\left(-\frac{ | x - \bar x | }{\sigma}\right)
242
243where $\bar x$ is the mean of the distribution and *Norm* is a normalization
244factor which is determined during the numerical calculation.
245The width is defined as
246
247.. math:: \sigma=\frac{k T}{E}
248
249which is the inverse Boltzmann factor,
250where $k$ is the Boltzmann constant, $T$ the temperature in Kelvin and $E$ a
251characteristic energy per particle.
252
253.. figure:: pd_boltzmann.jpg
254
255    Boltzmann distribution.
[990d8df]256
257.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
258
259Note about DLS polydispersity
260^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
261
262Many commercial Dynamic Light Scattering (DLS) instruments produce a size
[1f058ea]263polydispersity parameter, sometimes even given the symbol $p$\ ! This
[990d8df]264parameter is defined as the relative standard deviation coefficient of
265variation of the size distribution and is NOT the same as the polydispersity
266parameters in the Lognormal and Schulz distributions above (though they all
267related) except when the DLS polydispersity parameter is <0.13.
268
269For more information see:
270S King, C Washington & R Heenan, *Phys Chem Chem Phys*, (2005), 7, 143
271
272.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
273
274*Document History*
275
276| 2015-05-01 Steve King
277| 2017-05-08 Paul Kienzle
Note: See TracBrowser for help on using the repository browser.