Changeset 2941abf in sasmodels


Ignore:
Timestamp:
Oct 15, 2016 2:17:44 PM (8 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
ed0827a
Parents:
14838a3
Message:

rectangular prism: clean up equation formatting

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/rectangular_prism.py

    ra807206 r2941abf  
    33r""" 
    44 
    5 This model provides the form factor, *P(q)*, for a rectangular prism. 
     5This model provides the form factor, $P(q)$, for a rectangular prism. 
    66 
    77Note that this model is almost totally equivalent to the existing 
    88:ref:`parallelepiped` model. 
    99The only difference is that the way the relevant 
    10 parameters are defined here (*a*, *b/a*, *c/a* instead of *a*, *b*, *c*) 
     10parameters are defined here ($a$, $b/a$, $c/a$ instead of $a$, $b$, $c$) 
    1111which allows use of polydispersity with this model while keeping the shape of 
    12 the prism (e.g. setting *b/a* = 1 and *c/a* = 1 and applying polydispersity 
     12the prism (e.g. setting $b/a = 1$ and $c/a = 1$ and applying polydispersity 
    1313to *a* will generate a distribution of cubes of different sizes). 
    1414Note also that, contrary to :ref:`parallelepiped`, it does not compute 
     
    2424Note also that the angle definitions used in the code and the present 
    2525documentation correspond to those used in (Nayuk, 2012) (see Fig. 1 of 
    26 that reference), with |theta| corresponding to |alpha| in that paper, 
     26that reference), with $\theta$ corresponding to $\alpha$ in that paper, 
    2727and not to the usual convention used for example in the 
    2828:ref:`parallelepiped` model. As the present model does not compute 
     
    3030 
    3131In this model the scattering from a massive parallelepiped with an 
    32 orientation with respect to the scattering vector given by |theta| 
    33 and |phi| 
     32orientation with respect to the scattering vector given by $\theta$ 
     33and $\phi$ 
    3434 
    3535.. math:: 
    36   A_P\,(q) =  \frac{\sin \bigl( q \frac{C}{2} \cos\theta \bigr)}{\left( q \frac{C}{2} 
    37   \cos\theta \right)} \, \times \, \frac{\sin \bigl( q \frac{A}{2} \sin\theta \sin\phi 
    38   \bigr)}{\left( q \frac{A}{2} \sin\theta \sin\phi \right)} \, \times \, \frac{\sin \bigl( 
    39   q \frac{B}{2} \sin\theta \cos\phi \bigr)}{\left( q \frac{B}{2} \sin\theta \cos\phi \right)} 
    4036 
    41 where *A*, *B* and *C* are the sides of the parallelepiped and must fulfill 
    42 :math:`A \le B \le C`, |theta| is the angle between the *z* axis and the 
    43 longest axis of the parallelepiped *C*, and |phi| is the angle between the 
    44 scattering vector (lying in the *xy* plane) and the *y* axis. 
     37  A_P\,(q) = 
     38      \frac{\sin \left( \tfrac{1}{2}qC \cos\theta \right) }{\tfrac{1}{2} qC \cos\theta} 
     39      \,\times\, 
     40      \frac{\sin \left( \tfrac{1}{2}qA \cos\theta \right) }{\tfrac{1}{2} qA \cos\theta} 
     41      \,\times\ , 
     42      \frac{\sin \left( \tfrac{1}{2}qB \cos\theta \right) }{\tfrac{1}{2} qB \cos\theta} 
     43 
     44where $A$, $B$ and $C$ are the sides of the parallelepiped and must fulfill 
     45$A \le B \le C$, $\theta$ is the angle between the $z$ axis and the 
     46longest axis of the parallelepiped $C$, and $\phi$ is the angle between the 
     47scattering vector (lying in the $xy$ plane) and the $y$ axis. 
    4548 
    4649The normalized form factor in 1D is obtained averaging over all possible 
     
    4851 
    4952.. math:: 
    50   P(q) =  \frac{2}{\pi} \times \, \int_0^{\frac{\pi}{2}} \, 
     53  P(q) =  \frac{2}{\pi} \int_0^{\frac{\pi}{2}} \, 
    5154  \int_0^{\frac{\pi}{2}} A_P^2(q) \, \sin\theta \, d\theta \, d\phi 
    5255 
     
    5457 
    5558.. math:: 
    56   I(q) = \mbox{scale} \times V \times (\rho_{\mbox{p}} - 
    57   \rho_{\mbox{solvent}})^2 \times P(q) 
     59  I(q) = \text{scale} \times V \times (\rho_\text{p} - 
     60  \rho_\text{solvent})^2 \times P(q) 
    5861 
    59 where *V* is the volume of the rectangular prism, :math:`\rho_{\mbox{p}}` 
    60 is the scattering length of the parallelepiped, :math:`\rho_{\mbox{solvent}}` 
     62where $V$ is the volume of the rectangular prism, $\rho_\text{p}$ 
     63is the scattering length of the parallelepiped, $\rho_\text{solvent}$ 
    6164is the scattering length of the solvent, and (if the data are in absolute 
    6265units) *scale* represents the volume fraction (which is unitless). 
Note: See TracChangeset for help on using the changeset viewer.