[129bdc4] | 1 | r""" |
---|
| 2 | Definition |
---|
| 3 | ---------- |
---|
| 4 | |
---|
| 5 | This model provides the form factor for an elliptical cylinder with a |
---|
| 6 | core-shell scattering length density profile. Thus this is a variation |
---|
| 7 | of the core-shell bicelle model, but with an elliptical cylinder for the core. |
---|
[110f69c] | 8 | In this version the "rim" or "belt" does NOT extend the full length of |
---|
| 9 | the particle, but has the same length as the core. Outer shells on the |
---|
| 10 | rims and flat ends may be of different thicknesses and scattering length |
---|
| 11 | densities. The form factor is normalized by the total particle volume. |
---|
[129bdc4] | 12 | This version includes an approximate "interfacial roughness". |
---|
| 13 | |
---|
| 14 | |
---|
| 15 | .. figure:: img/core_shell_bicelle_belt_geometry.png |
---|
| 16 | |
---|
[110f69c] | 17 | Schematic cross-section of bicelle with belt. Note however that the model |
---|
| 18 | here calculates for rectangular, not curved, rims as shown below. |
---|
[129bdc4] | 19 | |
---|
| 20 | .. figure:: img/core_shell_bicelle_belt_parameters.png |
---|
| 21 | |
---|
[110f69c] | 22 | Cross section of model used here. Users will have |
---|
| 23 | to decide how to distribute "heads" and "tails" between the rim, face |
---|
[129bdc4] | 24 | and core regions in order to estimate appropriate starting parameters. |
---|
| 25 | |
---|
| 26 | Given the scattering length densities (sld) $\rho_c$, the core sld, $\rho_f$, |
---|
| 27 | the face sld, $\rho_r$, the rim sld and $\rho_s$ the solvent sld, the |
---|
| 28 | scattering length density variation along the bicelle axis is: |
---|
| 29 | |
---|
| 30 | .. math:: |
---|
| 31 | |
---|
[110f69c] | 32 | \rho(r) = |
---|
| 33 | \begin{cases} |
---|
[129bdc4] | 34 | &\rho_c \text{ for } 0 \lt r \lt R; -L/2 \lt z\lt L/2 \\[1.5ex] |
---|
[110f69c] | 35 | &\rho_f \text{ for } 0 \lt r \lt R; -(L/2 +t_\text{face}) \lt z\lt -L/2; |
---|
| 36 | L/2 \lt z\lt (L/2+t_\text{face}) \\[1.5ex] |
---|
| 37 | &\rho_r\text{ for } R \lt r \lt R+t_\text{rim}; -L/2 \lt z\lt L/2 |
---|
[129bdc4] | 38 | \end{cases} |
---|
| 39 | |
---|
| 40 | The form factor for the bicelle is calculated in cylindrical coordinates, where |
---|
[110f69c] | 41 | $\alpha$ is the angle between the $Q$ vector and the cylinder axis, and $\psi$ |
---|
| 42 | is the angle for the ellipsoidal cross section core, to give: |
---|
[129bdc4] | 43 | |
---|
| 44 | .. math:: |
---|
| 45 | |
---|
[110f69c] | 46 | I(Q,\alpha,\psi) = \frac{\text{scale}}{V_t} |
---|
| 47 | \cdot F(Q,\alpha, \psi)^2 \cdot \sin(\alpha) |
---|
| 48 | \cdot\exp\left\{ -\frac{1}{2}Q^2\sigma^2 \right\} + \text{background} |
---|
[129bdc4] | 49 | |
---|
[110f69c] | 50 | where a numerical integration of $F(Q,\alpha, \psi)^2\sin(\alpha)$ is |
---|
| 51 | carried out over $\alpha$ and $\psi$ for: |
---|
[129bdc4] | 52 | |
---|
| 53 | .. math:: |
---|
| 54 | |
---|
[110f69c] | 55 | F(Q,\alpha,\psi) = &\bigg[ |
---|
| 56 | (\rho_c -\rho_r - \rho_f + \rho_s) V_c |
---|
| 57 | \frac{2J_1(QR'\sin \alpha)}{QR'\sin\alpha} |
---|
| 58 | \frac{\sin(QL\cos\alpha/2)}{Q(L/2)\cos\alpha} \\ |
---|
| 59 | &+(\rho_f - \rho_s) V_{c+f} |
---|
| 60 | \frac{2J_1(QR'\sin\alpha)}{QR'\sin\alpha} |
---|
| 61 | \frac{\sin(Q(L/2+t_f)\cos\alpha)}{Q(L/2+t_f)\cos\alpha} \\ |
---|
| 62 | &+(\rho_r - \rho_s) V_{c+r} |
---|
| 63 | \frac{2J_1(Q(R'+t_r)\sin\alpha)}{Q(R'+t_r)\sin\alpha} |
---|
| 64 | \frac{\sin(Q(L/2)\cos\alpha)}{Q(L/2)\cos\alpha} |
---|
[129bdc4] | 65 | \bigg] |
---|
| 66 | |
---|
| 67 | where |
---|
| 68 | |
---|
| 69 | .. math:: |
---|
| 70 | |
---|
[110f69c] | 71 | R' = \frac{R}{\sqrt{2}} |
---|
| 72 | \sqrt{(1+X_\text{core}^{2}) + (1-X_\text{core}^{2})\cos(\psi)} |
---|
| 73 | |
---|
| 74 | |
---|
| 75 | and $V_t = \pi (R+t_r)(X_\text{core} R+t_r) L + 2 \pi X_\text{core} R^2 t_f$ is |
---|
| 76 | the total volume of the bicelle, $V_c = \pi X_\text{core} R^2 L$ the volume of |
---|
| 77 | the core, $V_{c+f} = \pi X_\text{core} R^2 (L+2 t_f)$ the volume of the core |
---|
| 78 | plus the volume of the faces, $V_{c+r} = \pi (R+t_r)(X_\text{core} R+t_r) L$ |
---|
| 79 | the volume of the core plus the rim, $R$ is the radius of the core, |
---|
| 80 | $X_\text{core}$ is the axial ratio of the core, $L$ the length of the core, |
---|
| 81 | $t_f$ the thickness of the face, $t_r$ the thickness of the rim and $J_1$ the |
---|
| 82 | usual first order bessel function. The core has radii $R$ and $X_\text{core} R$ |
---|
| 83 | so is circular, as for the core_shell_bicelle model, for $X_\text{core}=1$. |
---|
| 84 | Note that you may need to limit the range of $X_\text{core}$, especially if |
---|
| 85 | using the Monte-Carlo algorithm, as setting radius to $R/X_\text{core}$ and |
---|
| 86 | axial ratio to $1/X_\text{core}$ gives an equivalent solution! |
---|
| 87 | |
---|
| 88 | An approximation for the effects of "Gaussian interfacial roughness" $\sigma$ |
---|
| 89 | is included, by multiplying $I(Q)$ by |
---|
| 90 | $\exp\left \{ -\frac{1}{2}Q^2\sigma^2 \right \}$. This applies, in some way, to |
---|
| 91 | all interfaces in the model not just the external ones. (Note that for a one |
---|
| 92 | dimensional system convolution of the scattering length density profile with |
---|
| 93 | a Gaussian of standard deviation $\sigma$ does exactly this multiplication.) |
---|
| 94 | Leave $\sigma$ set to zero for the usual sharp interfaces. |
---|
[129bdc4] | 95 | |
---|
| 96 | The output of the 1D scattering intensity function for randomly oriented |
---|
| 97 | bicelles is then given by integrating over all possible $\alpha$ and $\psi$. |
---|
| 98 | |
---|
[110f69c] | 99 | For oriented bicelles the *theta*, *phi* and *psi* orientation parameters |
---|
| 100 | will appear when fitting 2D data, for further details of the calculation |
---|
| 101 | and angular dispersions see :ref:`orientation` . |
---|
[129bdc4] | 102 | |
---|
| 103 | .. figure:: img/elliptical_cylinder_angle_definition.png |
---|
| 104 | |
---|
[110f69c] | 105 | Definition of the angles for the oriented core_shell_bicelle_elliptical |
---|
| 106 | particles. |
---|
[129bdc4] | 107 | |
---|
| 108 | |
---|
| 109 | |
---|
| 110 | References |
---|
| 111 | ---------- |
---|
| 112 | |
---|
| 113 | .. [#] |
---|
| 114 | |
---|
| 115 | Authorship and Verification |
---|
| 116 | ---------------------------- |
---|
| 117 | |
---|
| 118 | * **Author:** Richard Heenan **Date:** October 5, 2017 |
---|
| 119 | * **Last Modified by:** Richard Heenan new 2d orientation **Date:** October 5, 2017 |
---|
| 120 | * **Last Reviewed by:** Richard Heenan 2d calc seems agree with 1d **Date:** Nov 2, 2017 |
---|
| 121 | """ |
---|
| 122 | |
---|
| 123 | from numpy import inf, sin, cos, pi |
---|
| 124 | |
---|
| 125 | name = "core_shell_bicelle_elliptical_belt_rough" |
---|
| 126 | title = "Elliptical cylinder with a core-shell scattering length density profile.." |
---|
| 127 | description = """ |
---|
| 128 | core_shell_bicelle_elliptical_belt_rough |
---|
[110f69c] | 129 | Elliptical cylinder core, optional shell on the two flat faces, and "belt" shell of |
---|
[129bdc4] | 130 | uniform thickness on its rim (in this case NOT extending around the end faces). |
---|
| 131 | with approximate interfacial roughness. |
---|
| 132 | Please see full documentation for equations and further details. |
---|
| 133 | Involves a double numerical integral around the ellipsoid diameter |
---|
| 134 | and the angle of the cylinder axis to Q. |
---|
| 135 | Compare also the core_shell_bicelle and elliptical_cylinder models. |
---|
| 136 | """ |
---|
| 137 | category = "shape:cylinder" |
---|
| 138 | |
---|
| 139 | # pylint: disable=bad-whitespace, line-too-long |
---|
| 140 | # ["name", "units", default, [lower, upper], "type", "description"], |
---|
| 141 | parameters = [ |
---|
[fc3ae1b] | 142 | ["radius", "Ang", 30, [0, inf], "volume", "Cylinder core radius r_minor"], |
---|
| 143 | ["x_core", "None", 3, [0, inf], "volume", "Axial ratio of core, X = r_major/r_minor"], |
---|
[129bdc4] | 144 | ["thick_rim", "Ang", 8, [0, inf], "volume", "Rim or belt shell thickness"], |
---|
| 145 | ["thick_face", "Ang", 14, [0, inf], "volume", "Cylinder face thickness"], |
---|
| 146 | ["length", "Ang", 50, [0, inf], "volume", "Cylinder length"], |
---|
| 147 | ["sld_core", "1e-6/Ang^2", 4, [-inf, inf], "sld", "Cylinder core scattering length density"], |
---|
| 148 | ["sld_face", "1e-6/Ang^2", 7, [-inf, inf], "sld", "Cylinder face scattering length density"], |
---|
| 149 | ["sld_rim", "1e-6/Ang^2", 1, [-inf, inf], "sld", "Cylinder rim scattering length density"], |
---|
| 150 | ["sld_solvent", "1e-6/Ang^2", 6, [-inf, inf], "sld", "Solvent scattering length density"], |
---|
[fc3ae1b] | 151 | ["sigma", "Ang", 0, [0, inf], "", "Interfacial roughness"], |
---|
| 152 | ["theta", "degrees", 90.0, [-360, 360], "orientation", "Cylinder axis to beam angle"], |
---|
| 153 | ["phi", "degrees", 0, [-360, 360], "orientation", "Rotation about beam"], |
---|
| 154 | ["psi", "degrees", 0, [-360, 360], "orientation", "Rotation about cylinder axis"], |
---|
[129bdc4] | 155 | ] |
---|
| 156 | |
---|
| 157 | # pylint: enable=bad-whitespace, line-too-long |
---|
| 158 | |
---|
| 159 | source = ["lib/sas_Si.c", "lib/polevl.c", "lib/sas_J1.c", "lib/gauss76.c", |
---|
| 160 | "core_shell_bicelle_elliptical_belt_rough.c"] |
---|
[71b751d] | 161 | have_Fq = True |
---|
[129bdc4] | 162 | |
---|
| 163 | demo = dict(scale=1, background=0, |
---|
| 164 | radius=30.0, |
---|
| 165 | x_core=3.0, |
---|
| 166 | thick_rim=8.0, |
---|
| 167 | thick_face=14.0, |
---|
| 168 | length=50.0, |
---|
| 169 | sld_core=4.0, |
---|
| 170 | sld_face=7.0, |
---|
| 171 | sld_rim=1.0, |
---|
| 172 | sld_solvent=6.0, |
---|
| 173 | theta=90, |
---|
| 174 | phi=0, |
---|
| 175 | psi=0, |
---|
| 176 | sigma=0) |
---|
| 177 | |
---|
| 178 | q = 0.1 |
---|
| 179 | # april 6 2017, rkh added a 2d unit test, NOT READY YET pull #890 branch assume correct! |
---|
| 180 | qx = q*cos(pi/6.0) |
---|
| 181 | qy = q*sin(pi/6.0) |
---|
| 182 | |
---|
| 183 | tests = [ |
---|
| 184 | [{'radius': 30.0, 'x_core': 3.0, 'thick_rim':8.0, 'thick_face':14.0, 'length':50.0}, 'ER', 1], |
---|
| 185 | [{'radius': 30.0, 'x_core': 3.0, 'thick_rim':8.0, 'thick_face':14.0, 'length':50.0}, 'VR', 1], |
---|
| 186 | |
---|
| 187 | [{'radius': 30.0, 'x_core': 3.0, 'thick_rim':8.0, 'thick_face':14.0, 'length':50.0, |
---|
[110f69c] | 188 | 'sld_core':4.0, 'sld_face':7.0, 'sld_rim':1.0, 'sld_solvent':6.0, 'background':0.0}, |
---|
| 189 | 0.015, 189.328], |
---|
| 190 | #[{'theta':80., 'phi':10.}, (qx, qy), 7.88866563001 ], |
---|
| 191 | ] |
---|
[129bdc4] | 192 | |
---|
| 193 | del qx, qy # not necessary to delete, but cleaner |
---|