[8dca856] | 1 | r""" |
---|
[40a87fa] | 2 | For information about polarised and magnetic scattering, see |
---|
[9a4811a] | 3 | the :ref:`magnetism` documentation. |
---|
[8dca856] | 4 | |
---|
| 5 | Definition |
---|
| 6 | ---------- |
---|
| 7 | |
---|
[40a87fa] | 8 | The scattering intensity $I(q)$ is calculated as: |
---|
[8dca856] | 9 | |
---|
| 10 | .. math:: |
---|
| 11 | |
---|
[40a87fa] | 12 | I(q) = \frac{\text{scale}}{V}(\Delta \rho)^2 A^2(q) S(q) |
---|
| 13 | + \text{background} |
---|
[8dca856] | 14 | |
---|
[40a87fa] | 15 | |
---|
| 16 | where the amplitude $A(q)$ is given as the typical sphere scattering convoluted |
---|
[8dca856] | 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} |
---|
[40a87fa] | 22 | \exp\left(\frac{-(\sigma_\text{fuzzy}q)^2}{2}\right) |
---|
[8dca856] | 23 | |
---|
[40a87fa] | 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. |
---|
[8dca856] | 28 | |
---|
[40a87fa] | 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. |
---|
[8dca856] | 32 | |
---|
| 33 | From the reference: |
---|
| 34 | |
---|
| 35 | The "fuzziness" of the interface is defined by the parameter |
---|
[40a87fa] | 36 | $\sigma_\text{fuzzy}$. The particle radius $R$ represents the radius of the |
---|
[8dca856] | 37 | particle where the scattering length density profile decreased to 1/2 of the |
---|
[40a87fa] | 38 | core density. $\sigma_\text{fuzzy}$ is the width of the smeared particle |
---|
[8dca856] | 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 |
---|
[40a87fa] | 42 | approximately $R_\text{box} \sim R - 2 \sigma$. The profile approaches |
---|
| 43 | zero as $R_\text{sans} \sim R + 2\sigma$. |
---|
[8dca856] | 44 | |
---|
| 45 | For 2D data: The 2D scattering intensity is calculated in the same way as 1D, |
---|
[40a87fa] | 46 | where the $q$ vector is defined as |
---|
[8dca856] | 47 | |
---|
[40a87fa] | 48 | .. math:: q = \sqrt{{q_x}^2 + {q_y}^2} |
---|
[8dca856] | 49 | |
---|
| 50 | References |
---|
| 51 | ---------- |
---|
| 52 | |
---|
[0507e09] | 53 | .. [#] M Stieger, J. S Pedersen, P Lindner, W Richtering, *Langmuir*, 20 (2004) 7283-7292 |
---|
| 54 | |
---|
| 55 | Source |
---|
| 56 | ------ |
---|
| 57 | |
---|
| 58 | `fuzzy_sphere.py <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/fuzzy_sphere.py>`_ |
---|
| 59 | |
---|
| 60 | `fuzzy_sphere.c <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/fuzzy_sphere.c>`_ |
---|
| 61 | |
---|
| 62 | Authorship and Verification |
---|
| 63 | ---------------------------- |
---|
| 64 | |
---|
| 65 | * **Author:** |
---|
| 66 | * **Last Modified by:** |
---|
| 67 | * **Last Reviewed by:** |
---|
| 68 | * **Source added by :** Steve King **Date:** March 25, 2019 |
---|
[8dca856] | 69 | """ |
---|
| 70 | |
---|
[2d81cfe] | 71 | import numpy as np |
---|
[8dca856] | 72 | from numpy import inf |
---|
| 73 | |
---|
| 74 | name = "fuzzy_sphere" |
---|
| 75 | title = "Scattering from spherical particles with a fuzzy surface." |
---|
| 76 | description = """\ |
---|
| 77 | scale: scale factor times volume fraction, |
---|
| 78 | or just volume fraction for absolute scale data |
---|
| 79 | radius: radius of the solid sphere |
---|
[0cc31e1] | 80 | fuzziness = the standard deviation of the fuzzy interfacial |
---|
[8dca856] | 81 | thickness (ie., so-called interfacial roughness) |
---|
| 82 | sld: the SLD of the sphere |
---|
| 83 | solvend_sld: the SLD of the solvent |
---|
| 84 | background: incoherent background |
---|
| 85 | Note: By definition, this function works only when fuzziness << radius. |
---|
| 86 | """ |
---|
| 87 | category = "shape:sphere" |
---|
| 88 | |
---|
| 89 | # pylint: disable=bad-whitespace,line-too-long |
---|
| 90 | # ["name", "units", default, [lower, upper], "type","description"], |
---|
[42356c8] | 91 | parameters = [["sld", "1e-6/Ang^2", 1, [-inf, inf], "sld", "Particle scattering length density"], |
---|
| 92 | ["sld_solvent", "1e-6/Ang^2", 3, [-inf, inf], "sld", "Solvent scattering length density"], |
---|
[8dca856] | 93 | ["radius", "Ang", 60, [0, inf], "volume", "Sphere radius"], |
---|
[d277229] | 94 | ["fuzziness", "Ang", 10, [0, inf], "volume", "std deviation of Gaussian convolution for interface (must be << radius)"], |
---|
[8dca856] | 95 | ] |
---|
| 96 | # pylint: enable=bad-whitespace,line-too-long |
---|
| 97 | |
---|
[b297ba9] | 98 | source = ["lib/sas_3j1x_x.c", "fuzzy_sphere.c"] |
---|
[71b751d] | 99 | have_Fq = True |
---|
[ee60aa7] | 100 | effective_radius_type = ["radius", "radius + fuzziness"] |
---|
[8dca856] | 101 | |
---|
[31df0c9] | 102 | def random(): |
---|
[b297ba9] | 103 | """Return a random parameter set for the model.""" |
---|
[31df0c9] | 104 | radius = 10**np.random.uniform(1, 4.7) |
---|
| 105 | fuzziness = 10**np.random.uniform(-2, -0.5)*radius # 1% to 31% fuzziness |
---|
| 106 | pars = dict( |
---|
| 107 | radius=radius, |
---|
| 108 | fuzziness=fuzziness, |
---|
| 109 | ) |
---|
| 110 | return pars |
---|
| 111 | |
---|
[8dca856] | 112 | demo = dict(scale=1, background=0.001, |
---|
[0cc31e1] | 113 | sld=1, sld_solvent=3, |
---|
[8dca856] | 114 | radius=60, |
---|
| 115 | fuzziness=10, |
---|
| 116 | radius_pd=.2, radius_pd_n=45, |
---|
| 117 | fuzziness_pd=.2, fuzziness_pd_n=0) |
---|
| 118 | |
---|
| 119 | tests = [ |
---|
| 120 | # Accuracy tests based on content in test/utest_models_new1_3.py |
---|
| 121 | #[{'background': 0.001}, 1.0, 0.001], |
---|
| 122 | |
---|
| 123 | [{}, 0.00301005, 359.2315], |
---|
| 124 | |
---|
| 125 | ] |
---|