[5d4777d] | 1 | # core shell cylinder model |
---|
| 2 | # Note: model title and parameter table are inserted automatically |
---|
| 3 | r""" |
---|
| 4 | The form factor is normalized by the particle volume. |
---|
| 5 | |
---|
| 6 | Definition |
---|
| 7 | ---------- |
---|
| 8 | |
---|
| 9 | The output of the 2D scattering intensity function for oriented core-shell |
---|
| 10 | cylinders is given by (Kline, 2006) |
---|
| 11 | |
---|
| 12 | .. math:: |
---|
| 13 | |
---|
[01eece6] | 14 | I(q,\alpha) = \frac{\text{scale}}{V_s} F^2(q) + \text{background} |
---|
[5d4777d] | 15 | |
---|
| 16 | where |
---|
| 17 | |
---|
| 18 | .. math:: |
---|
| 19 | |
---|
[eb69cce] | 20 | F(q) = &\ (\rho_c - \rho_s) V_c |
---|
| 21 | \frac{\sin \left( q \tfrac12 L\cos\alpha \right)} |
---|
| 22 | {q \tfrac12 L\cos\alpha} |
---|
| 23 | \frac{2 J_1 \left( qR\sin\alpha \right)} |
---|
| 24 | {qR\sin\alpha} \\ |
---|
[19dcb933] | 25 | &\ + (\rho_s - \rho_\text{solv}) V_s |
---|
[eb69cce] | 26 | \frac{\sin \left( q \left(\tfrac12 L+T\right) \cos\alpha \right)} |
---|
| 27 | {q \left(\tfrac12 L +T \right) \cos\alpha} |
---|
| 28 | \frac{ 2 J_1 \left( q(R+T)\sin\alpha \right)} |
---|
| 29 | {q(R+T)\sin\alpha} |
---|
[5d4777d] | 30 | |
---|
| 31 | and |
---|
| 32 | |
---|
| 33 | .. math:: |
---|
| 34 | |
---|
[19dcb933] | 35 | V_s = \pi (R + T)^2 (L + 2T) |
---|
[5d4777d] | 36 | |
---|
| 37 | and $\alpha$ is the angle between the axis of the cylinder and $\vec q$, |
---|
| 38 | $V_s$ is the volume of the outer shell (i.e. the total volume, including |
---|
| 39 | the shell), $V_c$ is the volume of the core, $L$ is the length of the core, |
---|
| 40 | $R$ is the radius of the core, $T$ is the thickness of the shell, $\rho_c$ |
---|
| 41 | is the scattering length density of the core, $\rho_s$ is the scattering |
---|
| 42 | length density of the shell, $\rho_\text{solv}$ is the scattering length |
---|
| 43 | density of the solvent, and *background* is the background level. The outer |
---|
| 44 | radius of the shell is given by $R+T$ and the total length of the outer |
---|
| 45 | shell is given by $L+2T$. $J1$ is the first order Bessel function. |
---|
| 46 | |
---|
[19dcb933] | 47 | .. _core-shell-cylinder-geometry: |
---|
| 48 | |
---|
| 49 | .. figure:: img/core_shell_cylinder_geometry.jpg |
---|
[5d4777d] | 50 | |
---|
| 51 | Core shell cylinder schematic. |
---|
| 52 | |
---|
| 53 | To provide easy access to the orientation of the core-shell cylinder, we |
---|
[01eece6] | 54 | define the axis of the cylinder using two angles $\theta$ and $\phi$. |
---|
| 55 | (see :ref:`cylinder model <cylinder-angle-definition>`) |
---|
[5d4777d] | 56 | |
---|
| 57 | NB: The 2nd virial coefficient of the cylinder is calculated based on |
---|
| 58 | the radius and 2 length values, and used as the effective radius for |
---|
[eb69cce] | 59 | $S(q)$ when $P(q) \cdot S(q)$ is applied. |
---|
[5d4777d] | 60 | |
---|
[eb69cce] | 61 | The $\theta$ and $\phi$ parameters are not used for the 1D output. |
---|
[5d4777d] | 62 | |
---|
| 63 | Validation |
---|
| 64 | ---------- |
---|
| 65 | |
---|
| 66 | Validation of our code was done by comparing the output of the 1D model to |
---|
| 67 | the output of the software provided by the NIST (Kline, 2006). |
---|
| 68 | |
---|
| 69 | Averaging over a distribution of orientation is done by evaluating the |
---|
| 70 | equation above. Since we have no other software to compare the |
---|
[2f0c07d] | 71 | implementation of the intensity for fully oriented cylinders, we |
---|
| 72 | compared the result of averaging our 2D output using a uniform |
---|
[19dcb933] | 73 | distribution $p(\theta,\phi) = 1.0$. |
---|
[5d4777d] | 74 | |
---|
[01eece6] | 75 | Reference |
---|
| 76 | --------- |
---|
| 77 | see, for example, Ian Livsey J. Chem. Soc., Faraday Trans. 2, 1987,83, 1445-1452 |
---|
| 78 | |
---|
| 79 | 2016/03/18 - Description reviewed by RKH |
---|
[5d4777d] | 80 | """ |
---|
| 81 | |
---|
| 82 | from numpy import pi, inf |
---|
| 83 | |
---|
[19dcb933] | 84 | name = "core_shell_cylinder" |
---|
[5d4777d] | 85 | title = "Right circular cylinder with a core-shell scattering length density profile." |
---|
| 86 | description = """ |
---|
| 87 | P(q,alpha)= scale/Vs*f(q)^(2) + background, |
---|
[01eece6] | 88 | where: f(q)= 2(sld_core - solvant_sld) |
---|
[485aee2] | 89 | * Vc*sin[qLcos(alpha/2)] |
---|
| 90 | /[qLcos(alpha/2)]*J1(qRsin(alpha)) |
---|
[01eece6] | 91 | /[qRsin(alpha)]+2(sld_shell-sld_solvent) |
---|
[485aee2] | 92 | *Vs*sin[q(L+T)cos(alpha/2)][[q(L+T) |
---|
| 93 | *cos(alpha/2)]*J1(q(R+T)sin(alpha)) |
---|
| 94 | /q(R+T)sin(alpha)] |
---|
| 95 | |
---|
| 96 | alpha:is the angle between the axis of |
---|
| 97 | the cylinder and the q-vector |
---|
| 98 | Vs: the volume of the outer shell |
---|
| 99 | Vc: the volume of the core |
---|
| 100 | L: the length of the core |
---|
[01eece6] | 101 | sld_shell: the scattering length density of the shell |
---|
| 102 | sld_solvent: the scattering length density of the solvent |
---|
[485aee2] | 103 | background: the background |
---|
| 104 | T: the thickness |
---|
| 105 | R+T: is the outer radius |
---|
| 106 | L+2T: The total length of the outershell |
---|
| 107 | J1: the first order Bessel function |
---|
| 108 | theta: axis_theta of the cylinder |
---|
| 109 | phi: the axis_phi of the cylinder |
---|
[5d4777d] | 110 | """ |
---|
[a5d0d00] | 111 | category = "shape:cylinder" |
---|
[5d4777d] | 112 | |
---|
[485aee2] | 113 | # ["name", "units", default, [lower, upper], "type", "description"], |
---|
[42356c8] | 114 | parameters = [["sld_core", "1e-6/Ang^2", 4, [-inf, inf], "sld", |
---|
[485aee2] | 115 | "Cylinder core scattering length density"], |
---|
[42356c8] | 116 | ["sld_shell", "1e-6/Ang^2", 4, [-inf, inf], "sld", |
---|
[485aee2] | 117 | "Cylinder shell scattering length density"], |
---|
[42356c8] | 118 | ["sld_solvent", "1e-6/Ang^2", 1, [-inf, inf], "sld", |
---|
[485aee2] | 119 | "Solvent scattering length density"], |
---|
| 120 | ["radius", "Ang", 20, [0, inf], "volume", |
---|
| 121 | "Cylinder core radius"], |
---|
| 122 | ["thickness", "Ang", 20, [0, inf], "volume", |
---|
| 123 | "Cylinder shell thickness"], |
---|
| 124 | ["length", "Ang", 400, [0, inf], "volume", |
---|
| 125 | "Cylinder length"], |
---|
| 126 | ["theta", "degrees", 60, [-inf, inf], "orientation", |
---|
| 127 | "In plane angle"], |
---|
| 128 | ["phi", "degrees", 60, [-inf, inf], "orientation", |
---|
| 129 | "Out of plane angle"], |
---|
| 130 | ] |
---|
| 131 | |
---|
[43b7eea] | 132 | source = ["lib/polevl.c","lib/sas_J1.c", "lib/gauss76.c", "core_shell_cylinder.c"] |
---|
[5d4777d] | 133 | |
---|
| 134 | def ER(radius, thickness, length): |
---|
[f0aa7f8] | 135 | """ |
---|
| 136 | Returns the effective radius used in the S*P calculation |
---|
| 137 | """ |
---|
[5d4777d] | 138 | radius = radius + thickness |
---|
[485aee2] | 139 | length = length + 2 * thickness |
---|
| 140 | ddd = 0.75 * radius * (2 * radius * length + (length + radius) * (length + pi * radius)) |
---|
| 141 | return 0.5 * (ddd) ** (1. / 3.) |
---|
[5d4777d] | 142 | |
---|
| 143 | def VR(radius, thickness, length): |
---|
[f0aa7f8] | 144 | """ |
---|
| 145 | Returns volume ratio |
---|
| 146 | """ |
---|
[485aee2] | 147 | whole = pi * (radius + thickness) ** 2 * (length + 2 * thickness) |
---|
| 148 | core = pi * radius ** 2 * length |
---|
| 149 | return whole, whole - core |
---|
| 150 | |
---|
| 151 | demo = dict(scale=1, background=0, |
---|
[01eece6] | 152 | sld_core=6, sld_shell=8, sld_solvent=1, |
---|
[485aee2] | 153 | radius=45, thickness=25, length=340, |
---|
| 154 | theta=30, phi=15, |
---|
| 155 | radius_pd=.2, radius_pd_n=1, |
---|
| 156 | length_pd=.2, length_pd_n=10, |
---|
| 157 | thickness_pd=.2, thickness_pd_n=10, |
---|
| 158 | theta_pd=15, theta_pd_n=45, |
---|
| 159 | phi_pd=15, phi_pd_n=1) |
---|
[01eece6] | 160 | # ADDED by: RKH ON: 18Mar2016 renamed sld's etc |
---|