1 | r""" |
---|
2 | Calculates the scattering from a fractal structure with a primary building |
---|
3 | block of core-shell spheres, as opposed to just homogeneous spheres in |
---|
4 | the fractal model. |
---|
5 | This model could find use for aggregates of coated particles, or aggregates |
---|
6 | of vesicles. |
---|
7 | |
---|
8 | Definition |
---|
9 | ---------- |
---|
10 | |
---|
11 | .. math:: |
---|
12 | |
---|
13 | I(q) = \text{background} + P(q)S(q) |
---|
14 | |
---|
15 | The form factor $P(q)$ is that from core_shell model with $bkg$ = 0 |
---|
16 | |
---|
17 | |
---|
18 | .. math:: |
---|
19 | |
---|
20 | P(q)=\frac{scale}{V_s}\left[3V_c(\rho_c-\rho_s) |
---|
21 | \frac{\sin(qr_c)-qr_c\cos(qr_c)}{(qr_c)^3}+ |
---|
22 | 3V_s(\rho_s-\rho_{solv}) |
---|
23 | \frac{\sin(qr_s)-qr_s\cos(qr_s)}{(qr_s)^3}\right]^2 |
---|
24 | |
---|
25 | |
---|
26 | while the fractal structure factor $S(q)$ is |
---|
27 | |
---|
28 | .. math:: |
---|
29 | |
---|
30 | S(q) = \frac{D_f\Gamma(D_f-1)\sin((D_f-1)\tan^{-1}(q\xi))} |
---|
31 | {(qr_c)^{D_f}\left(1+\frac{1}{q^2\xi ^2} \right)^{\frac{D_f-1}{2}}} |
---|
32 | |
---|
33 | where $D_f$ = frac_dim, |xi| = cor_length, $r_c$ = (core) radius, and |
---|
34 | $scale$ = volume fraction. |
---|
35 | |
---|
36 | The fractal structure is as documented in the fractal model. |
---|
37 | Polydispersity of radius and thickness is provided for. |
---|
38 | |
---|
39 | For 2D data: The 2D scattering intensity is calculated in the same way as 1D, |
---|
40 | where the $q$ vector is defined as |
---|
41 | |
---|
42 | .. math:: |
---|
43 | |
---|
44 | q = \sqrt{q_x^2 + q_y^2} |
---|
45 | |
---|
46 | .. figure:: img/fractal_core_shell_1d.jpg |
---|
47 | |
---|
48 | 1D plot using the default values (w/500 data point). |
---|
49 | |
---|
50 | Reference |
---|
51 | --------- |
---|
52 | |
---|
53 | See the core_shell and fractal model descriptions |
---|
54 | |
---|
55 | """ |
---|
56 | |
---|
57 | from numpy import pi, inf |
---|
58 | |
---|
59 | name = "fractal_core_shell" |
---|
60 | title = "" |
---|
61 | description = """ |
---|
62 | |
---|
63 | """ |
---|
64 | category = "shape-independent" |
---|
65 | |
---|
66 | # pylint: disable=bad-whitespace, line-too-long |
---|
67 | # ["name", "units", default, [lower, upper], "type","description"], |
---|
68 | parameters = [ |
---|
69 | ["radius", "Ang", 60.0, [0, inf], "volume", "Sphere core radius"], |
---|
70 | ["thickness", "Ang", 10.0, [0, inf], "volume", "Sphere shell thickness"], |
---|
71 | ["core_sld", "1e-6/Ang^2", 1.0, [-inf, inf], "", "Sphere core scattering length density"], |
---|
72 | ["shell_sld", "1e-6/Ang^2", 2.0, [-inf, inf], "", "Sphere shell scattering length density"], |
---|
73 | ["solvent_sld", "1e-6/Ang^2", 3.0, [-inf, inf], "", "Solvent scattering length density"], |
---|
74 | ["volfraction", "", 1.0, [0, inf], "", "Volume fraction of building block spheres"], |
---|
75 | ["frac_dim", "", 2.0, [-inf, inf], "", "Fractal dimension"], |
---|
76 | ["cor_length", "Ang", 100.0, [0, inf], "", "Correlation length of fractal-like aggregates"]] |
---|
77 | # pylint: enable=bad-whitespace, line-too-long |
---|
78 | |
---|
79 | source = ["lib/sph_j1c.c", "lib/lanczos_gamma.c", "lib/core_shell.c", "fractal_core_shell.c"] |
---|
80 | |
---|
81 | demo = dict(scale=0.05, |
---|
82 | background=0, |
---|
83 | radius=20, |
---|
84 | thickness=5, |
---|
85 | core_sld=3.5, |
---|
86 | shell_sld=1.0, |
---|
87 | solvent_sld=6.35, |
---|
88 | volfraction=0.05, |
---|
89 | frac_dim=2.0, |
---|
90 | cor_length=100.0) |
---|
91 | |
---|
92 | oldname = 'FractalCoreShellModel' |
---|
93 | oldpars = {} |
---|
94 | |
---|
95 | def ER(radius, thickness): |
---|
96 | """ |
---|
97 | Equivalent radius |
---|
98 | @param radius: core radius |
---|
99 | @param thickness: shell thickness |
---|
100 | """ |
---|
101 | return radius + thickness |
---|
102 | |
---|
103 | def VR(radius, thickness): |
---|
104 | """ |
---|
105 | Volume ratio |
---|
106 | @param radius: core radius |
---|
107 | @param thickness: shell thickness |
---|
108 | """ |
---|
109 | whole = 4.0 * pi / 3.0 * pow((radius + thickness), 3) |
---|
110 | core = 4.0 * pi / 3.0 * radius * radius * radius |
---|
111 | return whole, whole-core |
---|
112 | |
---|
113 | tests = [[{'radius': 20.0, 'thickness': 10.0}, 'ER', 30.0], |
---|
114 | [{'radius': 20.0, 'thickness': 10.0}, 'VR', 0.703703704], |
---|
115 | |
---|
116 | # The SasView test result was 0.00169, with a background of 0.001 |
---|
117 | [{'radius': 60.0, |
---|
118 | 'thickness': 10.0, |
---|
119 | 'core_sld': 1.0, |
---|
120 | 'shell_sld': 2.0, |
---|
121 | 'solvent_sld': 3.0, |
---|
122 | 'background': 0.0 |
---|
123 | }, 0.4, 0.00070126]] |
---|