source: sasmodels/sasmodels/models/fcc_paracrystal.py @ 5778279

ticket_1156
Last change on this file since 5778279 was e7e9231, checked in by butler, 6 years ago

Correct/update paracrystal docs

Correct BCC doc for lattice volume fraction and update all paracrystal
models docs reference and authorship sections.

  • Property mode set to 100644
File size: 5.8 KB
Line 
1#fcc paracrystal model
2#note model title and parameter table are automatically inserted
3#note - calculation requires double precision
4r"""
5Definition
6----------
7
8Calculates the scattering from a **face-centered cubic lattice** with
9paracrystalline distortion. Thermal vibrations are considered to be
10negligible, and the size of the paracrystal is infinitely large.
11Paracrystalline distortion is assumed to be isotropic and characterized by
12a Gaussian distribution.
13
14The scattering intensity $I(q)$ is calculated as
15
16.. math::
17
18    I(q) = \frac{\text{scale}}{V_p} V_\text{lattice} P(q) Z(q)
19
20where *scale* is the volume fraction of spheres, $V_p$ is the volume of
21the primary 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 face-centered cubic structure.
24
25Equation (1) of the 1990 reference\ [#CIT1990]_ is used to calculate $Z(q)$,
26using equations (23)-(25) from the 1987 paper\ [#CIT1987]_ for $Z1$, $Z2$, and
27$Z3$.
28
29The lattice correction (the occupied volume of the lattice) for a
30face-centered cubic structure of particles of radius $R$ and nearest
31neighbor separation $D$ is
32
33.. math::
34
35   V_\text{lattice} = \frac{16\pi}{3}\frac{R^3}{\left(D\sqrt{2}\right)^3}
36
37The distortion factor (one standard deviation) of the paracrystal is
38included in the calculation of $Z(q)$
39
40.. math::
41
42    \Delta a = gD
43
44where $g$ is a fractional distortion based on the nearest neighbor distance.
45
46.. figure:: img/fcc_geometry.jpg
47
48    Face-centered cubic lattice.
49
50For a crystal, diffraction peaks appear at reduced q-values given by
51
52.. math::
53
54    \frac{qD}{2\pi} = \sqrt{h^2 + k^2 + l^2}
55
56where for a face-centered cubic lattice $h, k , l$ all odd or all
57even are allowed and reflections where $h, k, l$ are mixed odd/even
58are forbidden. Thus the peak positions correspond to (just the first 5)
59
60.. math::
61
62    \begin{array}{cccccc}
63    q/q_0 & 1 & \sqrt{4/3} & \sqrt{8/3} & \sqrt{11/3} & \sqrt{4} \\
64    \text{Indices} & (111)  & (200) & (220) & (311) & (222)
65    \end{array}
66
67.. note::
68
69  The calculation of $Z(q)$ is a double numerical integral that
70  must be carried out with a high density of points to properly capture
71  the sharp peaks of the paracrystalline scattering.
72  So be warned that the calculation is slow. Fitting of any experimental data
73  must be resolution smeared for any meaningful fit. This makes a triple integral
74  which may be very slow.
75
76The 2D (Anisotropic model) is based on the reference below where $I(q)$ is
77approximated for 1d scattering. Thus the scattering pattern for 2D may not
78be accurate particularly at low $q$. For general details of the calculation
79and angular dispersions for oriented particles see :ref:`orientation` .
80Note that we are not responsible for any incorrectness of the
812D model computation.
82
83.. figure:: img/parallelepiped_angle_definition.png
84
85    Orientation of the crystal with respect to the scattering plane, when
86    $\theta = \phi = 0$ the $c$ axis is along the beam direction (the $z$ axis).
87
88References
89----------
90
91.. [#CIT1987] Hideki Matsuoka et. al. *Physical Review B*, 36 (1987) 1754-1765
92   (Original Paper)
93.. [#CIT1990] Hideki Matsuoka et. al. *Physical Review B*, 41 (1990) 3854 -3856
94   (Corrections to FCC and BCC lattice structure calculation)
95
96Authorship and Verification
97----------------------------
98
99* **Author:** NIST IGOR/DANSE **Date:** pre 2010
100* **Last Modified by:** Paul Butler **Date:** September 16, 2018
101* **Last Reviewed by:** Paul Butler **Date:** September 16, 2018
102"""
103
104import numpy as np
105from numpy import inf, pi
106
107name = "fcc_paracrystal"
108title = "Face-centred cubic lattic with paracrystalline distortion"
109description = """
110    Calculates the scattering from a **face-centered cubic lattice** with paracrystalline distortion. Thermal vibrations
111    are considered to be negligible, and the size of the paracrystal is infinitely large. Paracrystalline distortion is
112    assumed to be isotropic and characterized by a Gaussian distribution.
113    """
114category = "shape:paracrystal"
115
116single = False
117
118# pylint: disable=bad-whitespace, line-too-long
119#             ["name", "units", default, [lower, upper], "type","description"],
120parameters = [["lattice_spacing", "Ang", 220, [-inf, inf], "", "Lattice spacing"],
121              ["lattice_distortion", "", 0.06, [-inf, inf], "", "Paracrystal distortion factor"],
122              ["radius", "Ang", 40, [0, inf], "volume", "Particle radius"],
123              ["sld", "1e-6/Ang^2", 4, [-inf, inf], "sld", "Particle scattering length density"],
124              ["sld_solvent", "1e-6/Ang^2", 1, [-inf, inf], "sld", "Solvent scattering length density"],
125              ["theta",       "degrees",    60,    [-360, 360], "orientation", "c axis to beam angle"],
126              ["phi",         "degrees",    60,    [-360, 360], "orientation", "rotation about beam"],
127              ["psi",         "degrees",    60,    [-360, 360], "orientation", "rotation about c axis"]
128             ]
129# pylint: enable=bad-whitespace, line-too-long
130
131source = ["lib/sas_3j1x_x.c", "lib/gauss150.c", "lib/sphere_form.c", "fcc_paracrystal.c"]
132
133def random():
134    # copied from bcc_paracrystal
135    radius = 10**np.random.uniform(1.3, 4)
136    lattice_distortion = 10**np.random.uniform(-2, -0.7)  # sigma_d in 0.01-0.7
137    lattice_spacing_fraction = np.random.beta(a=10, b=1)
138    lattice_spacing = radius*4/np.sqrt(2)/lattice_spacing_fraction
139    pars = dict(
140        #sld=1, sld_solvent=0, scale=1, background=1e-32,
141        latice_spacing=lattice_spacing,
142        lattice_distortion=d_factor,
143        radius=radius,
144    )
145    return pars
146
147# april 10 2017, rkh add unit tests, NOT compared with any other calc method, assume correct!
148# TODO: fix the 2d tests
149q = 4.*pi/220.
150tests = [
151    [{}, [0.001, q, 0.215268], [0.275164706668, 5.7776842567, 0.00958167119232]],
152    #[{}, (-0.047, -0.007), 238.103096286],
153    #[{}, (0.053, 0.063), 0.863609587796],
154]
Note: See TracBrowser for help on using the repository browser.