source: sasmodels/sasmodels/models/surface_fractal.py @ 925ad6e

core_shell_microgelscostrafo411magnetic_modelticket-1257-vesicle-productticket_1156ticket_1265_superballticket_822_more_unit_tests
Last change on this file since 925ad6e was 925ad6e, checked in by wojciech, 6 years ago

sph_j1c translated to sas_3j1x_x

  • Property mode set to 100644
File size: 3.3 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) &= \text{scale} \times P(q)S(q) + \text{background} \\
13    P(q) &= F(qR)^2 \\
14    F(x) &= \frac{3\left[\sin(x)-x\cos(x)\right]}{x^3} \\
15    S(q) &= \Gamma(5-D_S)\xi^{\,5-D_S}\left[1+(q\xi)^2 \right]^{-(5-D_S)/2}
16            \sin\left[-(5-D_S) \tan^{-1}(q\xi) \right] q^{-1} \\
17    \text{scale} &= \text{scale_factor}\, N V^2(\rho_\text{particle} - \rho_\text{solvent})^2 \\
18    V &= \frac{4}{3}\pi R^3
19
20where $R$ is the radius of the building block, $D_S$ is the **surface** fractal
21dimension, $\xi$ is the cut-off length, $\rho_\text{solvent}$ is the scattering
22length density of the solvent and $\rho_\text{particle}$ is the scattering
23length density of particles.
24
25.. note::
26
27    The surface fractal dimension is only valid if $1<D_S<3$. The result is
28    only valid over a limited $q$ range, $\tfrac{5}{3-D_S}\xi^{\,-1} < q < R^{-1}$.
29    See the reference for details.
30
31
32References
33----------
34
35D Mildner and P Hall, *J. Phys. D: Appl. Phys.*, 19 (1986) 1535-1545
36
37"""
38
39from numpy import inf
40
41name = "surface_fractal"
42title = "Fractal-like aggregates based on the Mildner reference"
43description = """\
44    [The scattering intensity  I(x) = scale*P(x)*S(x) + background, where
45        scale = scale_factor  * V * delta^(2)
46        p(x) = F(x*radius)^(2)
47        F(x) = 3*[sin(x)-x cos(x)]/x**3
48        S(x) = [(gamma(5-Ds)*colength^(5-Ds)*[1+(x^2*colength^2)]^((Ds-5)/2)
49             * sin[(Ds-5)*arctan(x*colength)])/x]
50        where
51        delta        =  sldParticle -sldSolv.
52        radius       =  Particle radius
53        fractal_dim_surf  =  Surface fractal dimension (Ds)
54        co_length    =  Cut-off length
55        background   =  background
56
57        Ref.   :Mildner, Hall,J Phys D Appl Phys(1986), 19, 1535-1545
58        Note I : This model is valid for 1<fractal_dim_surf<3 with limited q range.
59        Note II: This model is not in absolute scale.
60"""
61category = "shape-independent"
62
63# pylint: disable=bad-whitespace, line-too-long
64#             ["name", "units", default, [lower, upper], "type","description"],
65parameters = [["radius",        "Ang", 10.0, [0, inf],   "",
66               "Particle radius"],
67              ["fractal_dim_surf",   "",    2.0,  [1, 3],   "",
68               "Surface fractal dimension"],
69              ["cutoff_length", "Ang", 500., [0.0, inf], "",
70               "Cut-off Length"],
71             ]
72# pylint: enable=bad-whitespace, line-too-long
73
74source = ["lib/sas_3j1x_x.c", "lib/sas_gamma.c", "surface_fractal.c"]
75
76demo = dict(scale=1, background=1e-5,
77            radius=10, fractal_dim_surf=2.0, cutoff_length=500)
78
79tests = [
80    # Accuracy tests based on content in test/utest_other_models.py
81    [{'radius': 10.0,
82      'fractal_dim_surf': 2.0,
83      'cutoff_length': 500.0,
84     }, 0.05, 301428.66016],
85
86    # Additional tests with larger range of parameters
87    [{'radius': 1.0,
88      'fractal_dim_surf': 1.0,
89      'cutoff_length': 10.0,
90     }, 0.332070182643, 1125.00421004],
91
92    [{'radius': 3.5,
93      'fractal_dim_surf': 0.1,
94      'cutoff_length': 30.0,
95      'background': 0.01,
96     }, 5.0, 0.00999998891322],
97
98    [{'radius': 3.0,
99      'fractal_dim_surf': 1.0,
100      'cutoff_length': 33.0,
101      'scale': 0.1,
102     }, 0.51, 2.50120147004],
103    ]
Note: See TracBrowser for help on using the repository browser.