source: sasmodels/sasmodels/models/gel_fit.py @ e481a39

core_shell_microgelscostrafo411magnetic_modelrelease_v0.94release_v0.95ticket-1257-vesicle-productticket_1156ticket_1265_superballticket_822_more_unit_tests
Last change on this file since e481a39 was aa2edb2, checked in by gonzalezm, 8 years ago

Removing hardcoded figures to be replaced by autogenerated ones

  • Property mode set to 100644
File size: 3.2 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.
11
12
13Definition
14----------
15
16The scattered intensity $I(q)$ is calculated as
17
18.. math::
19
20    I(Q) = I(0)_L \frac{1}{\left( 1+\left[ ((D+1/3)Q^2a_{1}^2
21    \right]\right)^{D/2}} + I(0)_G exp\left( -Q^2a_{2}^2\right) + B
22
23where
24
25.. math::
26
27    a_{2}^2 \approx \frac{R_{g}^2}{3}
28
29Note that the first term reduces to the Ornstein-Zernicke equation
30when $D = 2$; ie, when the Flory exponent is 0.5 (theta conditions).
31In gels with significant hydrogen bonding $D$ has been reported to be
32~2.6 to 2.8.
33
34
35Reference
36---------
37
38Mitsuhiro Shibayama, Toyoichi Tanaka, Charles C Han,
39*J. Chem. Phys.* 1992, 97 (9), 6829-6841
40
41Simon Mallam, Ferenc Horkay, Anne-Marie Hecht, Adrian R Rennie, Erik Geissler,
42*Macromolecules* 1991, 24, 543-548
43
44"""
45
46from numpy import inf
47
48name = "gel_fit"
49title = "Fitting using fine-scale polymer distribution in a gel."
50description = """\
51    Structure factor for interacting particles:
52
53    Shibayama-Geissler Two-Length Scale Fit for Gels (GelFit)
54
55    Shibayama; Tanaka; Han J Chem Phys (1992), 97(9), 6829-6841
56    Mallam; Horkay; Hecht; Rennie; Geissler, Macromol (1991), 24, 543
57"""
58category = "shape-independent"
59
60# pylint: disable=bad-whitespace, line-too-long
61#             ["name", "units", default, [lower, upper], "type","description"],
62parameters = [["guinier_scale",    "cm^{-1}",   1.7, [-inf, inf], "", "Guinier length scale"],
63              ["lorentzian_scale", "cm^{-1}",   3.5, [-inf, inf], "", "Lorentzian length scale"],
64              ["gyration_radius",  "Ang",     104.0, [2, inf],    "", "Radius of gyration"],
65              ["fractal_exp",      "",          2.0, [0, inf],    "", "Fractal exponent"],
66              ["cor_length",       "Ang",      16.0, [0, inf],    "", "Correlation length"]
67             ]
68# pylint: enable=bad-whitespace, line-too-long
69
70source = ["gel_fit.c"]
71
72demo = dict(background=0.01,
73            guinier_scale=1.7,
74            lorentzian_scale=3.5,
75            gyration_radius=104,
76            fractal_exp=2.0,
77            cor_length=16.0)
78
79oldname = 'GelFitModel'
80oldpars = dict(guinier_scale='gScale',
81               lorentzian_scale='lScale',
82               gyration_radius='radius',
83               fractal_exp='FractalExp',
84               cor_length='zeta')
85
86tests = [[{'guinier_scale': 1.0,
87           'lorentzian_scale': 1.0,
88           'gyration_radius': 10.0,
89           'fractal_exp': 10.0,
90           'cor_length': 20.0,
91           'background': 0.0,
92          }, 0.1, 0.716532],
93
94         [{'guinier_scale': 4.0,
95           'lorentzian_scale': 10.0,
96           'gyration_radius': 500.0,
97           'fractal_exp': 1.0,
98           'cor_length': 20.0,
99           'background': 20.0,
100          }, 5.0, 20.1224653026],
101        ]
Note: See TracBrowser for help on using the repository browser.