source: sasmodels/sasmodels/models/polymer_micelle.py @ ca04add

core_shell_microgelscostrafo411magnetic_modelticket-1257-vesicle-productticket_1156ticket_1265_superballticket_822_more_unit_tests
Last change on this file since ca04add was ca04add, checked in by lewis, 7 years ago

Modify model docs to render correctly on marketplace

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