[1f65db5] | 1 | r""" |
---|
[e7e9231] | 2 | Definition |
---|
| 3 | ---------- |
---|
| 4 | |
---|
[0b906ea] | 5 | Calculates the scattering from a **simple cubic lattice** with |
---|
[1f65db5] | 6 | paracrystalline distortion. Thermal vibrations are considered to be |
---|
| 7 | negligible, and the size of the paracrystal is infinitely large. |
---|
| 8 | Paracrystalline distortion is assumed to be isotropic and characterized |
---|
| 9 | by a Gaussian distribution. |
---|
| 10 | |
---|
[e7e9231] | 11 | he scattering intensity $I(q)$ is calculated as |
---|
[1f65db5] | 12 | |
---|
| 13 | .. math:: |
---|
| 14 | |
---|
| 15 | I(q) = \text{scale}\frac{V_\text{lattice}P(q)Z(q)}{V_p} + \text{background} |
---|
| 16 | |
---|
| 17 | where scale is the volume fraction of spheres, $V_p$ is the volume of |
---|
| 18 | the 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 |
---|
| 20 | $Z(q)$ is the paracrystalline structure factor for a simple cubic structure. |
---|
| 21 | |
---|
[e7e9231] | 22 | Equation (16) of the 1987 reference\ [#CIT1987]_ is used to calculate $Z(q)$, |
---|
| 23 | using equations (13)-(15) from the 1987 paper\ [#CIT1987]_ for Z1, Z2, and Z3. |
---|
[1f65db5] | 24 | |
---|
[2d81cfe] | 25 | The lattice correction (the occupied volume of the lattice) for a simple cubic |
---|
| 26 | structure of particles of radius *R* and nearest neighbor separation *D* is |
---|
[1f65db5] | 27 | |
---|
| 28 | .. math:: |
---|
| 29 | |
---|
| 30 | V_\text{lattice}=\frac{4\pi}{3}\frac{R^3}{D^3} |
---|
| 31 | |
---|
| 32 | The distortion factor (one standard deviation) of the paracrystal is included |
---|
| 33 | in the calculation of $Z(q)$ |
---|
| 34 | |
---|
| 35 | .. math:: |
---|
| 36 | |
---|
| 37 | \Delta a = gD |
---|
| 38 | |
---|
| 39 | where *g* is a fractional distortion based on the nearest neighbor distance. |
---|
| 40 | |
---|
| 41 | The simple cubic lattice is |
---|
| 42 | |
---|
| 43 | .. figure:: img/sc_crystal_geometry.jpg |
---|
| 44 | |
---|
| 45 | For a crystal, diffraction peaks appear at reduced q-values given by |
---|
| 46 | |
---|
| 47 | .. math:: |
---|
| 48 | |
---|
| 49 | \frac{qD}{2\pi} = \sqrt{h^2+k^2+l^2} |
---|
| 50 | |
---|
| 51 | where for a simple cubic lattice any h, k, l are allowed and none are |
---|
| 52 | forbidden. Thus the peak positions correspond to (just the first 5) |
---|
| 53 | |
---|
| 54 | .. math:: |
---|
| 55 | :nowrap: |
---|
| 56 | |
---|
| 57 | \begin{align*} |
---|
| 58 | q/q_0 \quad & \quad 1 |
---|
| 59 | & \sqrt{2} \quad |
---|
| 60 | & \quad \sqrt{3} \quad |
---|
| 61 | & \sqrt{4} \quad |
---|
| 62 | & \quad \sqrt{5}\quad \\ |
---|
| 63 | Indices \quad & (100) |
---|
| 64 | & \quad (110) \quad |
---|
| 65 | & \quad (111) |
---|
| 66 | & (200) \quad |
---|
| 67 | & \quad (210) |
---|
| 68 | \end{align*} |
---|
| 69 | |
---|
| 70 | .. note:: |
---|
| 71 | |
---|
| 72 | The calculation of *Z(q)* is a double numerical integral that must be |
---|
| 73 | carried out with a high density of points to properly capture the sharp |
---|
| 74 | peaks of the paracrystalline scattering. |
---|
[2d81cfe] | 75 | So be warned that the calculation is slow. Fitting of any experimental data |
---|
| 76 | must be resolution smeared for any meaningful fit. This makes a triple |
---|
| 77 | integral which may be very slow. |
---|
[1f65db5] | 78 | |
---|
| 79 | The 2D (Anisotropic model) is based on the reference below where *I(q)* is |
---|
| 80 | approximated for 1d scattering. Thus the scattering pattern for 2D may not |
---|
[2d81cfe] | 81 | be accurate particularly at low $q$. For general details of the calculation |
---|
[eda8b30] | 82 | and angular dispersions for oriented particles see :ref:`orientation` . |
---|
| 83 | Note that we are not responsible for any incorrectness of the |
---|
| 84 | 2D model computation. |
---|
[1f65db5] | 85 | |
---|
| 86 | .. figure:: img/parallelepiped_angle_definition.png |
---|
| 87 | |
---|
[0881f4e] | 88 | Orientation of the crystal with respect to the scattering plane, when |
---|
[1f65db5] | 89 | $\theta = \phi = 0$ the $c$ axis is along the beam direction (the $z$ axis). |
---|
| 90 | |
---|
| 91 | Reference |
---|
| 92 | --------- |
---|
| 93 | |
---|
[e7e9231] | 94 | .. [#CIT1987] Hideki Matsuoka et. al. *Physical Review B*, 36 (1987) 1754-1765 |
---|
| 95 | (Original Paper) |
---|
| 96 | .. [#CIT1990] Hideki Matsuoka et. al. *Physical Review B*, 41 (1990) 3854 -3856 |
---|
| 97 | (Corrections to FCC and BCC lattice structure calculation) |
---|
| 98 | |
---|
| 99 | Authorship and Verification |
---|
| 100 | ---------------------------- |
---|
| 101 | |
---|
| 102 | * **Author:** NIST IGOR/DANSE **Date:** pre 2010 |
---|
| 103 | * **Last Modified by:** Paul Butler **Date:** September 16, 2018 |
---|
| 104 | * **Last Reviewed by:** Paul Butler **Date:** September 16, 2018 |
---|
[1f65db5] | 105 | """ |
---|
| 106 | |
---|
[2d81cfe] | 107 | import numpy as np |
---|
[1f65db5] | 108 | from numpy import inf |
---|
| 109 | |
---|
| 110 | name = "sc_paracrystal" |
---|
| 111 | title = "Simple cubic lattice with paracrystalline distortion" |
---|
| 112 | description = """ |
---|
| 113 | P(q)=(scale/Vp)*V_lattice*P(q)*Z(q)+bkg where scale is the volume |
---|
| 114 | fraction of sphere, |
---|
| 115 | Vp = volume of the primary particle, |
---|
| 116 | V_lattice = volume correction for |
---|
| 117 | for the crystal structure, |
---|
| 118 | P(q)= form factor of the sphere (normalized), |
---|
| 119 | Z(q)= paracrystalline structure factor |
---|
| 120 | for a simple cubic structure. |
---|
| 121 | [Simple Cubic ParaCrystal Model] |
---|
| 122 | Parameters; |
---|
| 123 | scale: volume fraction of spheres |
---|
| 124 | bkg:background, R: radius of sphere |
---|
[6530963] | 125 | lattice_spacing: Nearest neighbor distance |
---|
| 126 | lattice_distortion: Paracrystal distortion factor |
---|
[1f65db5] | 127 | radius: radius of the spheres |
---|
| 128 | sldSph: SLD of the sphere |
---|
| 129 | sldSolv: SLD of the solvent |
---|
| 130 | """ |
---|
| 131 | category = "shape:paracrystal" |
---|
| 132 | single = False |
---|
| 133 | # pylint: disable=bad-whitespace, line-too-long |
---|
| 134 | # ["name", "units", default, [lower, upper], "type","description"], |
---|
[6530963] | 135 | parameters = [["lattice_spacing", "Ang", 220.0, [0.0, inf], "", "Lattice spacing"], |
---|
| 136 | ["lattice_distortion", "", 0.06, [-inf, inf], "", "Paracrystal distortion factor"], |
---|
[1f65db5] | 137 | ["radius", "Ang", 40.0, [0.0, inf], "volume", "Radius of sphere"], |
---|
| 138 | ["sld", "1e-6/Ang^2", 3.0, [0.0, inf], "sld", "Sphere scattering length density"], |
---|
| 139 | ["sld_solvent", "1e-6/Ang^2", 6.3, [0.0, inf], "sld", "Solvent scattering length density"], |
---|
[9b79f29] | 140 | ["theta", "degrees", 0, [-360, 360], "orientation", "c axis to beam angle"], |
---|
| 141 | ["phi", "degrees", 0, [-360, 360], "orientation", "rotation about beam"], |
---|
| 142 | ["psi", "degrees", 0, [-360, 360], "orientation", "rotation about c axis"] |
---|
[1f65db5] | 143 | ] |
---|
| 144 | # pylint: enable=bad-whitespace, line-too-long |
---|
| 145 | |
---|
| 146 | source = ["lib/sas_3j1x_x.c", "lib/sphere_form.c", "lib/gauss150.c", "sc_paracrystal.c"] |
---|
| 147 | |
---|
[404ebbd] | 148 | def random(): |
---|
[1511c37c] | 149 | # copied from bcc_paracrystal |
---|
| 150 | radius = 10**np.random.uniform(1.3, 4) |
---|
[6530963] | 151 | lattice_distortion = 10**np.random.uniform(-2, -0.7) # sigma_d in 0.01-0.7 |
---|
| 152 | lattice_spacing_fraction = np.random.beta(a=10, b=1) |
---|
| 153 | lattice_spacing = radius*4/np.sqrt(4)/lattice_spacing_fraction |
---|
[404ebbd] | 154 | pars = dict( |
---|
| 155 | #sld=1, sld_solvent=0, scale=1, background=1e-32, |
---|
[6530963] | 156 | lattice_spacing=lattice_spacing, |
---|
| 157 | lattice_distortion=lattice_distortion, |
---|
[1511c37c] | 158 | radius=radius, |
---|
[404ebbd] | 159 | ) |
---|
| 160 | return pars |
---|
[1f65db5] | 161 | |
---|
| 162 | tests = [ |
---|
[69e1afc] | 163 | # Accuracy tests based on content in test/utest_extra_models.py, 2d tests added April 10, 2017 |
---|
[1f65db5] | 164 | [{}, 0.001, 10.3048], |
---|
| 165 | [{}, 0.215268, 0.00814889], |
---|
[2a0b2b1] | 166 | [{}, 0.414467, 0.001313289], |
---|
[1511c37c] | 167 | [{'theta': 10.0, 'phi': 20, 'psi': 30.0}, (0.045, -0.035), 18.0397138402], |
---|
| 168 | [{'theta': 10.0, 'phi': 20, 'psi': 30.0}, (0.023, 0.045), 0.0177333171285], |
---|
[1f65db5] | 169 | ] |
---|