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