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