source: sasmodels/sasmodels/models/dab.py @ 830cf6b

ticket-1257-vesicle-productticket_1156ticket_822_more_unit_tests
Last change on this file since 830cf6b was 0507e09, checked in by smk78, 5 years ago

Added link to source code to each model. Closes #883

  • Property mode set to 100644
File size: 2.4 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
30References
31----------
32
33.. [#] P Debye, H R Anderson, H Brumberger, *Scattering by an Inhomogeneous Solid. II. The Correlation Function and its Application*, *J. Appl. Phys.*, 28(6) (1957) 679
34.. [#] P Debye, A M Bueche, *Scattering by an Inhomogeneous Solid*, *J. Appl. Phys.*, 20 (1949) 518
35
36Source
37------
38
39`dab.py <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/dab.py>`_
40
41Authorship and Verification
42----------------------------
43
44* **Author:**
45* **Last Modified by:**
46* **Last Reviewed by:** Steve King & Peter Parker **Date:** September 09, 2013
47* **Source added by :** Steve King **Date:** March 25, 2019
48"""
49
50import numpy as np
51from numpy import inf
52
53name = "dab"
54title = "DAB (Debye Anderson Brumberger) Model"
55description = """\
56
57F(q)= scale * L^3/(1 + (q*L)^2)^2
58
59L: the correlation length
60
61"""
62category = "shape-independent"
63
64#             ["name", "units", default, [lower, upper], "type", "description"],
65parameters = [["cor_length", "Ang", 50.0, [0, inf], "", "correlation length"],
66             ]
67
68Iq = """
69    double numerator   = cube(cor_length);
70    double denominator = square(1 + square(q*cor_length));
71
72    return numerator / denominator ;
73    """
74
75def random():
76    """Return a random parameter set for the model."""
77    pars = dict(
78        scale=10**np.random.uniform(1, 4),
79        cor_length=10**np.random.uniform(0.3, 3),
80#        background = 0,
81    )
82    pars['scale'] /= pars['cor_length']**3
83    return pars
84
85demo = dict(scale=1, background=0, cor_length=50)
Note: See TracBrowser for help on using the repository browser.