1 | r""" |
---|
2 | For information about polarised and magnetic scattering, see |
---|
3 | the :ref:`magnetism` documentation. |
---|
4 | |
---|
5 | Definition |
---|
6 | ---------- |
---|
7 | |
---|
8 | The scattering intensity $I(q)$ is calculated as: |
---|
9 | |
---|
10 | .. math:: |
---|
11 | |
---|
12 | I(q) = \frac{\text{scale}}{V}(\Delta \rho)^2 A^2(q) S(q) |
---|
13 | + \text{background} |
---|
14 | |
---|
15 | |
---|
16 | where the amplitude $A(q)$ is given as the typical sphere scattering convoluted |
---|
17 | with a Gaussian to get a gradual drop-off in the scattering length density: |
---|
18 | |
---|
19 | .. math:: |
---|
20 | |
---|
21 | A(q) = \frac{3\left[\sin(qR) - qR \cos(qR)\right]}{(qR)^3} |
---|
22 | \exp\left(\frac{-(\sigma_\text{fuzzy}q)^2}{2}\right) |
---|
23 | |
---|
24 | Here $A(q)^2$ is the form factor, $P(q)$. The scale is equivalent to the |
---|
25 | volume fraction of spheres, each of volume, $V$. Contrast $(\Delta \rho)$ |
---|
26 | is the difference of scattering length densities of the sphere and the |
---|
27 | surrounding solvent. |
---|
28 | |
---|
29 | Poly-dispersion in radius and in fuzziness is provided for, though the |
---|
30 | fuzziness must be kept much smaller than the sphere radius for meaningful |
---|
31 | results. |
---|
32 | |
---|
33 | From the reference: |
---|
34 | |
---|
35 | The "fuzziness" of the interface is defined by the parameter |
---|
36 | $\sigma_\text{fuzzy}$. The particle radius $R$ represents the radius of the |
---|
37 | particle where the scattering length density profile decreased to 1/2 of the |
---|
38 | core density. $\sigma_\text{fuzzy}$ is the width of the smeared particle |
---|
39 | surface; i.e., the standard deviation from the average height of the fuzzy |
---|
40 | interface. The inner regions of the microgel that display a higher density |
---|
41 | are described by the radial box profile extending to a radius of |
---|
42 | approximately $R_\text{box} \sim R - 2 \sigma$. The profile approaches |
---|
43 | zero as $R_\text{sans} \sim R + 2\sigma$. |
---|
44 | |
---|
45 | For 2D data: The 2D scattering intensity is calculated in the same way as 1D, |
---|
46 | where the $q$ vector is defined as |
---|
47 | |
---|
48 | .. math:: q = \sqrt{{q_x}^2 + {q_y}^2} |
---|
49 | |
---|
50 | References |
---|
51 | ---------- |
---|
52 | |
---|
53 | M Stieger, J. S Pedersen, P Lindner, W Richtering, *Langmuir*, |
---|
54 | 20 (2004) 7283-7292 |
---|
55 | """ |
---|
56 | |
---|
57 | from numpy import inf |
---|
58 | |
---|
59 | name = "fuzzy_sphere" |
---|
60 | title = "Scattering from spherical particles with a fuzzy surface." |
---|
61 | description = """\ |
---|
62 | scale: scale factor times volume fraction, |
---|
63 | or just volume fraction for absolute scale data |
---|
64 | radius: radius of the solid sphere |
---|
65 | fuzziness = the standard deviation of the fuzzy interfacial |
---|
66 | thickness (ie., so-called interfacial roughness) |
---|
67 | sld: the SLD of the sphere |
---|
68 | solvend_sld: the SLD of the solvent |
---|
69 | background: incoherent background |
---|
70 | Note: By definition, this function works only when fuzziness << radius. |
---|
71 | """ |
---|
72 | category = "shape:sphere" |
---|
73 | |
---|
74 | # pylint: disable=bad-whitespace,line-too-long |
---|
75 | # ["name", "units", default, [lower, upper], "type","description"], |
---|
76 | parameters = [["sld", "1e-6/Ang^2", 1, [-inf, inf], "sld", "Particle scattering length density"], |
---|
77 | ["sld_solvent", "1e-6/Ang^2", 3, [-inf, inf], "sld", "Solvent scattering length density"], |
---|
78 | ["radius", "Ang", 60, [0, inf], "volume", "Sphere radius"], |
---|
79 | ["fuzziness", "Ang", 10, [0, inf], "", "std deviation of Gaussian convolution for interface (must be << radius)"], |
---|
80 | ] |
---|
81 | # pylint: enable=bad-whitespace,line-too-long |
---|
82 | |
---|
83 | source = ["lib/sas_3j1x_x.c"] |
---|
84 | |
---|
85 | # No volume normalization despite having a volume parameter |
---|
86 | # This should perhaps be volume normalized? |
---|
87 | form_volume = """ |
---|
88 | return M_4PI_3*cube(radius); |
---|
89 | """ |
---|
90 | |
---|
91 | Iq = """ |
---|
92 | const double qr = q*radius; |
---|
93 | const double bes = sas_3j1x_x(qr); |
---|
94 | const double qf = q*fuzziness; |
---|
95 | const double fq = bes * (sld - sld_solvent) * form_volume(radius) * exp(-0.5*qf*qf); |
---|
96 | return 1.0e-4*fq*fq; |
---|
97 | """ |
---|
98 | |
---|
99 | def ER(radius): |
---|
100 | """ |
---|
101 | Return radius |
---|
102 | """ |
---|
103 | return radius |
---|
104 | |
---|
105 | # VR defaults to 1.0 |
---|
106 | |
---|
107 | demo = dict(scale=1, background=0.001, |
---|
108 | sld=1, sld_solvent=3, |
---|
109 | radius=60, |
---|
110 | fuzziness=10, |
---|
111 | radius_pd=.2, radius_pd_n=45, |
---|
112 | fuzziness_pd=.2, fuzziness_pd_n=0) |
---|
113 | |
---|
114 | tests = [ |
---|
115 | # Accuracy tests based on content in test/utest_models_new1_3.py |
---|
116 | #[{'background': 0.001}, 1.0, 0.001], |
---|
117 | |
---|
118 | [{}, 0.00301005, 359.2315], |
---|
119 | |
---|
120 | ] |
---|