Changeset 35d2300 in sasmodels for example/weights/maier_saupe_eq.py
- Timestamp:
- Sep 13, 2018 8:08:42 PM (6 years ago)
- Branches:
- master
- Children:
- b50e28b
- Parents:
- a5cb9bc
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
example/weights/maier_saupe_eq.py
r55e82f0 r35d2300 10 10 .. math: 11 11 12 w(\theta) = e^{ P_2{\cos^2 \theta}}12 w(\theta) = e^{a{\cos^2 \theta}} 13 13 14 14 This provides a close match to the gaussian distribution for 15 low angles, but the tails are limited to $\pm 90^\circ$. For $ P_2\ll 1$15 low angles, but the tails are limited to $\pm 90^\circ$. For $a \ll 1$ 16 16 the distribution is approximately uniform. The usual polar coordinate 17 17 projection applies, with $\theta$ weights scaled by $\cos \theta$ … … 36 36 # Note: center is always zero for orientation distributions 37 37 def _weights(self, center, sigma, lb, ub): 38 # use the width parameter as the value for Maier-Saupe P_239 P2= sigma40 sigma = 1./sqrt(2.* P2)38 # use the width parameter as the value for Maier-Saupe "a" 39 a = sigma 40 sigma = 1./sqrt(2.*a) 41 41 42 42 # Create a lookup table for finding n points equally spaced … … 49 49 # we can scale by an arbitrary scale factor c = exp(m) to get: 50 50 # w = exp(m*cos(x)**2)/c = exp(-m*sin(x)**2) 51 yp = np.cumsum(exp(- P2*sin(xp)**2))51 yp = np.cumsum(exp(-a*sin(xp)**2)) 52 52 yp /= yp[-1] 53 53
Note: See TracChangeset
for help on using the changeset viewer.