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