[8007311] | 1 | r""" |
---|
| 2 | |
---|
| 3 | Definition |
---|
| 4 | ---------- |
---|
| 5 | This model provides the form factor for a circular cylinder with a core-shell |
---|
| 6 | scattering length density profile. |
---|
| 7 | The form factor is normalized by the particle volume. |
---|
| 8 | |
---|
| 9 | .. _core-shell-cylinder-geometry: |
---|
| 10 | |
---|
| 11 | .. figure:: img/core_shell_bicelle_geometry.png |
---|
| 12 | |
---|
| 13 | (Graphic from DOI: 10.1039/C0NP00002G) |
---|
| 14 | |
---|
| 15 | |
---|
| 16 | The output of the 1D scattering intensity function for randomly oriented |
---|
| 17 | cylinders is then given by the equation above. |
---|
| 18 | |
---|
| 19 | The *theta* and *phi* parameters are not used for the 1D output. |
---|
| 20 | Our implementation of the scattering kernel and the 1D scattering intensity |
---|
| 21 | use the c-library from NIST. |
---|
| 22 | |
---|
| 23 | .. figure:: img/core_shell_bicelle_1d.jpg |
---|
| 24 | |
---|
| 25 | 1D plot using the default values (w/200 data point). |
---|
| 26 | |
---|
| 27 | .. figure:: img/core_shell_bicelle_fig1.jpg |
---|
| 28 | |
---|
| 29 | Definition of the angles for the oriented CoreShellBicelleModel. |
---|
| 30 | |
---|
| 31 | .. figure:: img/core_shell_bicelle_fig2.jpg |
---|
| 32 | |
---|
| 33 | Examples of the angles for oriented pp against the detector plane. |
---|
| 34 | |
---|
| 35 | References |
---|
| 36 | ---------- |
---|
| 37 | |
---|
| 38 | L A Feigin and D I Svergun, |
---|
| 39 | *Structure Analysis by Small-Angle X-Ray and Neutron Scattering,* |
---|
| 40 | Plenum Press, New York, (1987) |
---|
| 41 | |
---|
| 42 | """ |
---|
| 43 | |
---|
| 44 | from numpy import inf, sin, cos |
---|
| 45 | |
---|
| 46 | name = "core_shell_bicelle" |
---|
| 47 | title = "Circular cylinder with a core-shell scattering length density profile.." |
---|
| 48 | description = """ |
---|
| 49 | P(q,alpha)= scale/Vs*f(q)^(2) + bkg, where: f(q)= 2(core_sld |
---|
| 50 | - solvant_sld)* Vc*sin[qLcos(alpha/2)] |
---|
| 51 | /[qLcos(alpha/2)]*J1(qRsin(alpha)) |
---|
| 52 | /[qRsin(alpha)]+2(shell_sld-solvent_sld) |
---|
| 53 | *Vs*sin[q(L+T)cos(alpha/2)][[q(L+T) |
---|
| 54 | *cos(alpha/2)]*J1(q(R+T)sin(alpha)) |
---|
| 55 | /q(R+T)sin(alpha)] |
---|
| 56 | |
---|
| 57 | alpha:is the angle between the axis of |
---|
| 58 | the cylinder and the q-vector |
---|
| 59 | Vs: the volume of the outer shell |
---|
| 60 | Vc: the volume of the core |
---|
| 61 | L: the length of the core |
---|
| 62 | shell_sld: the scattering length density |
---|
| 63 | of the shell |
---|
| 64 | solvent_sld: the scattering length density |
---|
| 65 | of the solvent |
---|
| 66 | bkg: the background |
---|
| 67 | T: the thickness |
---|
| 68 | R+T: is the outer radius |
---|
| 69 | L+2T: The total length of the outershell |
---|
| 70 | J1: the first order Bessel function |
---|
| 71 | theta: axis_theta of the cylinder |
---|
| 72 | phi: the axis_phi of the cylinder... |
---|
| 73 | """ |
---|
| 74 | category = "shape:cylinder" |
---|
| 75 | |
---|
| 76 | # pylint: disable=bad-whitespace, line-too-long |
---|
| 77 | # ["name", "units", default, [lower, upper], "type", "description"], |
---|
| 78 | parameters = [ |
---|
| 79 | ["radius", "Ang", 20, [0, inf], "volume", "Cylinder core radius"], |
---|
| 80 | ["rim_thickness", "Ang", 10, [0, inf], "volume", "Rim shell thickness"], |
---|
| 81 | ["face_thickness", "Ang", 10, [0, inf], "volume", "Cylinder face thickness"], |
---|
| 82 | ["length", "Ang", 400, [0, inf], "volume", "Cylinder length"], |
---|
| 83 | ["core_sld", "1e-6/Ang^2", 1, [-inf, inf], "", "Cylinder core scattering length density"], |
---|
| 84 | ["face_sld", "1e-6/Ang^2", 4, [-inf, inf], "", "Cylinder face scattering length density"], |
---|
| 85 | ["rim_sld", "1e-6/Ang^2", 4, [-inf, inf], "", "Cylinder rim scattering length density"], |
---|
| 86 | ["solvent_sld", "1e-6/Ang^2", 1, [-inf, inf], "", "Solvent scattering length density"], |
---|
| 87 | ["theta", "degrees", 90, [-inf, inf], "orientation", "In plane angle"], |
---|
| 88 | ["phi", "degrees", 0, [-inf, inf], "orientation", "Out of plane angle"], |
---|
| 89 | ] |
---|
| 90 | |
---|
| 91 | # pylint: enable=bad-whitespace, line-too-long |
---|
| 92 | |
---|
| 93 | source = ["lib/J1.c", "lib/gauss76.c", "core_shell_bicelle.c"] |
---|
| 94 | |
---|
| 95 | demo = dict(scale=1, background=0, |
---|
| 96 | radius=20.0, |
---|
| 97 | rim_thickness=10.0, |
---|
| 98 | face_thickness=10.0, |
---|
| 99 | length=400.0, |
---|
| 100 | core_sld=1.0, |
---|
| 101 | face_sld=4.0, |
---|
| 102 | rim_sld=4.0, |
---|
| 103 | solvent_sld=1.0, |
---|
| 104 | theta=90, |
---|
| 105 | phi=0) |
---|
| 106 | |
---|
| 107 | oldname = 'CoreShellBicelleModel' |
---|
| 108 | |
---|
| 109 | oldpars = dict(rim_thickness='rim_thick', |
---|
| 110 | face_thickness='face_thick', |
---|
| 111 | theta='axis_theta', |
---|
| 112 | phi='axis_phi') |
---|
| 113 | |
---|
| 114 | qx, qy = 0.4 * cos(90), 0.5 * sin(0) |
---|
| 115 | tests = [ |
---|
| 116 | # Accuracy tests based on content in test/utest_other_models.py |
---|
| 117 | [{'radius': 20.0, |
---|
| 118 | 'rim_thickness': 10.0, |
---|
| 119 | 'face_thickness': 10.0, |
---|
| 120 | 'length': 400.0, |
---|
| 121 | 'core_sld': 1.0, |
---|
| 122 | 'face_sld': 4.0, |
---|
| 123 | 'rim_sld': 4.0, |
---|
| 124 | 'solvent_sld': 1.0, |
---|
| 125 | 'background': 0.0, |
---|
| 126 | }, 0.001, 353.550], |
---|
| 127 | |
---|
| 128 | [{'radius': 20.0, |
---|
| 129 | 'rim_thickness': 10.0, |
---|
| 130 | 'face_thickness': 10.0, |
---|
| 131 | 'length': 400.0, |
---|
| 132 | 'core_sld': 1.0, |
---|
| 133 | 'face_sld': 4.0, |
---|
| 134 | 'rim_sld': 4.0, |
---|
| 135 | 'solvent_sld': 1.0, |
---|
| 136 | 'theta': 90.0, |
---|
| 137 | 'phi': 0.0, |
---|
| 138 | 'background': 0.00, |
---|
| 139 | }, (qx, qy), 24.9167], |
---|
| 140 | |
---|
| 141 | # Additional tests with larger range of parameters |
---|
| 142 | [{'radius': 3.0, |
---|
| 143 | 'rim_thickness': 100.0, |
---|
| 144 | 'face_thickness': 100.0, |
---|
| 145 | 'length': 1200.0, |
---|
| 146 | 'core_sld': 5.0, |
---|
| 147 | 'face_sld': 41.0, |
---|
| 148 | 'rim_sld': 42.0, |
---|
| 149 | 'solvent_sld': 21.0, |
---|
| 150 | }, 0.05, 1670.1828], |
---|
| 151 | ] |
---|