source: sasmodels/sasmodels/models/bcc_paracrystal.py @ ec45c4f

core_shell_microgelscostrafo411magnetic_modelrelease_v0.94release_v0.95ticket-1257-vesicle-productticket_1156ticket_1265_superballticket_822_more_unit_tests
Last change on this file since ec45c4f was ec45c4f, checked in by Paul Kienzle <pkienzle@…>, 8 years ago

remove oldname/oldpars from new models

  • Property mode set to 100644
File size: 5.1 KB
Line 
1#bcc paracrystal model
2#note model title and parameter table are automatically inserted
3#note - calculation requires double precision
4r"""
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.
9
10Definition
11----------
12
13The scattering intensity $I(q)$ is calculated as
14
15.. math::
16
17    I(q) = \frac{\text{scale}}{V_p} V_\text{lattice} P(q) Z(q)
18
19
20where *scale* is the volume fraction of spheres, $V_p$ is the volume of the
21primary particle, $V_\text{lattice}$ is a volume correction for the crystal
22structure, $P(q)$ is the form factor of the sphere (normalized), and $Z(q)$
23is the paracrystalline structure factor for a body-centered cubic structure.
24
25Equation (1) of the 1990 reference is used to calculate $Z(q)$, using
26equations (29)-(31) from the 1987 paper for $Z1$, $Z2$, and $Z3$.
27
28The lattice correction (the occupied volume of the lattice) for a
29body-centered cubic structure of particles of radius $R$ and nearest neighbor
30separation $D$ is
31
32.. math::
33
34    V_\text{lattice} = \frac{16\pi}{3} \frac{R^3}{\left(D\sqrt{2}\right)^3}
35
36
37The distortion factor (one standard deviation) of the paracrystal is included
38in the calculation of $Z(q)$
39
40.. math::
41
42    \Delta a = g D
43
44where $g$ is a fractional distortion based on the nearest neighbor distance.
45
46
47.. figure:: img/bcc_geometry.jpg
48
49    Body-centered cubic lattice.
50
51For a crystal, diffraction peaks appear at reduced q-values given by
52
53.. math::
54
55    \frac{qD}{2\pi} = \sqrt{h^2 + k^2 + l^2}
56
57where for a body-centered cubic lattice, only reflections where
58$(h + k + l) = \text{even}$ are allowed and reflections where
59$(h + k + l) = \text{odd}$ are forbidden. Thus the peak positions
60correspond to (just the first 5)
61
62.. math::
63
64    \begin{array}{lccccc}
65    q/q_o          &   1   & \sqrt{2} & \sqrt{3} & \sqrt{4} & \sqrt{5} \\
66    \text{Indices} & (110) &    (200) & (211)    & (220)    & (310)    \\
67    \end{array}
68
69**NB**: The calculation of $Z(q)$ is a double numerical integral that must
70be carried out with a high density of points to properly capture the sharp
71peaks of the paracrystalline scattering. So be warned that the calculation
72is SLOW. Go get some coffee. Fitting of any experimental data must be
73resolution smeared for any meaningful fit. This makes a triple integral.
74Very, very slow. Go get lunch!
75
76This example dataset is produced using 200 data points,
77*qmin* = 0.001 |Ang^-1|, *qmax* = 0.1 |Ang^-1| and the above default values.
78
79The 2D (Anisotropic model) is based on the reference below where $I(q)$ is
80approximated for 1d scattering. Thus the scattering pattern for 2D may not
81be accurate. Note that we are not responsible for any incorrectness of the 2D
82model computation.
83
84.. figure:: img/bcc_angle_definition.png
85
86    Orientation of the crystal with respect to the scattering plane.
87
88References
89----------
90
91Hideki Matsuoka et. al. *Physical Review B*, 36 (1987) 1754-1765
92(Original Paper)
93
94Hideki Matsuoka et. al. *Physical Review B*, 41 (1990) 3854 -3856
95(Corrections to FCC and BCC lattice structure calculation)
96"""
97
98from numpy import inf
99
100name = "bcc_paracrystal"
101title = "Body-centred cubic lattic with paracrystalline distortion"
102description = """
103    Calculates the scattering from a **body-centered cubic lattice** with
104    paracrystalline distortion. Thermal vibrations are considered to be
105    negligible, and the size of the paracrystal is infinitely large.
106    Paracrystalline distortion is assumed to be isotropic and characterized
107    by a Gaussian distribution.
108    """
109category = "shape:paracrystal"
110
111single = False
112
113# pylint: disable=bad-whitespace, line-too-long
114#             ["name", "units", default, [lower, upper], "type","description" ],
115parameters = [["dnn",         "Ang",       220,    [-inf, inf], "",            "Nearest neighbour distance"],
116              ["d_factor",    "",            0.06, [-inf, inf], "",            "Paracrystal distortion factor"],
117              ["radius",      "Ang",        40,    [0, inf],    "volume",      "Particle radius"],
118              ["sld",         "1e-6/Ang^2",  4,    [-inf, inf], "",            "Particle scattering length density"],
119              ["sld_solvent", "1e-6/Ang^2",  1,    [-inf, inf], "",            "Solvent scattering length density"],
120              ["theta",       "degrees",    60,    [-inf, inf], "orientation", "In plane angle"],
121              ["phi",         "degrees",    60,    [-inf, inf], "orientation", "Out of plane angle"],
122              ["psi",         "degrees",    60,    [-inf, inf], "orientation", "Out of plane angle"]
123             ]
124# pylint: enable=bad-whitespace, line-too-long
125
126source = ["lib/sph_j1c.c", "lib/gauss150.c", "lib/sphere_form.c", "bcc_paracrystal_kernel.c"]
127
128# parameters for demo
129demo = dict(
130    scale=1, background=0,
131    dnn=220, d_factor=0.06, sld=4, sld_solvent=1,
132    radius=40,
133    theta=60, phi=60, psi=60,
134    radius_pd=.2, radius_pd_n=2,
135    theta_pd=15, theta_pd_n=0,
136    phi_pd=15, phi_pd_n=0,
137    psi_pd=15, psi_pd_n=0,
138    )
Note: See TracBrowser for help on using the repository browser.