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