source: sasmodels/sasmodels/models/surface_fractal.py @ 30b4ddf

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

Converted GelFit? model

  • Property mode set to 100644
File size: 3.1 KB
Line 
1r"""
2This model calculates the scattering from fractal-like aggregates based
3on the Mildner reference.
4
5Definition
6----------
7
8The scattering intensity $I(q)$ is calculated as
9
10.. math::
11
12    I(q) = scale \times P(q)S(q) + background
13
14.. math::
15
16    P(q) = F(qR)^2
17
18.. math::
19
20    F(x) = \frac{3\left[sin(x)-xcos(x)\right]}{x^3}
21
22.. math::
23
24    S(q) = \frac{\Gamma(5-D_S)\zeta^{5-D_S}}{\left[1+(q\zeta)^2\right]^{(5-D_S)/2}}
25    \frac{sin\left[(D_S - 5) tan^{-1}(q\zeta) \right]}{q}
26
27.. math::
28
29    scale = scale\_factor \times NV^2(\rho_{particle} - \rho_{solvent})^2
30
31.. math::
32
33    V = \frac{4}{3}\pi R^3
34
35where $R$ is the radius of the building block, $D_S$ is the **surface** fractal dimension,
36$\zeta$ is the cut-off length, $\rho_{solvent}$ is the scattering length density of the solvent,
37and $\rho_{particle}$ is the scattering length density of particles.
38
39.. note::
40    The surface fractal dimension $D_s$ is only valid if $1<surface\_dim<3$.
41    It is also only valid over a limited $q$ range (see the reference for details)
42
43
44.. figure:: img/surface_fractal_1d.jpg
45
46    1D plot using the default values.
47
48Reference
49---------
50
51D Mildner and P Hall, *J. Phys. D: Appl. Phys.*, 19 (1986) 1535-1545
52
53"""
54
55from numpy import inf
56
57name = "surface_fractal"
58title = "Fractal-like aggregates based on the Mildner reference"
59description = """\
60    [The scattering intensity  I(x) = scale*P(x)*S(x) + background, where
61        scale = scale_factor  * V * delta^(2)
62        p(x) = F(x*radius)^(2)
63        F(x) = 3*[sin(x)-x cos(x)]/x**3
64        S(x) = [(gamma(5-Ds)*colength^(5-Ds)*[1+(x^2*colength^2)]^((Ds-5)/2)
65             * sin[(Ds-5)*arctan(x*colength)])/x]
66        where
67        delta        =  sldParticle -sldSolv.
68        radius       =  Particle radius
69        surface_dim  =  Surface fractal dimension (Ds)
70        co_length    =  Cut-off length
71        background   =  background
72
73        Ref.   :Mildner, Hall,J Phys D Appl Phys(1986), 19, 1535-1545
74        Note I : This model is valid for 1<surface_dim<3 with limited q range.
75        Note II: This model is not in absolute scale.
76"""
77category = "shape-independent"
78
79#             ["name", "units", default, [lower, upper], "type","description"],
80parameters = [["radius",        "Ang", 10.0, [0, inf],   "", "Particle radius"],
81              ["surface_dim",   "",    2.0,  [0, inf],   "", "Surface fractal dimension"],
82              ["cutoff_length", "Ang", 500., [0.0, inf], "",  "Cut-off Length"],
83              ]
84
85
86source = ["surface_fractal.c"]
87
88demo = dict(scale=1, background=0,
89            radius=10, surface_dim=2.0, cutoff_length=500)
90
91oldname = 'SurfaceFractalModel'
92oldpars = dict(radius='radius',
93               surface_dim='surface_dim',
94               cutoff_length='co_length')
95
96tests = [[{'radius': 1.0, 'surface_dim': 1.0, 'cutoff_length': 10.0,
97           }, 0.332070182643, 1125.00321004],
98
99         [{'radius': 3.5, 'surface_dim': 0.1, 'cutoff_length': 30.0,
100           'background': 0.01,
101           }, 5.0, 0.00999998891322],
102
103         [{'radius': 3.0, 'surface_dim': 1.0, 'cutoff_length': 33.0,
104           'scale': 0.1,
105           }, 0.51, 2.50020147004],
106         ]
Note: See TracBrowser for help on using the repository browser.