source: sasmodels/sasmodels/models/lorentz.py @ d138d43

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

remove documentation build errors

  • Property mode set to 100644
File size: 1.7 KB
Line 
1r"""
2Lorentz (Ornstein-Zernicke Model)
3
4Definition
5----------
6
7The Ornstein-Zernicke model is defined by
8
9.. math:: I(q)=\frac{\text{scale}}{1+(qL)^2}+\text{bkg}
10
11The parameter *L* is the screening length.
12
13For 2D data: The 2D scattering intensity is calculated in the same way as 1D,
14where the $q$ vector is defined as
15
16.. math:: q=\sqrt{q_x^2 + q_y^2}
17
18.. figure:: img/lorentz_1d.jpg
19
20    1D plot using the default values (w/200 data point).
21
22Reference
23---------
24
25L.S. Qrnstein and F. Zernike, *Proc. Acad. Sci. Amsterdam* 17, 793 (1914), and
26*Z. Phys.* 19, 134 (1918), and 27, 761 {1926); referred to as QZ.
27"""
28
29from numpy import inf
30
31name = "lorentz"
32title = "Ornstein-Zernicke correlation length model"
33description = """
34Model that evaluates a Lorentz (Ornstein-Zernicke) model.
35       
36I(q) = scale/( 1 + (q*L)^2 ) + bkd
37       
38The model has three parameters:
39    length     =  screening Length
40    scale  =  scale factor
41    background    =  incoherent background
42"""
43category = "shape-independent"
44
45#             ["name", "units", default, [lower, upper], "type","description"],
46parameters = [["cor_length", "Ang", 50.0, [0, inf], "", "Screening length"],]
47
48Iq = """
49    double denominator = 1 + (q*cor_length)*(q*cor_length);
50    return 1/denominator;
51"""
52
53Iqxy = """
54    return Iq(sqrt(qx*qx + qy*qy), cor_length);
55    """
56
57# parameters for demo
58demo = dict(scale=1.0,background=0.0,cor_length=50.0)
59
60# For testing against the old sasview models, include the converted parameter
61# names and the target sasview model name.
62oldname = 'LorentzModel'
63oldpars = dict(cor_length='length')
64
65# parameters for unit tests
66tests = [
67         [{'cor_length' : 250},0.01,0.137931]
68         ]
Note: See TracBrowser for help on using the repository browser.