Changeset 75e4319 in sasmodels
- Timestamp:
- Oct 28, 2017 9:31:28 AM (7 years ago)
- Branches:
- master, core_shell_microgels, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- a70959a
- Parents:
- a5a12ca
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/guide/pd/polydispersity.rst
ra5a12ca r75e4319 43 43 44 44 * *Rectangular Distribution* 45 * *Uniform Distribution* 45 46 * *Gaussian Distribution* 46 47 * *Lognormal Distribution* … … 83 84 84 85 Rectangular distribution. 86 87 Uniform Distribution 88 ^^^^^^^^^^^^^^^^^^^^^^^^ 89 90 The 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. 85 111 86 112 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ -
sasmodels/weights.py
ra5a12ca r75e4319 97 97 return x, px 98 98 99 class UniformDispersion(Dispersion): 100 r""" 101 Uniform dispersion, with width $\sigma$. 102 103 .. math:: 104 105 w = 1 106 """ 107 type = "uniform" 108 default = dict(npts=35, width=0, nsigmas=1) 109 def _weights(self, center, sigma, lb, ub): 110 x = self._linspace(center, sigma, lb, ub) 111 x = x[np.fabs(x-center) <= np.fabs(sigma)] 112 return x, np.ones_like(x) 99 113 100 114 class RectangleDispersion(Dispersion): … … 210 224 MODELS = OrderedDict((d.type, d) for d in ( 211 225 RectangleDispersion, 226 UniformDispersion, 212 227 ArrayDispersion, 213 228 LogNormalDispersion,
Note: See TracChangeset
for help on using the changeset viewer.