source: sasmodels/sasmodels/models/dab.py @ 94bd809

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

Fix pylint

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