[1369fe6] | 1 | r""" |
---|
[b0c4271] | 2 | Definition |
---|
| 3 | ---------- |
---|
| 4 | |
---|
[62cf915] | 5 | This model describes the scattering from a layer of surfactant or polymer |
---|
| 6 | adsorbed on large, smooth, notionally spherical particles under the conditions |
---|
| 7 | that (i) the particles (cores) are contrast-matched to the dispersion medium, |
---|
| 8 | (ii) $S(Q) \sim 1$ (ie, the particle volume fraction is dilute), (iii) the |
---|
| 9 | particle radius is >> layer thickness (ie, the interface is locally flat), |
---|
| 10 | and (iv) scattering from excess unadsorbed adsorbate in the bulk medium is |
---|
| 11 | absent or has been corrected for. |
---|
| 12 | |
---|
| 13 | Unlike many other core-shell models, this model does not assume any form |
---|
| 14 | for the density distribution of the adsorbed species normal to the interface |
---|
| 15 | (cf, a core-shell model normally assumes the density distribution to be a |
---|
| 16 | homogeneous step-function). For comparison, if the thickness of a (traditional |
---|
| 17 | core-shell like) step function distribution is $t$, the second moment about |
---|
| 18 | the mean of the density distribution (ie, the distance of the centre-of-mass |
---|
| 19 | of the distribution from the interface), $\sigma = \sqrt{t^2/12}$. |
---|
[1369fe6] | 20 | |
---|
| 21 | .. math:: |
---|
| 22 | |
---|
[62cf915] | 23 | I(q) = \text{scale} \cdot (\rho_\text{poly}-\rho_\text{solvent})^2 |
---|
| 24 | \left[ |
---|
| 25 | \frac{6\pi\phi_\text{core}}{Q^2} |
---|
| 26 | \frac{\Gamma^2}{\delta_\text{poly}^2R_\text{core}} |
---|
| 27 | \exp(-Q^2\sigma^2) |
---|
| 28 | \right] + \text{background} |
---|
| 29 | |
---|
| 30 | where *scale* is a scale factor, $\rho_\text{poly}$ is the sld of the |
---|
| 31 | polymer (or surfactant) layer, $\rho_\text{solv}$ is the sld of the |
---|
| 32 | solvent/medium and cores, $\phi_\text{core}$ is the volume fraction of |
---|
| 33 | the core particles, $\delta_\text{poly}$ is the bulk density of the |
---|
| 34 | polymer, $\Gamma$ is the adsorbed amount, and $\sigma$ is the second |
---|
| 35 | moment of the thickness distribution. |
---|
| 36 | |
---|
| 37 | Note that all parameters except $\sigma$ are correlated so fitting more |
---|
| 38 | than one of these parameters will generally fail. Also note that unlike |
---|
| 39 | other shape models, no volume normalization is applied to this model (the |
---|
| 40 | calculation is exact). |
---|
[1369fe6] | 41 | |
---|
[b0c4271] | 42 | The code for this model is based originally on a a fortran implementation by |
---|
| 43 | Steve King at ISIS in the SANDRA package c. 1990. |
---|
| 44 | |
---|
[1369fe6] | 45 | References |
---|
| 46 | ---------- |
---|
| 47 | |
---|
[b0c4271] | 48 | .. [#] S King, P Griffiths, J Hone, and T Cosgrove, *SANS from Adsorbed Polymer |
---|
| 49 | Layers*, *Macromol. Symp.*, 190 (2002) 33-42. |
---|
| 50 | |
---|
[0507e09] | 51 | Source |
---|
| 52 | ------ |
---|
| 53 | |
---|
| 54 | `adsorbed_layer.py <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/adsorbed_layer.py>`_ |
---|
| 55 | |
---|
[b0c4271] | 56 | Authorship and Verification |
---|
| 57 | ---------------------------- |
---|
| 58 | |
---|
| 59 | * **Author:** Jae-Hi Cho **Date:** pre 2010 |
---|
| 60 | * **Last Modified by:** Paul Kienzle **Date:** April 14, 2016 |
---|
| 61 | * **Last Reviewed by:** Steve King **Date:** March 18, 2016 |
---|
[0507e09] | 62 | * **Source added by :** Steve King **Date:** March 25, 2019 |
---|
[1369fe6] | 63 | """ |
---|
| 64 | |
---|
[2d81cfe] | 65 | import numpy as np |
---|
[2c74c11] | 66 | from numpy import inf, pi, exp, errstate |
---|
[1369fe6] | 67 | |
---|
[62cf915] | 68 | name = "adsorbed_layer" |
---|
| 69 | title = "Scattering from an adsorbed layer on particles" |
---|
[1369fe6] | 70 | |
---|
[62cf915] | 71 | description = """ |
---|
[4f4e0d5] | 72 | Evaluates the scattering from large particles |
---|
[1369fe6] | 73 | with an adsorbed layer of surfactant or |
---|
| 74 | polymer, independent of the form of the |
---|
| 75 | density distribution. |
---|
| 76 | """ |
---|
[62cf915] | 77 | category = "shape:sphere" |
---|
[1369fe6] | 78 | |
---|
[62cf915] | 79 | # pylint: disable=bad-whitespace, line-too-long |
---|
[7abcc59] | 80 | # ["name", "units", default, [lower, upper], "type", "description"], |
---|
[62cf915] | 81 | parameters = [ |
---|
| 82 | ["second_moment", "Ang", 23.0, [0.0, inf], "", "Second moment of polymer distribution"], |
---|
[52ec91e] | 83 | ["adsorbed_amount", "mg/m^2", 1.9, [0.0, inf], "", "Adsorbed amount of polymer"], |
---|
| 84 | ["density_shell", "g/cm^3", 0.7, [0.0, inf], "", "Bulk density of polymer in the shell"], |
---|
[62cf915] | 85 | ["radius", "Ang", 500.0, [0.0, inf], "", "Core particle radius"], |
---|
| 86 | ["volfraction", "None", 0.14, [0.0, inf], "", "Core particle volume fraction"], |
---|
| 87 | ["sld_shell", "1e-6/Ang^2", 1.5, [-inf, inf], "sld", "Polymer shell SLD"], |
---|
| 88 | ["sld_solvent", "1e-6/Ang^2", 6.3, [-inf, inf], "sld", "Solvent SLD"], |
---|
| 89 | ] |
---|
[7abcc59] | 90 | # pylint: enable=bad-whitespace, line-too-long |
---|
[1369fe6] | 91 | |
---|
| 92 | # NB: Scale and Background are implicit parameters on every model |
---|
[62cf915] | 93 | def Iq(q, second_moment, adsorbed_amount, density_shell, radius, |
---|
| 94 | volfraction, sld_shell, sld_solvent): |
---|
[b297ba9] | 95 | """Return I(q) for adsorbed layer model.""" |
---|
[2c74c11] | 96 | with errstate(divide='ignore'): |
---|
| 97 | aa = ((sld_shell - sld_solvent)/density_shell * adsorbed_amount) / q |
---|
[4f4e0d5] | 98 | bb = q * second_moment |
---|
| 99 | #scale by 10^-2 for units conversion to cm^-1 |
---|
[2c74c11] | 100 | inten = 6.0e-02 * pi * volfraction * aa**2 * exp(-bb**2) / radius |
---|
[b135dc0] | 101 | return inten |
---|
[40a87fa] | 102 | Iq.vectorized = True # Iq accepts an array of q values |
---|
[1369fe6] | 103 | |
---|
[0bdddc2] | 104 | def random(): |
---|
[b297ba9] | 105 | """Return a random parameter set for the model.""" |
---|
[0bdddc2] | 106 | # only care about the value of second_moment: |
---|
| 107 | # curve = scale * e**(-second_moment^2 q^2)/q^2 |
---|
| 108 | # scale = 6 pi/100 (contrast/density*absorbed_amount)^2 * Vf/radius |
---|
| 109 | # the remaining parameters can be randomly generated from zero to |
---|
[8f04da4] | 110 | # twice the default value as done by default in compare.py |
---|
[0bdddc2] | 111 | pars = dict( |
---|
| 112 | scale=1, |
---|
| 113 | second_moment=10**np.random.uniform(1, 3), |
---|
| 114 | ) |
---|
| 115 | return pars |
---|
| 116 | |
---|
[62cf915] | 117 | # unit test values taken from SasView 3.1.2 |
---|
[40a87fa] | 118 | tests = [ |
---|
[62cf915] | 119 | [{'scale': 1.0, 'second_moment': 23.0, 'adsorbed_amount': 1.9, |
---|
| 120 | 'density_shell': 0.7, 'radius': 500.0, 'volfraction': 0.14, |
---|
| 121 | 'sld_shell': 1.5, 'sld_solvent': 6.3, 'background': 0.0}, |
---|
[1d4d409] | 122 | [0.0106939, 0.1], [73.741, 4.51684e-3]], |
---|
[62cf915] | 123 | ] |
---|
| 124 | |
---|
| 125 | # 2016-03-16 SMK converted from sasview, checked vs SANDRA |
---|
| 126 | # 2016-03-18 RKH some edits & renaming |
---|
| 127 | # 2016-04-14 PAK reformatting |
---|