Changeset 35d2300 in sasmodels for example/weights/maier_saupe_eq.py


Ignore:
Timestamp:
Sep 13, 2018 8:08:42 PM (6 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master
Children:
b50e28b
Parents:
a5cb9bc
Message:

Relate order parameter P_2 to 'a' value in Maier-Saupe dist

File:
1 edited

Legend:

Unmodified
Added
Removed
  • example/weights/maier_saupe_eq.py

    r55e82f0 r35d2300  
    1010    .. math: 
    1111 
    12         w(\theta) = e^{P_2{\cos^2 \theta}} 
     12        w(\theta) = e^{a{\cos^2 \theta}} 
    1313 
    1414    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$ 
    1616    the distribution is approximately uniform.  The usual polar coordinate 
    1717    projection applies, with $\theta$ weights scaled by $\cos \theta$ 
     
    3636    # Note: center is always zero for orientation distributions 
    3737    def _weights(self, center, sigma, lb, ub): 
    38         # use the width parameter as the value for Maier-Saupe P_2 
    39         P2 = sigma 
    40         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) 
    4141 
    4242        # Create a lookup table for finding n points equally spaced 
     
    4949        # we can scale by an arbitrary scale factor c = exp(m) to get: 
    5050        #     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)) 
    5252        yp /= yp[-1] 
    5353 
Note: See TracChangeset for help on using the changeset viewer.