source: sasmodels/sasmodels/models/dab.py @ d507c3a

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

make model docs more consistent; build pdf docs

  • Property mode set to 100644
File size: 2.1 KB
Line 
1r"""
2
3Calculates the scattering from a randomly distributed, two-phase system based on
4the Debye-Anderson-Brumberger (DAB) model for such systems. The two-phase system
5is characterized by a single length scale, the correlation length, which is a
6measure of the average spacing between regions of phase 1 and phase 2. **The
7model also assumes smooth interfaces between the phases** and hence exhibits
8Porod behavior $(I \sim q^{-4})$ at large $q$, $(qL \gg 1)$.
9
10The DAB model is ostensibly a development of the earlier Debye-Bueche model.
11
12Definition
13----------
14
15.. math::
16
17    I(q) = \text{scale}\cdot\frac{L^3}{(1 + (q\cdot L)^2)^2} + \text{background}
18
19where scale is
20
21.. math:: \text{scale} = 8 \pi \phi (1-\phi) \Delta\rho^2
22
23and the parameter $L$ is the correlation length.
24
25For 2D data the scattering intensity is calculated in the same way as 1D,
26where the $q$ vector is defined as
27
28.. math:: q = \sqrt{q_x^2 + q_y^2}
29
30.. figure:: img/dab_1d.jpg
31
32   1D plot using the default values (w/200 data point).
33
34
35References
36----------
37
38P Debye, H R Anderson, H Brumberger, *Scattering by an Inhomogeneous Solid. II.
39The Correlation Function and its Application*, *J. Appl. Phys.*, 28(6) (1957) 679
40
41P Debye, A M Bueche, *Scattering by an Inhomogeneous Solid*, *J. Appl. Phys.*,
4220 (1949) 518
43
44*2013/09/09 - Description reviewed by King, S and Parker, P.*
45
46"""
47
48from numpy import inf
49
50name = "dab"
51title = "DAB (Debye Anderson Brumberger) Model"
52description = """\
53
54F(q)= scale * L^3/(1 + (q*L)^2)^2
55
56L: the correlation length
57
58"""
59category = "shape-independent"
60
61#             ["name", "units", default, [lower, upper], "type", "description"],
62parameters = [["length", "Ang", 50.0, [0, inf], "", "correlation length"],
63             ]
64
65Iq = """
66    double numerator   = pow(length, 3);
67    double denominator = pow(1 + pow(q*length,2), 2);
68   
69    return numerator / denominator ;
70    """
71
72Iqxy = """
73    // never called since no orientation or magnetic parameters.
74    //return -1.0;
75    return Iq(sqrt(qx*qx + qy*qy), length);
76    """
77
78# ER defaults to 1.0
79
80# VR defaults to 1.0
81
82demo = dict(scale=1, background=0, length=50)
83oldname = "DABModel"
84oldpars = dict(length='length')
Note: See TracBrowser for help on using the repository browser.