[7d4b2ae] | 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 | |
---|
[aad336c] | 46 | References |
---|
| 47 | ---------- |
---|
[7d4b2ae] | 48 | |
---|
| 49 | See the core_shell and fractal model descriptions |
---|
| 50 | |
---|
| 51 | """ |
---|
| 52 | |
---|
| 53 | from numpy import pi, inf |
---|
| 54 | |
---|
| 55 | name = "fractal_core_shell" |
---|
| 56 | title = "" |
---|
| 57 | description = """ |
---|
| 58 | |
---|
| 59 | """ |
---|
| 60 | category = "shape-independent" |
---|
| 61 | |
---|
| 62 | # pylint: disable=bad-whitespace, line-too-long |
---|
| 63 | # ["name", "units", default, [lower, upper], "type","description"], |
---|
| 64 | parameters = [ |
---|
| 65 | ["radius", "Ang", 60.0, [0, inf], "volume", "Sphere core radius"], |
---|
| 66 | ["thickness", "Ang", 10.0, [0, inf], "volume", "Sphere shell thickness"], |
---|
[42356c8] | 67 | ["sld_core", "1e-6/Ang^2", 1.0, [-inf, inf], "sld", "Sphere core scattering length density"], |
---|
| 68 | ["sld_shell", "1e-6/Ang^2", 2.0, [-inf, inf], "sld", "Sphere shell scattering length density"], |
---|
| 69 | ["sld_solvent", "1e-6/Ang^2", 3.0, [-inf, inf], "sld", "Solvent scattering length density"], |
---|
[7d4b2ae] | 70 | ["volfraction", "", 1.0, [0, inf], "", "Volume fraction of building block spheres"], |
---|
| 71 | ["frac_dim", "", 2.0, [-inf, inf], "", "Fractal dimension"], |
---|
| 72 | ["cor_length", "Ang", 100.0, [0, inf], "", "Correlation length of fractal-like aggregates"]] |
---|
| 73 | # pylint: enable=bad-whitespace, line-too-long |
---|
| 74 | |
---|
[6794301] | 75 | source = ["lib/sph_j1c.c", "lib/sas_gamma.c", "lib/core_shell.c", "fractal_core_shell.c"] |
---|
[7d4b2ae] | 76 | |
---|
| 77 | demo = dict(scale=0.05, |
---|
| 78 | background=0, |
---|
| 79 | radius=20, |
---|
| 80 | thickness=5, |
---|
[aad336c] | 81 | sld_core=3.5, |
---|
| 82 | sld_shell=1.0, |
---|
| 83 | sld_solvent=6.35, |
---|
[7d4b2ae] | 84 | volfraction=0.05, |
---|
| 85 | frac_dim=2.0, |
---|
| 86 | cor_length=100.0) |
---|
| 87 | |
---|
| 88 | def ER(radius, thickness): |
---|
| 89 | """ |
---|
| 90 | Equivalent radius |
---|
| 91 | @param radius: core radius |
---|
| 92 | @param thickness: shell thickness |
---|
| 93 | """ |
---|
| 94 | return radius + thickness |
---|
| 95 | |
---|
| 96 | def VR(radius, thickness): |
---|
| 97 | """ |
---|
| 98 | Volume ratio |
---|
| 99 | @param radius: core radius |
---|
| 100 | @param thickness: shell thickness |
---|
| 101 | """ |
---|
| 102 | whole = 4.0 * pi / 3.0 * pow((radius + thickness), 3) |
---|
| 103 | core = 4.0 * pi / 3.0 * radius * radius * radius |
---|
| 104 | return whole, whole-core |
---|
| 105 | |
---|
| 106 | tests = [[{'radius': 20.0, 'thickness': 10.0}, 'ER', 30.0], |
---|
| 107 | [{'radius': 20.0, 'thickness': 10.0}, 'VR', 0.703703704], |
---|
| 108 | |
---|
| 109 | # The SasView test result was 0.00169, with a background of 0.001 |
---|
| 110 | [{'radius': 60.0, |
---|
| 111 | 'thickness': 10.0, |
---|
[aad336c] | 112 | 'sld_core': 1.0, |
---|
| 113 | 'sld_shell': 2.0, |
---|
| 114 | 'sld_solvent': 3.0, |
---|
[7d4b2ae] | 115 | 'background': 0.0 |
---|
| 116 | }, 0.4, 0.00070126]] |
---|