1 | r""" |
---|
2 | Definition |
---|
3 | ---------- |
---|
4 | Calculates the scattering from a fractal structure with a primary building |
---|
5 | block of core-shell spheres, as opposed to just homogeneous spheres in |
---|
6 | the fractal model. It is an extension of the well known Teixeira\ [#teixeira]_ |
---|
7 | fractal model replacing the $P(q)$ of a solid sphere with that of a core-shell |
---|
8 | sphere. This model could find use for aggregates of coated particles, or |
---|
9 | aggregates of vesicles for example. |
---|
10 | |
---|
11 | .. math:: |
---|
12 | |
---|
13 | I(q) = P(q)S(q) + \text{background} |
---|
14 | |
---|
15 | Where $P(q)$ is the core-shell form factor and $S(q)$ is the |
---|
16 | Teixeira\ [#teixeira]_ fractal structure factor both of which are given again |
---|
17 | below: |
---|
18 | |
---|
19 | .. math:: |
---|
20 | |
---|
21 | P(q) &= \frac{\phi}{V_s}\left[3V_c(\rho_c-\rho_s) |
---|
22 | \frac{\sin(qr_c)-qr_c\cos(qr_c)}{(qr_c)^3}+ |
---|
23 | 3V_s(\rho_s-\rho_{solv}) |
---|
24 | \frac{\sin(qr_s)-qr_s\cos(qr_s)}{(qr_s)^3}\right]^2 |
---|
25 | |
---|
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)]}{(qr_s)^{D_f}} |
---|
28 | |
---|
29 | where $\phi$ is the volume fraction of particles, $V_s$ is the volume of the |
---|
30 | whole particle, $V_c$ is the volume of the core, $\rho_c$, $\rho_s$, and |
---|
31 | $\rho_{solv}$ are the scattering length densities of the core, shell, and |
---|
32 | solvent respectively, $r_c$ and $r_s$ are the radius of the core and the radius |
---|
33 | of the whole particle respectively, $D_f$ is the fractal dimension, and |xi| the |
---|
34 | correlation length. |
---|
35 | |
---|
36 | Polydispersity of radius and thickness are also provided for. |
---|
37 | |
---|
38 | This model does not allow for anisotropy and thus the 2D scattering intensity |
---|
39 | is calculated in the same way as 1D, where the $q$ vector is defined as |
---|
40 | |
---|
41 | .. math:: |
---|
42 | |
---|
43 | q = \sqrt{q_x^2 + q_y^2} |
---|
44 | |
---|
45 | Our model is derived from the form factor calculations implemented in IGOR |
---|
46 | macros by the NIST Center for Neutron Research\ [#Kline]_ |
---|
47 | |
---|
48 | References |
---|
49 | ---------- |
---|
50 | |
---|
51 | .. [#teixeira] J Teixeira, *J. Appl. Cryst.*, 21 (1988) 781-785 |
---|
52 | .. [#Kline] S R Kline, *J Appl. Cryst.*, 39 (2006) 895 |
---|
53 | |
---|
54 | Authorship and Verification |
---|
55 | ---------------------------- |
---|
56 | |
---|
57 | * **Author:** NIST IGOR/DANSE **Date:** pre 2010 |
---|
58 | * **Last Modified by:** Paul Butler and Paul Kienzle **on:** November 27, 2016 |
---|
59 | * **Last Reviewed by:** Paul Butler and Paul Kienzle **on:** November 27, 2016 |
---|
60 | |
---|
61 | """ |
---|
62 | |
---|
63 | from numpy import pi, inf |
---|
64 | |
---|
65 | name = "fractal_core_shell" |
---|
66 | title = "Scattering from a fractal structure formed from core shell spheres" |
---|
67 | description = """\ |
---|
68 | Model for fractal aggregates of core-shell primary particles. It is based on |
---|
69 | the Teixeira model for the S(q) of a fractal * P(q) for a core-shell sphere |
---|
70 | |
---|
71 | radius = the radius of the core |
---|
72 | thickness = thickness of the shell |
---|
73 | thick_layer = thickness of a layer |
---|
74 | sld_core = the SLD of the core |
---|
75 | sld_shell = the SLD of the shell |
---|
76 | sld_solvent = the SLD of the solvent |
---|
77 | volfraction = volume fraction of core-shell particles |
---|
78 | fractal_dim = fractal dimension |
---|
79 | cor_length = correlation length of the fractal like aggretates |
---|
80 | """ |
---|
81 | category = "shape-independent" |
---|
82 | |
---|
83 | # pylint: disable=bad-whitespace, line-too-long |
---|
84 | # ["name", "units", default, [lower, upper], "type","description"], |
---|
85 | parameters = [ |
---|
86 | ["radius", "Ang", 60.0, [0.0, inf], "volume", "Sphere core radius"], |
---|
87 | ["thickness", "Ang", 10.0, [0.0, inf], "volume", "Sphere shell thickness"], |
---|
88 | ["sld_core", "1e-6/Ang^2", 1.0, [-inf, inf], "sld", "Sphere core scattering length density"], |
---|
89 | ["sld_shell", "1e-6/Ang^2", 2.0, [-inf, inf], "sld", "Sphere shell scattering length density"], |
---|
90 | ["sld_solvent", "1e-6/Ang^2", 3.0, [-inf, inf], "sld", "Solvent scattering length density"], |
---|
91 | ["volfraction", "", 1.0, [0.0, inf], "", "Volume fraction of building block spheres"], |
---|
92 | ["fractal_dim", "", 2.0, [0.0, 6.0], "", "Fractal dimension"], |
---|
93 | ["cor_length", "Ang", 100.0, [0.0, inf], "", "Correlation length of fractal-like aggregates"], |
---|
94 | ] |
---|
95 | # pylint: enable=bad-whitespace, line-too-long |
---|
96 | |
---|
97 | source = ["lib/sas_3j1x_x.c", "lib/sas_gamma.c", "lib/core_shell.c", |
---|
98 | "lib/fractal_sq.c", "fractal_core_shell.c"] |
---|
99 | |
---|
100 | demo = dict(scale=0.05, |
---|
101 | background=0, |
---|
102 | radius=20, |
---|
103 | thickness=5, |
---|
104 | sld_core=3.5, |
---|
105 | sld_shell=1.0, |
---|
106 | sld_solvent=6.35, |
---|
107 | volfraction=0.05, |
---|
108 | fractal_dim=2.0, |
---|
109 | cor_length=100.0) |
---|
110 | |
---|
111 | def ER(radius, thickness): |
---|
112 | """ |
---|
113 | Equivalent radius |
---|
114 | @param radius: core radius |
---|
115 | @param thickness: shell thickness |
---|
116 | """ |
---|
117 | return radius + thickness |
---|
118 | |
---|
119 | def VR(radius, thickness): |
---|
120 | """ |
---|
121 | Volume ratio |
---|
122 | @param radius: core radius |
---|
123 | @param thickness: shell thickness |
---|
124 | """ |
---|
125 | whole = 4.0/3.0 * pi * (radius + thickness)**3 |
---|
126 | core = 4.0/3.0 * pi * radius**3 |
---|
127 | return whole, whole-core |
---|
128 | |
---|
129 | tests = [[{'radius': 20.0, 'thickness': 10.0}, 'ER', 30.0], |
---|
130 | [{'radius': 20.0, 'thickness': 10.0}, 'VR', 0.703703704]] |
---|
131 | |
---|
132 | # # The SasView test result was 0.00169, with a background of 0.001 |
---|
133 | # # They are however wrong as we now know. IGOR might be a more |
---|
134 | # # appropriate source. Otherwise will just have to assume this is now |
---|
135 | # # correct and self generate a correct answer for the future. Until we |
---|
136 | # # figure it out leave the tests commented out |
---|
137 | # [{'radius': 60.0, |
---|
138 | # 'thickness': 10.0, |
---|
139 | # 'sld_core': 1.0, |
---|
140 | # 'sld_shell': 2.0, |
---|
141 | # 'sld_solvent': 3.0, |
---|
142 | # 'background': 0.0 |
---|
143 | # }, 0.015211, 692.84]] |
---|