1 | r""" |
---|
2 | This model calculates the scattering from fractal-like aggregates based |
---|
3 | on the Mildner reference. |
---|
4 | |
---|
5 | Definition |
---|
6 | ---------- |
---|
7 | |
---|
8 | The 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 |
---|
25 | \right]^{(5-D_S)/2}} |
---|
26 | \frac{sin\left[(D_S - 5) tan^{-1}(q\zeta) \right]}{q} |
---|
27 | |
---|
28 | .. math:: |
---|
29 | |
---|
30 | scale = scale\_factor \times NV^2(\rho_{particle} - \rho_{solvent})^2 |
---|
31 | |
---|
32 | .. math:: |
---|
33 | |
---|
34 | V = \frac{4}{3}\pi R^3 |
---|
35 | |
---|
36 | where $R$ is the radius of the building block, $D_S$ is the **surface** fractal |
---|
37 | dimension,$\zeta$ is the cut-off length, $\rho_{solvent}$ is the scattering |
---|
38 | length density of the solvent, |
---|
39 | and $\rho_{particle}$ is the scattering length density of particles. |
---|
40 | |
---|
41 | .. note:: |
---|
42 | The surface fractal dimension $D_s$ is only valid if $1<surface\_dim<3$. |
---|
43 | It is also only valid over a limited $q$ range (see the reference for |
---|
44 | details) |
---|
45 | |
---|
46 | |
---|
47 | .. figure:: img/surface_fractal_1d.jpg |
---|
48 | |
---|
49 | 1D plot using the default values. |
---|
50 | |
---|
51 | Reference |
---|
52 | --------- |
---|
53 | |
---|
54 | D Mildner and P Hall, *J. Phys. D: Appl. Phys.*, 19 (1986) 1535-1545 |
---|
55 | |
---|
56 | """ |
---|
57 | |
---|
58 | from numpy import inf |
---|
59 | |
---|
60 | name = "surface_fractal" |
---|
61 | title = "Fractal-like aggregates based on the Mildner reference" |
---|
62 | description = """\ |
---|
63 | [The scattering intensity I(x) = scale*P(x)*S(x) + background, where |
---|
64 | scale = scale_factor * V * delta^(2) |
---|
65 | p(x) = F(x*radius)^(2) |
---|
66 | F(x) = 3*[sin(x)-x cos(x)]/x**3 |
---|
67 | S(x) = [(gamma(5-Ds)*colength^(5-Ds)*[1+(x^2*colength^2)]^((Ds-5)/2) |
---|
68 | * sin[(Ds-5)*arctan(x*colength)])/x] |
---|
69 | where |
---|
70 | delta = sldParticle -sldSolv. |
---|
71 | radius = Particle radius |
---|
72 | surface_dim = Surface fractal dimension (Ds) |
---|
73 | co_length = Cut-off length |
---|
74 | background = background |
---|
75 | |
---|
76 | Ref. :Mildner, Hall,J Phys D Appl Phys(1986), 19, 1535-1545 |
---|
77 | Note I : This model is valid for 1<surface_dim<3 with limited q range. |
---|
78 | Note II: This model is not in absolute scale. |
---|
79 | """ |
---|
80 | category = "shape-independent" |
---|
81 | |
---|
82 | # pylint: disable=bad-whitespace, line-too-long |
---|
83 | # ["name", "units", default, [lower, upper], "type","description"], |
---|
84 | parameters = [["radius", "Ang", 10.0, [0, inf], "", |
---|
85 | "Particle radius"], |
---|
86 | ["surface_dim", "", 2.0, [0, inf], "", |
---|
87 | "Surface fractal dimension"], |
---|
88 | ["cutoff_length", "Ang", 500., [0.0, inf], "", |
---|
89 | "Cut-off Length"], |
---|
90 | ] |
---|
91 | # pylint: enable=bad-whitespace, line-too-long |
---|
92 | |
---|
93 | source = ["lib/sph_j1c.c", "lib/lanczos_gamma.c", "surface_fractal.c"] |
---|
94 | |
---|
95 | demo = dict(scale=1, background=0, |
---|
96 | radius=10, surface_dim=2.0, cutoff_length=500) |
---|
97 | |
---|
98 | oldname = 'SurfaceFractalModel' |
---|
99 | oldpars = dict(radius='radius', |
---|
100 | surface_dim='surface_dim', |
---|
101 | cutoff_length='co_length') |
---|
102 | |
---|
103 | tests = [ |
---|
104 | # Accuracy tests based on content in test/utest_other_models.py |
---|
105 | [{'radius': 10.0, |
---|
106 | 'surface_dim': 2.0, |
---|
107 | 'cutoff_length': 500.0, |
---|
108 | }, 0.05, 301428.65916], |
---|
109 | |
---|
110 | # Additional tests with larger range of parameters |
---|
111 | [{'radius': 1.0, |
---|
112 | 'surface_dim': 1.0, |
---|
113 | 'cutoff_length': 10.0, |
---|
114 | }, 0.332070182643, 1125.00321004], |
---|
115 | |
---|
116 | [{'radius': 3.5, |
---|
117 | 'surface_dim': 0.1, |
---|
118 | 'cutoff_length': 30.0, |
---|
119 | 'background': 0.01, |
---|
120 | }, 5.0, 0.00999998891322], |
---|
121 | |
---|
122 | [{'radius': 3.0, |
---|
123 | 'surface_dim': 1.0, |
---|
124 | 'cutoff_length': 33.0, |
---|
125 | 'scale': 0.1, |
---|
126 | }, 0.51, 2.50020147004], |
---|
127 | ] |
---|