[edc9f8d] | 1 | r""" |
---|
| 2 | This model provides the form factor, $P(q)$, for a spherical particle with a core-shell structure. |
---|
| 3 | The form factor is normalized by the particle volume. |
---|
| 4 | |
---|
| 5 | Definition |
---|
| 6 | ---------- |
---|
| 7 | |
---|
| 8 | The 1D scattering intensity is calculated in the following way (Guinier, 1955) |
---|
| 9 | |
---|
| 10 | .. math:: |
---|
| 11 | |
---|
| 12 | P(q) = \frac{\text{scale}}{V} F^2(q) + \text{background} |
---|
| 13 | |
---|
| 14 | where |
---|
| 15 | |
---|
| 16 | .. math:: |
---|
[fa8011eb] | 17 | |
---|
[edc9f8d] | 18 | F^2(q)=\frac{3}{V_s}\left[V_c(\rho_c-\rho_s)\frac{\sin(qr_c)-qr_c\cos(qr_c)}{(qr_c)^3}+ |
---|
| 19 | V_s(\rho_s-\rho_{solv})\frac{\sin(qr_s)-qr_s\cos(qr_s)}{(qr_s)^3}\right] |
---|
[8c9dbc9] | 20 | |
---|
[edc9f8d] | 21 | where $V_s$ is the volume of the outer shell, $V_c$ is |
---|
| 22 | the volume of the core, $r_s$ is the radius of the shell, $r_c$ is the radius of the |
---|
| 23 | core, $\rho_c$ is the scattering length density of the core, $\rho_s$ is the scattering length |
---|
| 24 | density of the shell, $\rho_{solv}$ is the scattering length density of the solvent. |
---|
| 25 | |
---|
| 26 | The 2D scattering intensity is the same as $P(q)$ above, regardless of the |
---|
| 27 | orientation of the $q$ vector. |
---|
| 28 | |
---|
| 29 | NB: The outer most radius (ie, = radius + thickness) is used as the |
---|
| 30 | effective radius for $S(Q)$ when $P(Q) \cdot S(Q)$ is applied. |
---|
| 31 | |
---|
| 32 | Reference |
---|
| 33 | --------- |
---|
| 34 | |
---|
| 35 | A Guinier and G Fournet, *Small-Angle Scattering of X-Rays*, John Wiley and Sons, New York, (1955) |
---|
| 36 | |
---|
| 37 | Validation |
---|
| 38 | ---------- |
---|
| 39 | |
---|
| 40 | Validation of our code was done by comparing the output of the 1D model to the output of |
---|
| 41 | the software provided by NIST (Kline, 2006). Figure 1 shows a comparison of the output of |
---|
| 42 | our model and the output of the NIST software. |
---|
| 43 | |
---|
[fa8011eb] | 44 | .. figure:: img/core_shell_sphere_1d.jpg |
---|
[edc9f8d] | 45 | |
---|
[fa8011eb] | 46 | Comparison of the SasView scattering intensity for a core-shell sphere with |
---|
[edc9f8d] | 47 | the output of the NIST SANS analysis software. The parameters were set to: |
---|
| 48 | *scale* = 1.0, *radius* = 60 , *contrast* = 1e-6 |Ang^-2|, and |
---|
| 49 | *background* = 0.001 |cm^-1|. |
---|
| 50 | """ |
---|
| 51 | |
---|
| 52 | from numpy import pi, inf |
---|
| 53 | |
---|
| 54 | name = "core_shell_sphere" |
---|
| 55 | title = "Form factor for a monodisperse spherical particle with particle with a core-shell structure." |
---|
| 56 | description = """ |
---|
| 57 | F^2(q) = 3/V_s [V_c (core_sld-shell_sld) (sin(q*radius)-q*radius*cos(q*radius))/(q*radius)^3 |
---|
| 58 | + V_s (shell_sld-solvent_sld) (sin(q*r_s)-q*r_s*cos(q*r_s))/(q*r_s)^3] |
---|
| 59 | |
---|
| 60 | V_s: Volume of the sphere shell |
---|
| 61 | V_c: Volume of the sphere core |
---|
| 62 | r_s: Shell radius = radius + thickness |
---|
| 63 | """ |
---|
| 64 | category = "shape:sphere" |
---|
| 65 | |
---|
| 66 | # pylint: disable=bad-whitespace, line-too-long |
---|
| 67 | # ["name", "units", default, [lower, upper], "type","description"], |
---|
| 68 | parameters = [["radius", "Ang", 60.0, [0, inf], "volume", "Sphere core radius"], |
---|
| 69 | ["thickness", "Ang", 10.0, [0, inf], "volume", "Sphere shell thickness"], |
---|
| 70 | ["core_sld", "1e-6/Ang^2", 1.0, [-inf, inf], "", "Sphere core scattering length density"], |
---|
| 71 | ["shell_sld", "1e-6/Ang^2", 2.0, [-inf, inf], "", "Sphere shell scattering length density"], |
---|
| 72 | ["solvent_sld", "1e-6/Ang^2", 3.0, [-inf, inf], "", "Solvent scattering length density"]] |
---|
| 73 | # pylint: enable=bad-whitespace, line-too-long |
---|
| 74 | |
---|
[7d4b2ae] | 75 | source = ["lib/sph_j1c.c", "lib/core_shell.c", "core_shell_sphere.c"] |
---|
[edc9f8d] | 76 | |
---|
| 77 | demo = dict(scale=1, background=0, radius=60, thickness=10, |
---|
| 78 | core_sld=1.0, shell_sld=2.0, solvent_sld=0.0) |
---|
| 79 | |
---|
| 80 | oldname = 'CoreShellModel' |
---|
| 81 | oldpars = {} |
---|
| 82 | |
---|
| 83 | def ER(radius, thickness): |
---|
| 84 | """ |
---|
| 85 | Equivalent radius |
---|
| 86 | @param radius: core radius |
---|
| 87 | @param thickness: shell thickness |
---|
| 88 | """ |
---|
| 89 | return radius + thickness |
---|
| 90 | |
---|
| 91 | def VR(radius, thickness): |
---|
| 92 | """ |
---|
| 93 | Volume ratio |
---|
| 94 | @param radius: core radius |
---|
| 95 | @param thickness: shell thickness |
---|
| 96 | """ |
---|
| 97 | whole = 4.0 * pi / 3.0 * pow((radius + thickness), 3) |
---|
| 98 | core = 4.0 * pi / 3.0 * radius * radius * radius |
---|
| 99 | return whole, whole - core |
---|
| 100 | |
---|
[8c9dbc9] | 101 | tests = [[{'radius': 20.0, 'thickness': 10.0}, 'ER', 30.0], |
---|
| 102 | [{'radius': 20.0, 'thickness': 10.0}, 'VR', 0.703703704], |
---|
[edc9f8d] | 103 | |
---|
| 104 | # The SasView test result was 0.00169, with a background of 0.001 |
---|
| 105 | [{'radius': 60.0, |
---|
| 106 | 'thickness': 10.0, |
---|
| 107 | 'core_sld': 1.0, |
---|
| 108 | 'shell_sld':2.0, |
---|
| 109 | 'solvent_sld':3.0, |
---|
| 110 | 'background':0.0 |
---|
[8c9dbc9] | 111 | }, 0.4, 0.000698838]] |
---|