1 | r""" |
---|
2 | Definition |
---|
3 | ---------- |
---|
4 | |
---|
5 | Calculates the scattering from a **body-centered cubic lattice** with |
---|
6 | paracrystalline distortion. Thermal vibrations are considered to be negligible, |
---|
7 | and the size of the paracrystal is infinitely large. Paracrystalline distortion |
---|
8 | is assumed to be isotropic and characterized by a Gaussian distribution. |
---|
9 | |
---|
10 | The scattering intensity $I(q)$ is calculated as |
---|
11 | |
---|
12 | .. math:: |
---|
13 | |
---|
14 | I(q) = \frac{\text{scale}}{V_p} V_\text{lattice} P(q) Z(q) |
---|
15 | |
---|
16 | |
---|
17 | where *scale* is the volume fraction of spheres, $V_p$ is the volume of the |
---|
18 | primary particle, $V_\text{lattice}$ is a volume correction for the crystal |
---|
19 | structure, $P(q)$ is the form factor of the sphere (normalized), and $Z(q)$ |
---|
20 | is the paracrystalline structure factor for a body-centered cubic structure. |
---|
21 | |
---|
22 | Equation (1) of the 1990 reference\ [#CIT1990]_ is used to calculate $Z(q)$, |
---|
23 | using equations (29)-(31) from the 1987 paper\ [#CIT1987]_ for $Z1$, $Z2$, and |
---|
24 | $Z3$. |
---|
25 | |
---|
26 | The lattice correction (the occupied volume of the lattice) for a |
---|
27 | body-centered cubic structure of particles of radius $R$ and nearest neighbor |
---|
28 | separation $D$ is |
---|
29 | |
---|
30 | .. math:: |
---|
31 | |
---|
32 | V_\text{lattice} = \frac{16\pi}{3} \frac{R^3}{\left(D\sqrt{2}\right)^3} |
---|
33 | |
---|
34 | |
---|
35 | The distortion factor (one standard deviation) of the paracrystal is included |
---|
36 | in the calculation of $Z(q)$ |
---|
37 | |
---|
38 | .. math:: |
---|
39 | |
---|
40 | \Delta a = g D |
---|
41 | |
---|
42 | where $g$ is a fractional distortion based on the nearest neighbor distance. |
---|
43 | |
---|
44 | |
---|
45 | .. figure:: img/bcc_geometry.jpg |
---|
46 | |
---|
47 | Body-centered cubic lattice. |
---|
48 | |
---|
49 | For a crystal, diffraction peaks appear at reduced q-values given by |
---|
50 | |
---|
51 | .. math:: |
---|
52 | |
---|
53 | \frac{qD}{2\pi} = \sqrt{h^2 + k^2 + l^2} |
---|
54 | |
---|
55 | where for a body-centered cubic lattice, only reflections where |
---|
56 | $(h + k + l) = \text{even}$ are allowed and reflections where |
---|
57 | $(h + k + l) = \text{odd}$ are forbidden. Thus the peak positions |
---|
58 | correspond to (just the first 5) |
---|
59 | |
---|
60 | .. math:: |
---|
61 | |
---|
62 | \begin{array}{lccccc} |
---|
63 | q/q_o & 1 & \sqrt{2} & \sqrt{3} & \sqrt{4} & \sqrt{5} \\ |
---|
64 | \text{Indices} & (110) & (200) & (211) & (220) & (310) \\ |
---|
65 | \end{array} |
---|
66 | |
---|
67 | **NB**: The calculation of $Z(q)$ is a double numerical integral that must |
---|
68 | be carried out with a high density of points to properly capture the sharp |
---|
69 | peaks of the paracrystalline scattering. So be warned that the calculation |
---|
70 | is SLOW. Go get some coffee. Fitting of any experimental data must be |
---|
71 | resolution smeared for any meaningful fit. This makes a triple integral. |
---|
72 | Very, very slow. Go get lunch! |
---|
73 | |
---|
74 | This example dataset is produced using 200 data points, |
---|
75 | *qmin* = 0.001 |Ang^-1|, *qmax* = 0.1 |Ang^-1| and the above default values. |
---|
76 | |
---|
77 | The 2D (Anisotropic model) is based on the reference below where $I(q)$ is |
---|
78 | approximated for 1d scattering. Thus the scattering pattern for 2D may not |
---|
79 | be accurate. |
---|
80 | |
---|
81 | .. figure:: img/parallelepiped_angle_definition.png |
---|
82 | |
---|
83 | Orientation of the crystal with respect to the scattering plane, when |
---|
84 | $\theta = \phi = 0$ the $c$ axis is along the beam direction (the $z$ axis). |
---|
85 | |
---|
86 | References |
---|
87 | ---------- |
---|
88 | |
---|
89 | .. [#CIT1987] Hideki Matsuoka et. al. *Physical Review B*, 36 (1987) 1754-1765 |
---|
90 | (Original Paper) |
---|
91 | .. [#CIT1990] Hideki Matsuoka et. al. *Physical Review B*, 41 (1990) 3854 -3856 |
---|
92 | (Corrections to FCC and BCC lattice structure calculation) |
---|
93 | |
---|
94 | Authorship and Verification |
---|
95 | ---------------------------- |
---|
96 | |
---|
97 | * **Author:** NIST IGOR/DANSE **Date:** pre 2010 |
---|
98 | * **Last Modified by:** Paul Butler **Date:** September 29, 2016 |
---|
99 | * **Last Reviewed by:** Richard Heenan **Date:** March 21, 2016 |
---|
100 | """ |
---|
101 | |
---|
102 | from numpy import inf, pi |
---|
103 | |
---|
104 | name = "bcc_paracrystal" |
---|
105 | title = "Body-centred cubic lattic with paracrystalline distortion" |
---|
106 | description = """ |
---|
107 | Calculates the scattering from a **body-centered cubic lattice** with |
---|
108 | paracrystalline distortion. Thermal vibrations are considered to be |
---|
109 | negligible, and the size of the paracrystal is infinitely large. |
---|
110 | Paracrystalline distortion is assumed to be isotropic and characterized |
---|
111 | by a Gaussian distribution. |
---|
112 | """ |
---|
113 | category = "shape:paracrystal" |
---|
114 | |
---|
115 | #note - calculation requires double precision |
---|
116 | single = False |
---|
117 | |
---|
118 | # pylint: disable=bad-whitespace, line-too-long |
---|
119 | # ["name", "units", default, [lower, upper], "type","description" ], |
---|
120 | parameters = [["dnn", "Ang", 220, [-inf, inf], "", "Nearest neighbour distance"], |
---|
121 | ["d_factor", "", 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 | |
---|
131 | source = ["lib/sas_3j1x_x.c", "lib/gauss150.c", "lib/sphere_form.c", "bcc_paracrystal.c"] |
---|
132 | |
---|
133 | def random(): |
---|
134 | import numpy as np |
---|
135 | # Define lattice spacing as a multiple of the particle radius |
---|
136 | # using the formulat a = 4 r/sqrt(3). Systems which are ordered |
---|
137 | # are probably mostly filled, so use a distribution which goes from |
---|
138 | # zero to one, but leaving 90% of them within 80% of the |
---|
139 | # maximum bcc packing. Lattice distortion values are empirically |
---|
140 | # useful between 0.01 and 0.7. Use an exponential distribution |
---|
141 | # in this range 'cuz its easy. |
---|
142 | radius = 10**np.random.uniform(1.3, 4) |
---|
143 | d_factor = 10**np.random.uniform(-2, -0.7) # sigma_d in 0.01-0.7 |
---|
144 | dnn_fraction = np.random.beta(a=10, b=1) |
---|
145 | dnn = radius*4/np.sqrt(3)/dnn_fraction |
---|
146 | pars = dict( |
---|
147 | #sld=1, sld_solvent=0, scale=1, background=1e-32, |
---|
148 | dnn=dnn, |
---|
149 | d_factor=d_factor, |
---|
150 | radius=radius, |
---|
151 | ) |
---|
152 | return pars |
---|
153 | |
---|
154 | # april 6 2017, rkh add unit tests, NOT compared with any other calc method, assume correct! |
---|
155 | # add 2d test later |
---|
156 | q = 4.*pi/220. |
---|
157 | tests = [ |
---|
158 | [{}, [0.001, q, 0.215268], [1.46601394721, 2.85851284174, 0.00866710287078]], |
---|
159 | [{'theta': 20.0, 'phi': 30, 'psi': 40.0}, (-0.017, 0.035), 2082.20264399], |
---|
160 | [{'theta': 20.0, 'phi': 30, 'psi': 40.0}, (-0.081, 0.011), 0.436323144781], |
---|
161 | ] |
---|