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