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