source: sasmodels/sasmodels/models/guinier.py @ 2c74c11

core_shell_microgelscostrafo411magnetic_modelrelease_v0.94release_v0.95ticket-1257-vesicle-productticket_1156ticket_1265_superballticket_822_more_unit_tests
Last change on this file since 2c74c11 was 2c74c11, checked in by Paul Kienzle <pkienzle@…>, 8 years ago

implicit Iqxy; fix divide by 0 for q=0

  • Property mode set to 100644
File size: 1.3 KB
Line 
1r"""
2Definition
3----------
4
5This model fits the Guinier function
6
7.. math:: I(q) = scale \exp{\left[ \frac{-Q^2R_g^2}{3} \right]}
8
9to the data directly without any need for linearisation
10(*cf*. the usual plot of $\ln I(q)$ vs $q^2$\ ). Note that you may have to
11restrict the data range to include small q only, where the Guinier approximation
12actually applies. See also the guinier_porod model.
13
14For 2D data the scattering intensity is calculated in the same way as 1D,
15where the $q$ vector is defined as
16
17.. math:: q=\sqrt{q_x^2 + q_y^2}
18
19References
20----------
21
22A Guinier and G Fournet, *Small-Angle Scattering of X-Rays*,
23John Wiley & Sons, New York (1955)
24"""
25
26from numpy import inf
27
28name = "guinier"
29title = ""
30description = """
31 I(q) = scale.exp ( - rg^2 q^2 / 3.0 )
32 
33    List of default parameters:
34    scale = scale
35    rg = Radius of gyration
36"""
37category = "shape-independent"
38
39#             ["name", "units", default, [lower, upper], "type","description"],
40parameters = [["rg", "Ang", 60.0, [0, inf], "", "Radius of Gyration"]]
41
42Iq = """
43    double exponent = rg*rg*q*q/3.0;
44    double value = exp(-exponent);
45    return value;
46"""
47
48# parameters for demo
49demo = dict(scale=1.0, rg=60.0)
50
51# parameters for unit tests
52tests = [[{'rg' : 31.5}, 0.005, 0.992756]]
Note: See TracBrowser for help on using the repository browser.