Changeset 19dcb933 in sasmodels for sasmodels/models/cylinder.py


Ignore:
Timestamp:
Sep 3, 2014 3:16:10 AM (10 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
1c7ffdc
Parents:
87985ca
Message:

build docs for models

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/cylinder.py

    r5d4777d r19dcb933  
    1414.. math:: 
    1515 
    16     P(q,\alpha) = \frac{\text{scale}}{V}f^2(q) + \text{bkg} 
     16    P(Q,\alpha) = {\text{scale} \over V} F^2(Q) + \text{background} 
    1717 
    1818where 
     
    2020.. math:: 
    2121 
    22     f(q) = 2 (\Delta \rho) V 
    23            \frac{\sin (q L/2 \cos \alpha)}{q L/2 \cos \alpha} 
    24            \frac{J_1 (q r \sin \alpha)}{q r \sin \alpha} 
     22    F(Q) = 2 (\Delta \rho) V 
     23           {\sin \left(Q\tfrac12 L\cos\alpha \right) 
     24               \over Q\tfrac12 L \cos \alpha} 
     25           {J_1 \left(Q R \sin \alpha\right) \over Q R \sin \alpha} 
    2526 
    2627and $\alpha$ is the angle between the axis of the cylinder and $\vec q$, $V$ 
    27 is the volume of the cylinder, $L$ is the length of the cylinder, $r$ is the 
    28 radius of the cylinder, and $d\rho$ (contrast) is the scattering length density 
    29 difference between the scatterer and the solvent. $J_1$ is the first order 
    30 Bessel function. 
     28is the volume of the cylinder, $L$ is the length of the cylinder, $R$ is the 
     29radius of the cylinder, and $\Delta\rho$ (contrast) is the scattering length 
     30density difference between the scatterer and the solvent. $J_1$ is the 
     31first order Bessel function. 
    3132 
    3233To provide easy access to the orientation of the cylinder, we define the 
    3334axis of the cylinder using two angles $\theta$ and $\phi$. Those angles 
    34 are defined in Figure :num:`figure #cylinder-orientation`. 
     35are defined in :num:`figure #cylinder-orientation`. 
    3536 
    3637.. _cylinder-orientation: 
    3738 
    38 .. figure:: img/image061.JPG   (should be img/cylinder-1.jpg, or img/cylinder-orientation.jpg) 
     39.. figure:: img/orientation.jpg 
    3940 
    4041    Definition of the angles for oriented cylinders. 
    4142 
    42 .. figure:: img/image062.JPG 
     43.. figure:: img/orientation2.jpg 
    4344 
    4445    Examples of the angles for oriented pp against the detector plane. 
     
    5354.. math:: 
    5455 
    55     P(q) = \frac{\text{scale}}{V} 
    56         \int_0^{\pi/2} f^2(q,\alpha) \sin \alpha d\alpha + \text{background} 
     56    P(Q) = {\text{scale} \over V} 
     57        \int_0^{\pi/2} F^2(Q,\alpha) \sin \alpha\ d\alpha + \text{background} 
    5758 
    5859The *theta* and *phi* parameters are not used for the 1D output. Our 
     
    6566Validation of our code was done by comparing the output of the 1D model 
    6667to the output of the software provided by the NIST (Kline, 2006). 
    67 Figure :num:`figure #cylinder-compare` shows a comparison of 
     68:num:`Figure #cylinder-compare` shows a comparison of 
    6869the 1D output of our model and the output of the NIST software. 
    6970 
    7071.. _cylinder-compare: 
    7172 
    72 .. figure:: img/image065.JPG 
     73.. figure:: img/cylinder_compare.jpg 
    7374 
    7475    Comparison of the SasView scattering intensity for a cylinder with the 
    7576    output of the NIST SANS analysis software. 
    76     The parameters were set to: *Scale* = 1.0, *Radius* = 20 |Ang|, 
    77     *Length* = 400 |Ang|, *Contrast* = 3e-6 |Ang^-2|, and 
    78     *Background* = 0.01 |cm^-1|. 
     77    The parameters were set to: *scale* = 1.0, *radius* = 20 |Ang|, 
     78    *length* = 400 |Ang|, *contrast* = 3e-6 |Ang^-2|, and 
     79    *background* = 0.01 |cm^-1|. 
    7980 
    8081In general, averaging over a distribution of orientations is done by 
     
    8384.. math:: 
    8485 
    85     P(q) = \int_0^{\pi/2} d\phi 
    86         \int_0^\pi p(\theta, \phi) P_0(q,\alpha) \sin \theta d\theta 
     86    P(Q) = \int_0^{\pi/2} d\phi 
     87        \int_0^\pi p(\theta, \phi) P_0(Q,\alpha) \sin \theta\ d\theta 
    8788 
    8889 
    8990where $p(\theta,\phi)$ is the probability distribution for the orientation 
    90 and $P_0(q,\alpha)$ is the scattering intensity for the fully oriented 
     91and $P_0(Q,\alpha)$ is the scattering intensity for the fully oriented 
    9192system. Since we have no other software to compare the implementation of 
    9293the intensity for fully oriented cylinders, we can compare the result of 
    9394averaging our 2D output using a uniform distribution $p(\theta, \phi) = 1.0$. 
    94 Figure :num:`figure #cylinder-crosscheck` shows the result of 
     95:num:`Figure #cylinder-crosscheck` shows the result of 
    9596such a cross-check. 
    9697 
    9798.. _cylinder-crosscheck: 
    9899 
    99 .. figure:: img/image066.JPG 
     100.. figure:: img/cylinder_crosscheck.jpg 
    100101 
    101102    Comparison of the intensity for uniformly distributed cylinders 
    102103    calculated from our 2D model and the intensity from the NIST SANS 
    103104    analysis software. 
    104     The parameters used were: *Scale* = 1.0, *Radius* = 20 |Ang|, 
    105     *Length* = 400 |Ang|, *Contrast* = 3e-6 |Ang^-2|, and 
    106     *Background* = 0.0 |cm^-1|. 
     105    The parameters used were: *scale* = 1.0, *radius* = 20 |Ang|, 
     106    *length* = 400 |Ang|, *contrast* = 3e-6 |Ang^-2|, and 
     107    *background* = 0.0 |cm^-1|. 
    107108""" 
    108109 
Note: See TracChangeset for help on using the changeset viewer.