source: sasmodels/sasmodels/models/gel_fit.py

Last change on this file was c1e44e5, checked in by Paul Kienzle <pkienzle@…>, 5 years ago

Add local link to source files. Refs #1263.

  • Property mode set to 100644
File size: 3.6 KB
Line 
1r"""
2*This model was implemented by an interested user!*
3
4Unlike a concentrated polymer solution, the fine-scale polymer distribution
5in a gel involves at least two characteristic length scales,
6a shorter correlation length ( $a1$ ) to describe the rapid fluctuations
7in the position of the polymer chains that ensure thermodynamic equilibrium,
8and a longer distance (denoted here as $a2$ ) needed to account for the static
9accumulations of polymer pinned down by junction points or clusters of such
10points. The latter is derived from a simple Guinier function. Compare also the
11gauss_lorentz_gel model.
12
13
14Definition
15----------
16
17The scattered intensity $I(q)$ is calculated as
18
19.. math::
20
21    I(Q) = I(0)_L \frac{1}{\left( 1+\left[ ((D+1/3)Q^2a_{1}^2
22    \right]\right)^{D/2}} + I(0)_G exp\left( -Q^2a_{2}^2\right) + B
23
24where
25
26.. math::
27
28    a_{2}^2 \approx \frac{R_{g}^2}{3}
29
30Note that the first term reduces to the Ornstein-Zernicke equation
31when $D = 2$; ie, when the Flory exponent is 0.5 (theta conditions).
32In gels with significant hydrogen bonding $D$ has been reported to be
33~2.6 to 2.8.
34
35
36References
37----------
38
39.. [#] Mitsuhiro Shibayama, Toyoichi Tanaka, Charles C Han, *J. Chem. Phys.* 1992, 97 (9), 6829-6841
40
41.. [#] Simon Mallam, Ferenc Horkay, Anne-Marie Hecht, Adrian R Rennie, Erik Geissler, *Macromolecules* 1991, 24, 543-548
42
43Authorship and Verification
44----------------------------
45
46* **Author:**
47* **Last Modified by:**
48* **Last Reviewed by:**
49"""
50
51import numpy as np
52from numpy import inf
53
54name = "gel_fit"
55title = "Fitting using fine-scale polymer distribution in a gel."
56description = """\
57    Structure factor for interacting particles:
58
59    Shibayama-Geissler Two-Length Scale Fit for Gels (GelFit)
60
61    Shibayama; Tanaka; Han J Chem Phys (1992), 97(9), 6829-6841
62    Mallam; Horkay; Hecht; Rennie; Geissler, Macromol (1991), 24, 543
63"""
64category = "shape-independent"
65
66# pylint: disable=bad-whitespace, line-too-long
67#             ["name", "units", default, [lower, upper], "type","description"],
68parameters = [["guinier_scale",    "cm^-1",   1.7, [-inf, inf], "", "Guinier length scale"],
69              ["lorentz_scale", "cm^-1",   3.5, [-inf, inf], "", "Lorentzian length scale"],
70              ["rg",  "Ang",     104.0, [2, inf],    "", "Radius of gyration"],
71              ["fractal_dim",      "",          2.0, [0, inf],    "", "Fractal exponent"],
72              ["cor_length",       "Ang",      16.0, [0, inf],    "", "Correlation length"]
73             ]
74# pylint: enable=bad-whitespace, line-too-long
75
76source = ["gel_fit.c"]
77
78def random():
79    """Return a random parameter set for the model."""
80    guinier_scale = 10**np.random.uniform(1, 3)
81    lorentz_scale = 10**np.random.uniform(1, 3)
82    rg = 10**np.random.uniform(1, 5)
83    fractal_dim = np.random.uniform(0, 6)
84    cor_length = 10**np.random.uniform(0, 3)
85    pars = dict(
86        #background=0,
87        scale=1,
88        guinier_scale=guinier_scale,
89        lorentz_scale=lorentz_scale,
90        rg=rg,
91        fractal_dim=fractal_dim,
92        cor_length=cor_length
93    )
94    return pars
95
96demo = dict(background=0.01,
97            guinier_scale=1.7,
98            lorentz_scale=3.5,
99            rg=104,
100            fractal_dim=2.0,
101            cor_length=16.0)
102
103tests = [[{'guinier_scale': 1.0,
104           'lorentz_scale': 1.0,
105           'rg': 10.0,
106           'fractal_dim': 10.0,
107           'cor_length': 20.0,
108           'background': 0.0,
109          }, 0.1, 0.716532],
110
111         [{'guinier_scale': 4.0,
112           'lorentz_scale': 10.0,
113           'rg': 500.0,
114           'fractal_dim': 1.0,
115           'cor_length': 20.0,
116           'background': 20.0,
117          }, 5.0, 20.1224653026],
118        ]
Note: See TracBrowser for help on using the repository browser.