source: sasmodels/sasmodels/models/polymer_micelle.py @ 0507e09

core_shell_microgelsmagnetic_modelticket-1257-vesicle-productticket_1156ticket_1265_superballticket_822_more_unit_tests
Last change on this file since 0507e09 was 0507e09, checked in by smk78, 5 years ago

Added link to source code to each model. Closes #883

  • Property mode set to 100644
File size: 6.1 KB
RevLine 
[0d0aee1]1r"""
2
3This model provides the form factor, $P(q)$, for a micelle with a spherical
[db74c47]4core and Gaussian polymer chains attached to the surface, thus may be applied
[40a87fa]5to block copolymer micelles. To work well the Gaussian chains must be much
6smaller than the core, which is often not the case.  Please study the
7reference carefully.
[0d0aee1]8
9Definition
10----------
11
12The 1D scattering intensity for this model is calculated according to
[bba9361]13the equations given by Pedersen (Pedersen, 2000), summarised briefly here.
14
[2d81cfe]15The micelle core is imagined as $N$ = *n_aggreg* polymer heads, each of volume
16$V_\text{core}$, which then defines a micelle core of radius $r$ = *r_core*,
17which is a separate parameter even though it could be directly determined.
18The Gaussian random coil tails, of gyration radius $R_g$, are imagined
19uniformly distributed around the spherical core, centred at a distance
20$r + d \cdot R_g$ from the micelle centre, where $d$ = *d_penetration* is
21of order unity. A volume $V_\text{corona}$ is defined for each coil. The
22model in detail seems to separately parametrise the terms for the shape
23of $I(Q)$ and the relative intensity of each term, so use with caution
24and check parameters for consistency. The spherical core is monodisperse,
25so it's intensity and the cross terms may have sharp oscillations (use $q$
26resolution smearing if needs be to help remove them).
[bba9361]27
28.. math::
[2d81cfe]29    P(q) &= N^2\beta^2_s\Phi(qr)^2 + N\beta^2_cP_c(q)
[5a99d43]30            + 2N^2\beta_s\beta_cS_{sc}(q) + N(N-1)\beta_c^2S_{cc}(q) \\
[2d81cfe]31    \beta_s &= V_\text{core}(\rho_\text{core} - \rho_\text{solvent}) \\
32    \beta_c &= V_\text{corona}(\rho_\text{corona} - \rho_\text{solvent})
[bba9361]33
[2d81cfe]34where $\rho_\text{core}$, $\rho_\text{corona}$ and $\rho_\text{solvent}$ are
35the scattering length densities *sld_core*, *sld_corona* and *sld_solvent*.
36For the spherical core of radius $r$
[bba9361]37
[404ebbd]38.. math::
[2d81cfe]39   \Phi(qr)= \frac{\sin(qr) - qr\cos(qr)}{(qr)^3}
[bba9361]40
41whilst for the Gaussian coils
42
43.. math::
44
[ca04add]45   P_c(q) &= 2 [\exp(-Z) + Z - 1] / Z^2 \\
[bba9361]46   Z &= (q R_g)^2
47
[2d81cfe]48The sphere to coil (core to corona) and coil to coil (corona to corona) cross
49terms are approximated by:
[bba9361]50
51.. math::
[404ebbd]52
[2d81cfe]53   S_{sc}(q) &= \Phi(qr)\psi(Z)
54       \frac{\sin(q(r+d \cdot R_g))}{q(r+d \cdot R_g)} \\
55   S_{cc}(q) &= \psi(Z)^2
56       \left[\frac{\sin(q(r+d \cdot R_g))}{q(r+d \cdot R_g)} \right]^2 \\
57   \psi(Z) &= \frac{[1-\exp^{-Z}]}{Z}
[0d0aee1]58
59Validation
60----------
61
[2d81cfe]62$P(q)$ above is multiplied by *ndensity*, and a units conversion of $10^{-13}$,
63so *scale* is likely 1.0 if the scattering data is in absolute units. This
64model has not yet been independently validated.
[0d0aee1]65
66
[db74c47]67References
68----------
[0d0aee1]69
[0507e09]70.. [#] J Pedersen, *J. Appl. Cryst.*, 33 (2000) 637-640
[791281c]71
[0507e09]72Source
73------
74
75`polymer_micelle.py <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/polymer_micelle.py>`_
76
77`polymer_micelle.c <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/polymer_micelle.c>`_
78
79Authorship and Verification
80----------------------------
81
82* **Translated by   :** Richard Heenan **Date:** March 20, 2016
83* **Last modified by:** Paul Kienzle **Date:** November 29, 2017
84* **Last reviewed by:** Steve King **Date:** November 30, 2017
85* **Source added by :** Steve King **Date:** March 25, 2019
[0d0aee1]86"""
87
[2d81cfe]88import numpy as np
[404ebbd]89from numpy import inf, pi
[0d0aee1]90
[1e9a108]91name = "polymer_micelle"
92title = "Polymer micelle model"
[0d0aee1]93description = """
[bba9361]94This model provides the form factor, $P(q)$, for a micelle with a spherical
95core and Gaussian polymer chains attached to the surface, thus may be applied
96to block copolymer micelles. To work well the Gaussian chains must be much
97smaller than the core, which is often not the case.  Please study the
[404ebbd]98reference to Pedersen and full documentation carefully.
[0d0aee1]99    """
[bba9361]100
101
[1e9a108]102category = "shape:sphere"
[0d0aee1]103
104# pylint: disable=bad-whitespace, line-too-long
105#   ["name", "units", default, [lower, upper], "type","description"],
106parameters = [
107    ["ndensity",      "1e15/cm^3",  8.94, [0.0, inf], "", "Number density of micelles"],
[db74c47]108    ["v_core",        "Ang^3",  62624.0,  [0.0, inf], "", "Core volume "],
[0d0aee1]109    ["v_corona",      "Ang^3",  61940.0,  [0.0, inf], "", "Corona volume"],
[42356c8]110    ["sld_solvent",   "1e-6/Ang^2", 6.4,  [0.0, inf], "sld", "Solvent scattering length density"],
111    ["sld_core",      "1e-6/Ang^2", 0.34, [0.0, inf], "sld", "Core scattering length density"],
112    ["sld_corona",    "1e-6/Ang^2", 0.8,  [0.0, inf], "sld", "Corona scattering length density"],
[a807206]113    ["radius_core",   "Ang",       45.0,  [0.0, inf], "", "Radius of core ( must be >> rg )"],
114    ["rg",    "Ang",       20.0,  [0.0, inf], "", "Radius of gyration of chains in corona"],
[0d0aee1]115    ["d_penetration", "",           1.0,  [-inf, inf], "", "Factor to mimic non-penetration of Gaussian chains"],
116    ["n_aggreg",      "",           6.0,  [-inf, inf], "", "Aggregation number of the micelle"],
117    ]
118# pylint: enable=bad-whitespace, line-too-long
119
[d2d6100]120single = False
121
[925ad6e]122source = ["lib/sas_3j1x_x.c", "polymer_micelle.c"]
[0d0aee1]123
[404ebbd]124def random():
[b297ba9]125    """Return a random parameter set for the model."""
[404ebbd]126    radius_core = 10**np.random.uniform(1, 3)
127    rg = radius_core * 10**np.random.uniform(-2, -0.3)
128    d_penetration = np.random.randn()*0.05 + 1
129    n_aggreg = np.random.randint(3, 30)
130    # volume of head groups is the core volume over the number of groups,
131    # with a correction for packing fraction of the head groups.
132    v_core = 4*pi/3*radius_core**3/n_aggreg * 0.68
133    # Rg^2 for gaussian coil is a^2n/6 => a^2 = 6 Rg^2/n
134    # a=2r => r = Rg sqrt(3/2n)
135    # v = 4/3 pi r^3 n => v = 4/3 pi Rg^3 (3/2n)^(3/2) n = pi Rg^3 sqrt(6/n)
136    tail_segments = np.random.randint(6, 30)
137    v_corona = pi * rg**3 * np.sqrt(6/tail_segments)
138    V = 4*pi/3*(radius_core + rg)**3
139    pars = dict(
140        background=0,
141        scale=1e7/V,
142        ndensity=8.94,
143        v_core=v_core,
144        v_corona=v_corona,
145        radius_core=radius_core,
146        rg=rg,
147        d_penetration=d_penetration,
148        n_aggreg=n_aggreg,
149    )
150    return pars
[0d0aee1]151
152tests = [
153    [{}, 0.01, 15.3532],
154    ]
[40a87fa]155# RKH 20Mar2016 - need to check whether the core & corona volumes are per
156#                 monomer ??? and how aggregation number works!
157# renamed from micelle_spherical_core to polymer_micelle,
158# moved from shape-independent to spheres section.
159# Ought to be able to add polydisp to core? And add ability to x by S(Q) ?
Note: See TracBrowser for help on using the repository browser.