source: sasmodels/sasmodels/models/fractal.py @ ec45c4f

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

remove oldname/oldpars from new models

  • Property mode set to 100644
File size: 3.7 KB
Line 
1r"""
2Definition
3----------
4This model calculates the scattering from fractal-like aggregates of spherical
5building blocks according the following equation:
6
7.. math::
8
9    I(q) &=& \phi\ V_{block} (\rho_{block} - \rho_{solvent})^2 P(q)S(q)
10    + background
11
12where $\phi$ is The volume fraction of the spherical "building block" particles
13of radius $R_0$, $V_{block}$ is the volume of a single building block,
14$\rho_{solvent}$ is the scattering length density of the solvent, and
15$\rho_{block}$ is the scattering length density of the building blocks, and
16P(q), S(q) are the scattering from randomly distributed spherical particles
17(the building blocks) and the interference from such building blocks organized
18in a fractal-like clusters.  P(q) and S(q) are calculated as:
19
20.. math::
21
22    \begin{eqnarray}
23    P(q)&=& F(qR_0)^2 \\
24    F(q)&=& \frac{3 (sinx - x cosx)}{x^3} \\
25    V_{particle} &=& \frac{4}{3}\ \pi R_0 \\
26    S(q) &=& 1 + \frac{D_f\  \Gamma\!(D_f-1)}{[1+1/(q \xi)^2\  ]^{(D_f -1)/2}}
27    \frac{sin[(D_f-1) \tan^{-1}(q \xi) ]}{(q R_0)^{D_f}}
28    \end{eqnarray}
29
30where $\xi$ is the correlation length representing the cluster size and $D_f$
31is the fractal dimension, representing the self similarity of the structure.
32
33**Polydispersity on the radius is provided for.**
34
35For 2D data: The 2D scattering intensity is calculated in the same way as
361D, where the *q* vector is defined as
37
38.. math::
39
40    q = \sqrt{q_x^2 + q_y^2}
41
42
43References
44----------
45
46J Teixeira, *J. Appl. Cryst.*, 21 (1988) 781-785
47
48**Author:** NIST IGOR/DANSE **on:** pre 2010
49
50**Last Modified by:** Paul Butler **on:** March 20, 2016
51
52**Last Reviewed by:** Paul Butler **on:** March 20, 2016
53
54"""
55
56from numpy import inf
57
58name = "fractal"
59title = "Calculates the scattering from fractal-like aggregates of spheres \
60following theTexiera reference."
61description = """
62        The scattering intensity is given by
63        I(q) = scale * V * delta^(2) * P(q) * S(q) + background, where
64        p(q)= F(q*radius)^(2)
65        F(x) = 3*[sin(x)-x cos(x)]/x**3
66        delta = sld_block -sld_solv
67        scale        =  scale * volfraction
68        radius       =  Block radius
69        sld_block    =  SDL block
70        sld_solv  =  SDL solvent
71        background   =  background
72        and S(q) is the interference term between building blocks given
73        in the full documentation and depending on the parameters
74        fractal_dim  =  Fractal dimension
75        cor_length  =  Correlation Length    """
76
77category = "shape-independent"
78
79# pylint: disable=bad-whitespace, line-too-long
80#             ["name", "units", default, [lower, upper], "type","description"],
81parameters = [["volfraction", "", 0.05, [0.0, 1], "",
82               "volume fraction of blocks"],
83              ["radius",    "Ang",  5.0, [0.0, inf], "",
84               "radius of particles"],
85              ["fractal_dim",      "",  2.0, [0.0, 6.0], "",
86               "fractal dimension"],
87              ["cor_length", "Ang", 100.0, [0.0, inf], "",
88               "cluster correlation length"],
89              ["sld_block", "1e-6/Ang^2", 2.0, [-inf, inf], "",
90               "scattering length density of particles"],
91              ["sld_solvent", "1e-6/Ang^2", 6.4, [-inf, inf], "",
92               "scattering length density of solvent"],
93             ]
94# pylint: enable=bad-whitespace, line-too-long
95
96source = ["lib/sph_j1c.c", "lib/sas_gamma.c", "fractal.c"]
97
98demo = dict(volfraction=0.05,
99            radius=5.0,
100            fractal_dim=2.0,
101            cor_length=100.0,
102            sld_block=2.0,
103            sld_solvent=6.4)
104
105# NOTE: test results taken from values returned by SasView 3.1.2
106tests = [
107    [{}, 0.0005, 40.4980069872],
108    [{}, 0.234734468938, 0.0947143166058],
109    [{}, 0.5, 0.0176878183458],
110    ]
Note: See TracBrowser for help on using the repository browser.