Changeset a5d0d00 in sasmodels for sasmodels/models/bcc.py


Ignore:
Timestamp:
Feb 27, 2015 11:16:23 AM (9 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:
61ba623
Parents:
529b8b4
Message:

doc fixups: add doc category to model def, convert equations to latex for barbell and bcc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/bcc.py

    re166cb9 ra5d0d00  
    33#note - calculation requires double precision 
    44""" 
    5 Calculates the scattering from a **body-centered cubic lattice** with paracrystalline distortion. Thermal vibrations 
    6 are considered to be negligible, and the size of the paracrystal is infinitely large. Paracrystalline distortion is 
    7 assumed to be isotropic and characterized by a Gaussian distribution. 
     5Calculates the scattering from a **body-centered cubic lattice** with 
     6paracrystalline distortion. Thermal vibrations are considered to be negligible, 
     7and the size of the paracrystal is infinitely large. Paracrystalline distortion 
     8is assumed to be isotropic and characterized by a Gaussian distribution. 
    89 
    910The returned value is scaled to units of |cm^-1|\ |sr^-1|, absolute scale. 
     
    1213---------- 
    1314 
    14 The scattering intensity *I(q)* is calculated as 
     15The scattering intensity $I(q)$ is calculated as 
    1516 
    16 .. image:: img/image167.jpg 
     17.. math: 
    1718 
    18 where *scale* is the volume fraction of spheres, *Vp* is the volume of the primary particle, *V(lattice)* is a volume 
    19 correction for the crystal structure, *P(q)* is the form factor of the sphere (normalized), and *Z(q)* is the 
    20 paracrystalline structure factor for a body-centered cubic structure. 
     19    I(q) = \frac{\text{scale}}{V_P} V_\text{lattice} P(q) Z(q) 
    2120 
    22 Equation (1) of the 1990 reference is used to calculate *Z(q)*, using equations (29)-(31) from the 1987 paper for 
    23 *Z1*\ , *Z2*\ , and *Z3*\ . 
    2421 
    25 The lattice correction (the occupied volume of the lattice) for a body-centered cubic structure of particles of radius 
    26 *R* and nearest neighbor separation *D* is 
     22where *scale* is the volume fraction of spheres, *Vp* is the volume of the 
     23primary particle, *V(lattice)* is a volume correction for the crystal 
     24structure, $P(q)$ is the form factor of the sphere (normalized), and $Z(q)$ 
     25is the paracrystalline structure factor for a body-centered cubic structure. 
    2726 
    28 .. image:: img/image159.jpg 
     27Equation (1) of the 1990 reference is used to calculate $Z(q)$, using 
     28equations (29)-(31) from the 1987 paper for *Z1*\ , *Z2*\ , and *Z3*\ . 
    2929 
    30 The distortion factor (one standard deviation) of the paracrystal is included in the calculation of *Z(q)* 
     30The lattice correction (the occupied volume of the lattice) for a 
     31body-centered cubic structure of particles of radius $R$ and nearest neighbor 
     32separation $D$ is 
    3133 
    32 .. image:: img/image160.jpg 
     34.. math: 
    3335 
    34 where *g* is a fractional distortion based on the nearest neighbor distance. 
     36    V_\text{lattice} = \frac{16\pi}{3} \frac{R^3}{\left(D\sqrt{2}\right)^3} 
     37 
     38 
     39The distortion factor (one standard deviation) of the paracrystal is included 
     40in the calculation of $Z(q)$ 
     41 
     42.. math: 
     43 
     44    \Delta a = g D 
     45 
     46where $g$ is a fractional distortion based on the nearest neighbor distance. 
    3547 
    3648The body-centered cubic lattice is 
    3749 
    38 .. image:: img/image168.jpg 
     50.. image:: img/bcc_lattice.jpg 
    3951 
    4052For a crystal, diffraction peaks appear at reduced q-values given by 
    4153 
    42 .. image:: img/image162.jpg 
     54.. math: 
    4355 
    44 where for a body-centered cubic lattice, only reflections where (\ *h* + *k* + *l*\ ) = even are allowed and 
    45 reflections where (\ *h* + *k* + *l*\ ) = odd are forbidden. Thus the peak positions correspond to (just the first 5) 
     56    \frac{qD}{2\pi} = \sqrt{h^2 + k^2 + l^2} 
    4657 
    47 .. image:: img/image169.jpg 
     58where for a body-centered cubic lattice, only reflections where 
     59$(h + k + l) = \text{even}$ are allowed and reflections where 
     60$(h + k + l) = \text{odd}$ are forbidden. Thus the peak positions 
     61correspond to (just the first 5) 
    4862 
    49 **NB: The calculation of** *Z(q)* **is a double numerical integral that must be carried out with a high density of** 
    50 **points to properly capture the sharp peaks of the paracrystalline scattering.** So be warned that the calculation is 
    51 SLOW. Go get some coffee. Fitting of any experimental data must be resolution smeared for any meaningful fit. This 
    52 makes a triple integral. Very, very slow. Go get lunch! 
     63.. math: 
    5364 
    54 This example dataset is produced using 200 data points, *qmin* = 0.001 |Ang^-1|, *qmax* = 0.1 |Ang^-1| and the above 
    55 default values. 
     65    \begin{eqnarray} 
     66    &q/q_o&&\quad 1&& \ \sqrt{2} && \ \sqrt{3} && \ \sqrt{4} && \ \sqrt{5} \\ 
     67    &\text{Indices}&& (110) && (200) && (211) && (220) && (310) 
     68    \end{eqnarray} 
    5669 
    57 .. image:: img/image170.jpg 
     70**NB: The calculation of $Z(q)$ is a double numerical integral that must 
     71be carried out with a high density of points to properly capture the sharp 
     72peaks of the paracrystalline scattering.** So be warned that the calculation 
     73is SLOW. Go get some coffee. Fitting of any experimental data must be 
     74resolution smeared for any meaningful fit. This makes a triple integral. 
     75Very, very slow. Go get lunch! 
     76 
     77This example dataset is produced using 200 data points, 
     78*qmin* = 0.001 |Ang^-1|, *qmax* = 0.1 |Ang^-1| and the above default values. 
     79 
     80.. image:: img/bcc_1d.jpg 
    5881 
    5982*Figure. 1D plot in the linear scale using the default values (w/200 data point).* 
    6083 
    61 The 2D (Anisotropic model) is based on the reference below where *I(q)* is approximated for 1d scattering. Thus the 
    62 scattering pattern for 2D may not be accurate. Note that we are not responsible for any incorrectness of the 2D model 
    63 computation. 
     84The 2D (Anisotropic model) is based on the reference below where $I(q)$ is 
     85approximated for 1d scattering. Thus the scattering pattern for 2D may not 
     86be accurate. Note that we are not responsible for any incorrectness of the 2D 
     87model computation. 
    6488 
    65 .. image:: img/image165.gif 
     89.. image:: img/bcc_orientation.gif 
    6690 
    67 .. image:: img/image171.jpg 
     91.. image:: img/bcc_2d.jpg 
    6892 
    6993*Figure. 2D plot using the default values (w/200X200 pixels).* 
    7094 
    7195REFERENCE 
     96--------- 
    7297 
    7398Hideki Matsuoka et. al. *Physical Review B*, 36 (1987) 1754-1765 
     
    87112    assumed to be isotropic and characterized by a Gaussian distribution. 
    88113    """ 
     114category="shape:paracrystal" 
    89115 
    90116parameters = [ 
Note: See TracChangeset for help on using the changeset viewer.