Changeset dbf1a60 in sasmodels for sasmodels/models/parallelepiped.py


Ignore:
Timestamp:
Mar 11, 2018 2:29:41 PM (6 years ago)
Author:
butler
Branches:
master, core_shell_microgels, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
9616dfe
Parents:
367886f
Message:

Add comments to c code and clean documentatin

Added comments to c code in both parallelepiped and core shell
parallelepiped noting the change of integration varialbes in the
computation. Cleaned up and final corrections to the core shell
documentation and did some cleaning of parallelipiped. In particular
tried to bring a bit more consistency between the docs.

addresses #896

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/parallelepiped.py

    r5bc373b rdbf1a60  
    3939 
    4040    I(q) = \frac{\text{scale}}{V} (\Delta\rho \cdot V)^2 
    41            \left< P(q, \alpha) \right> + \text{background} 
     41           \left< P(q, \alpha, \beta) \right> + \text{background} 
    4242 
    4343where the volume $V = A B C$, the contrast is defined as 
    44 $\Delta\rho = \rho_\text{p} - \rho_\text{solvent}$, 
    45 $P(q, \alpha)$ is the form factor corresponding to a parallelepiped oriented 
    46 at an angle $\alpha$ (angle between the long axis C and $\vec q$), 
    47 and the averaging $\left<\ldots\right>$ is applied over all orientations. 
     44$\Delta\rho = \rho_\text{p} - \rho_\text{solvent}$, $P(q, \alpha, \beta)$ 
     45is the form factor corresponding to a parallelepiped oriented 
     46at an angle $\alpha$ (angle between the long axis C and $\vec q$), and $\beta$ 
     47( the angle between the projection of the particle in the $xy$ detector plane 
     48and the $y$ axis) and the averaging $\left<\ldots\right>$ is applied over all 
     49orientations. 
    4850 
    4951Assuming $a = A/B < 1$, $b = B /B = 1$, and $c = C/B > 1$, the 
    50 form factor is given by (Mittelbach and Porod, 1961) 
     52form factor is given by (Mittelbach and Porod, 1961 [#Mittelbach]_) 
    5153 
    5254.. math:: 
     
    6668    \mu &= qB 
    6769 
    68 The scattering intensity per unit volume is returned in units of |cm^-1|. 
     70where substitution of $\sigma = cos\alpha$ and $\beta = \pi/2 \ u$ have been 
     71applied. 
    6972 
    7073NB: The 2nd virial coefficient of the parallelepiped is calculated based on 
     
    120123.. math:: 
    121124 
    122     P(q_x, q_y) = \left[\frac{\sin(\tfrac{1}{2}qA\cos\alpha)}{(\tfrac{1}{2}qA\cos\alpha)}\right]^2 
    123                   \left[\frac{\sin(\tfrac{1}{2}qB\cos\beta)}{(\tfrac{1}{2}qB\cos\beta)}\right]^2 
    124                   \left[\frac{\sin(\tfrac{1}{2}qC\cos\gamma)}{(\tfrac{1}{2}qC\cos\gamma)}\right]^2 
     125    P(q_x, q_y) = \left[\frac{\sin(\tfrac{1}{2}qA\cos\alpha)}{(\tfrac{1} 
     126                   {2}qA\cos\alpha)}\right]^2 
     127                  \left[\frac{\sin(\tfrac{1}{2}qB\cos\beta)}{(\tfrac{1} 
     128                   {2}qB\cos\beta)}\right]^2 
     129                  \left[\frac{\sin(\tfrac{1}{2}qC\cos\gamma)}{(\tfrac{1} 
     130                   {2}qC\cos\gamma)}\right]^2 
    125131 
    126132with 
     
    160166---------- 
    161167 
    162 P Mittelbach and G Porod, *Acta Physica Austriaca*, 14 (1961) 185-211 
    163  
    164 R Nayuk and K Huber, *Z. Phys. Chem.*, 226 (2012) 837-854 
     168.. [#Mittelbach] P Mittelbach and G Porod, *Acta Physica Austriaca*, 
     169   14 (1961) 185-211 
     170.. [#] R Nayuk and K Huber, *Z. Phys. Chem.*, 226 (2012) 837-854 
    165171 
    166172Authorship and Verification 
Note: See TracChangeset for help on using the changeset viewer.