# source:sasmodels/sasmodels/models/core_shell_microgels.py@de687d5

core_shell_microgels
Last change on this file since de687d5 was de687d5, checked in by rachelrford, 19 months ago

core shell microgel model first commit

• Property mode set to 100644
File size: 8.5 KB
Line
1r"""
2Polydisperse spherical core-shell microgel particles with fuzzy interfaces.
3====================
4
5This model provides the form factor, $P(q)$, for a spherical particle with
6core-shell structure and fuzzy interfaces, as follows. A Lorentzian peak is
7used to account for intra-particle composition fluctuations.
8
9.. math::
10    P(q) = \bigl[(\rho _{shell} - \rho _{solv})
11    \Phi _{{shell}_{out}}(q, R_{{shell}_{out}}, s_{{shell}_{out}})
12    + (\rho _{core} - \rho _{solv})\Phi _{core}(q, R_{core}, s_{core})
13    - (\rho _{shell} - \rho _{solv})\Phi _{{shell}_{in}}(q, R_{{shell}_{in}}, s_{{shell}_{in}})\bigr]^2
14    + \left(\frac{L_0}{1 + q^2\xi _{intra}^2}\right)
15
16where $\Phi _k$ is the radial density profile of component $k$, given by:
17
18.. math::
19\begin{align*}
20  \Phi _k(q,R_k,s_k) = \frac{4\pi }{q^4s_k^2} \biggl((R_k+s_k)cos[q(R_k+s_k)]
21  + (R_k-s_k)cos[q(R_k-s_k)] - 3sin[q(R_k+s_k)]&  \\
22  - 3sin[q(R_k-s_k)] + \frac{2cos(qR_k)}{q} + \frac{6sin(qR_k)}{q}&\biggr)
23\end{align*}
24
25and $k = core, shell_{in}, shell_{out}$.
26
27The core-shell interface can be either symmetric or asymmetric, and arises
28from interpenetration of the core polymer and the shell polymer. The model
29assumes a box density profile for each component, with a parabolic gradation
30at the interfaces. The model also includes a Lorentzian peak to account for
31composition fluctuations within the particle. A radial density profile
32$\Phi _{overall}(R)$ may be constructed from the fitted SANS curves. Polydispersity
33is accounted for in the overall particle radius, $R_tot$ (i.e. core, shell,
34inner interfaces, and outer surface/interface).
35
36Add Figure 1 from Angew. paper
37
38Parameters:\\
39$\rho _{core}$: scattering length density of the core\\
40$\rho _{shell}$: scattering length density of the shell\\
41$\rho _{solv}$: scattering length density of the solvent\\
42$R_{tot}$: radius of the full core-shell particle (polydisperse)\\
43$R_{core}$: half-width radius of the core interface\\
44$R_{{shell}_{in}}$: half-width radius of the shell inner interface\\
45$s_{core}$: half of the thickness of the core interface\\
46$s_{{shell}_{in}}$: half of the thickness of the shell inner interface\\
47$s_{{shell}_{out}}$: half of the thickness of the shell outer interface\\
48$L_0$: Lorentzian scale factor\\
49$\xi _{intra}$: characteristic length of intra-particle fluctuations\\
50
51
52Relationships to other physical parameters:\\
53$W_{shell} = R_{tot} - R_{{shell}_{in}} - s_{{shell}_{in}} - 2*s_{{shell}_{out}}$ = width/thickness of the shell \\
54$W_{core} = R_{core} - s_{core}$ = width/radius of the core \\
55$R_{{shell}_{out}} = R_{tot} - s_{{shell}_{out}}$ = half-width radius of the shell outer interface\\
56
57Additionally, one can calculate the following volumes:\\
58.. math::
59\begin{align*}
60  V_{core} &= 4\pi \left(\frac{R_{core}^3}{3} +
61  \frac{R_{core}s_{core}^2}{6}\right) \\
62  V_{shell} &= 4\pi \left[\frac{R_{{shell}_{out}}^3 - R_{{shell}_{in}}^3}{3} +
63  \frac{R_{{shell}_{out}}s_{{shell}_{out}}^2 - R_{{shell}_{in}}s_{{shell}_{in}}^2}{6}\right]
64\end{align*}
65
66Special case for a symmetric core-shell interface:\\
67$R_{{shell}_{in}} = R_{core}$ and $s_{{shell}_{in}} = s_{core}$
68
69====================
70References
71-----------
72
73Berndt, I., Pedersen, J. S., Richtering, W. J. Am. Chem. Soc. 2005, 127,
74pp. 9372 - 9373.
75
76Berndt, I., Pedersen, J. S., Lindner, P., Richtering, W. Langmuir. 2006, 22,
77pp. 459 - 468.
78
79Berndt, I., Pedersen, J. S., Richtering, W. Angew. Chem. 2006, 118,
80pp. 1769 - 1773.
81
82====================
83Author: Rachel Ford
84
85"""
86
87import numpy as np
88
89#name = """core_shell_microgels"""
90#title = """Form factor for fuzzy spherical core-shell microgels
91#    with a Lorentzian peak for intra-particle fluctuations."""
92#description = """
93#    P(q) = [(rho_shell - rho_solv)*Phi_shell_out(q, R_shell_out, s_shell_out)
94#    + (rho_core - rho_solv)*Phi_core(q, R_core, s_core)
95#    - (rho_shell - rho_solv)*Phi_shell_in(q, R_shell_in, s_shell_in)]**2
96#    + L_0/(1 + q**2*xi_intra**2)
97#
98#    where density profile Phi(q, R, s) is given by:
99#    Phi_k(q,R_k,s_k) = (4*pi/q**4*s_k**2)*((R_k+s_k)cos[q(R_k+s_k)] +
100#    (R_k-s_k)cos[q(R_k-s_k)] - 3sin[q(R_k+s_k)] - 3sin[q(R_k-s_k)] +
101#    2cos(qR_k)/q + 6sin(qR_k)/q)
102#
103#    and k = core, shell_in, shell_out.
104#
105#    List of parameters:
106#    rho_core: SLD of the core
107#    rho_shell: SLD of the shell
108#    rho_solv: SLD of the solvent
109#    R_tot: radius of the full particle (polydisperse)
110#    R_core: half-width radius of the core
111#    R_shell_in: half-width radius of the shell inner interface
112#    s_core: half the thickness of the core interface
113#    s_shell_in: half the thickness of the shell inner interface
114#    s_shell_out: half of the thickness of the outer shell interface
115#    L_0: Lorentzian scale factor
116#    xi_intra: characteristic length of intra-particle fluctuations
117#    """
118#category = "shape:sphere"
119
121#             ["name", "units", default, [lower, upper], "type", "description"],
122#parameters = [["rho_core",    "1e-06 Ang^-2",   2.0, [-inf, inf], "",       "SLD of core"],
123#              ["rho_shell",   "1e-06 Ang^-2",   3.0, [-inf, inf], "",       "SLD of shell"],
124#              ["rho_solv",    "1e-06 Ang^-2",   1.0, [-inf, inf], "",       "SLD of solvent"],
125#              ["R_tot",       "Ang",          700.0,    [0, inf], "volume", "Radius of full particle"],
126#              ["R_core",      "Ang",          500.0,    [0, inf], "",       "Radius of core"],
127#              ["R_shell_in",  "Ang",          550.0,    [0, inf], "",       "Radius of shell inner interface"],
128#              ["s_core",      "Ang",           20.0,    [0, inf], "",       "Half-width of core interface"],
129#              ["s_shell_in",  "Ang",           20.0,    [0, inf], "",       "Half-width of shell inner interface"],
130#              ["s_shell_out", "Ang",           20.0,    [0, inf], "",       "Half-width of shell outer interface"],
131#              ["L_0",         "",              10.0,    [0, inf], "",       "Lorentzian scale factor"],
132#              ["xi_intra",    "Ang",            1.0,    [0, inf], "",       "Intra-particle characteristic length"]
133#             ]
135#
136#
137def R_shell_out(R, s):
139    return R - s
140
141def phi_full(q, R, s):
142    """Return the Fourier Transform of the particle density profile.
143    Box profile with parabolic gradation of interfaces."""
144    return (4*np.pi/((q**4)*(s**2)))*((R+s)*np.cos(q*(R+s)) + (R-s)*np.cos(q*(R-s))
145           - (3/q)*np.sin(q*(R+s)) - (3/q)*np.sin(q*(R-s)) + (2/q)*np.cos(q*R)
146           + (6/q)*np.sin(q*R))
147
148def Fq(q, rho_core, rho_shell, rho_solv, R_tot, R_core, R_shell_in, s_core,
149       s_shell_in, s_shell_out):
150    """Return the scattering amplitude for core-shell microgels."""
151    return (rho_shell - rho_solv)*phi_full(q=q, R=R_shell_out(R=R_tot, s=s_shell_out), s=s_shell_out)
152    + (rho_core - rho_solv)*phi_full(q=q, R=R_core, s=s_core)
153    - (rho_shell - rho_solv)*phi_full(q=q, R=R_shell_in, s=s_shell_in)
154
155def Lor(q, L_0, xi):
156    """Return a Lorenztian peak with correlation length xi."""
157    return L_0/(1 + q**2*xi**2)
158
159def Iq(q,
160       rho_core=2.0,
161       rho_shell=3.0,
162       rho_solv=1.0,
163       R_tot=700.0,
164       R_core=500.0,
165       R_shell_in=550.0,
166       s_core=20.0,
167       s_shell_in=20.0,
168       s_shell_out=20.0,
169       L_0=1.0,
170       xi_intra=1.0):
171    """Return the form factor of core-shell microgels.
172    :param q:           Input q-value
173    :param rho_core:    SLD of core
174    :param rho_shell:   SLD of shell
175    :param rho_solv:    SLD of solvent
176    :param R_tot:       Radius of full particle
177    :param R_core:      Radius of core
178    :param R_shell_in:  Radius of shell inner interface
179    :param s_core:      Half-width of core interface
180    :param s_shell_in:  Half-width of shell inner interface
181    :param s_shell_out: Half-width of shell outer interface
182    :param L_0:         Lorentzian scale factor
183    :param xi_intra:    Intra-particle characteristic length
184    :return:            Calculated intensity
185    """
186    A = Fq(q=q, rho_core=rho_core, rho_shell=rho_shell, rho_solv=rho_solv,
187    R_tot=R_tot, R_core=R_core, R_shell_in=R_shell_in, s_core=s_core,
188    s_shell_in=s_shell_in, s_shell_out=s_shell_out)
189    return A**2 + Lor(q=q, L_0=L_0, xi=xi_intra)
190
191def norm(Iq, n, u):
192    """Normalize Iq to number density of particles and convert to cm^-1"""
193    return Iq*n*u
194
195print(norm(Iq=Iq(q=0.1, rho_core=0.62, rho_shell=0.74, rho_solv=6.4, R_tot=1170, R_core=965, R_shell_in=965, s_core=15, s_shell_in=15, s_shell_out=20, L_0=1, xi_intra=5), n=10**-10, u=10**-8))
Note: See TracBrowser for help on using the repository browser.