Changes in sasmodels/models/core_shell_parallelepiped.py [393facf:1f159bd] in sasmodels
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/core_shell_parallelepiped.py
r393facf r1f159bd 5 5 Calculates the form factor for a rectangular solid with a core-shell structure. 6 6 The thickness and the scattering length density of the shell or 7 "rim" can be different on each (pair) of faces. 8 7 "rim" can be different on each (pair) of faces. However at this time 8 the 1D calculation does **NOT** actually calculate a c face rim despite the presence of 9 the parameter. Some other aspects of the 1D calculation may be wrong. 10 11 .. note:: 12 This model was originally ported from NIST IGOR macros. However, it is not 13 yet fully understood by the SasView developers and is currently under review. 9 14 10 15 The form factor is normalized by the particle volume $V$ such that … … 36 41 V = ABC + 2t_ABC + 2t_BAC + 2t_CAB 37 42 38 **meaning that there are "gaps" at the corners of the solid.** 43 **meaning that there are "gaps" at the corners of the solid.** Again note that 44 $t_C = 0$ currently. 39 45 40 46 The intensity calculated follows the :ref:`parallelepiped` model, with the 41 47 core-shell intensity being calculated as the square of the sum of the 42 amplitudes of the core and the slabs on the edges. 43 44 the scattering amplitude is computed for a particular orientation of the core-shell 45 parallelepiped with respect to the scattering vector and then averaged over all 46 possible orientations, where $\alpha$ is the angle between the $z$ axis and the longest axis $C$ 47 of the parallelepiped, $\beta$ is the angle between projection of the particle in the $xy$ detector plane and the $y$ axis. 48 amplitudes of the core and shell, in the same manner as a core-shell model. 48 49 49 50 .. math:: 50 \begin{align*} 51 F(Q)&=A B C (\rho_\text{core}-\rho_\text{solvent}) S(A \sin\alpha \sin\beta)S(B \sin\alpha \cos\beta)S(C \cos\alpha) \\ 52 &+ 2t_A B C (\rho_\text{A}-\rho_\text{solvent}) \left[S((A+t_A) \sin\alpha \sin\beta)-S(A \sin\alpha \sin\beta)\right] S(B \sin\alpha \cos\beta) S(C \cos\alpha)\\ 53 &+ 2 A t_B C (\rho_\text{B}-\rho_\text{solvent}) S(A \sin\alpha \sin\beta) \left[S((B+t_B) \sin\alpha \cos\beta)-S(B \sin\alpha \cos\beta)\right] S(C \cos\alpha)\\ 54 &+ 2 A B t_C (\rho_\text{C}-\rho_\text{solvent}) S(A \sin\alpha \sin\beta) S(B \sin\alpha \cos\beta) \left[S((C+t_C) \cos\alpha)-S(C \cos\alpha)\right] 55 \end{align*} 56 57 with 58 59 .. math:: 60 61 S(x) = \frac{\sin \tfrac{1}{2}Q x}{\tfrac{1}{2}Q x} 62 63 where $\rho_\text{core}$, $\rho_\text{A}$, $\rho_\text{B}$ and $\rho_\text{C}$ are 64 the scattering length of the parallelepiped core, and the rectangular slabs of 65 thickness $t_A$, $t_B$ and $t_C$, respectively. 66 $\rho_\text{solvent}$ is the scattering length of the solvent. 51 52 F_{a}(Q,\alpha,\beta)= 53 \left[\frac{\sin(\tfrac{1}{2}Q(L_A+2t_A)\sin\alpha \sin\beta)}{\tfrac{1}{2}Q(L_A+2t_A)\sin\alpha\sin\beta} 54 - \frac{\sin(\tfrac{1}{2}QL_A\sin\alpha \sin\beta)}{\tfrac{1}{2}QL_A\sin\alpha \sin\beta} \right] 55 \left[\frac{\sin(\tfrac{1}{2}QL_B\sin\alpha \sin\beta)}{\tfrac{1}{2}QL_B\sin\alpha \sin\beta} \right] 56 \left[\frac{\sin(\tfrac{1}{2}QL_C\sin\alpha \sin\beta)}{\tfrac{1}{2}QL_C\sin\alpha \sin\beta} \right] 57 58 .. note:: 59 60 Why does t_B not appear in the above equation? 61 For the calculation of the form factor to be valid, the sides of the solid 62 MUST (perhaps not any more?) be chosen such that** $A < B < C$. 63 If this inequality is not satisfied, the model will not report an error, 64 but the calculation will not be correct and thus the result wrong. 67 65 68 66 FITTING NOTES … … 75 73 known values, or you will certainly end up at a solution that is unphysical. 76 74 75 Constraints must be applied during fitting to ensure that the inequality 76 $A < B < C$ is not violated. The calculation will not report an error, 77 but the results will not be correct. 78 77 79 The returned value is in units of |cm^-1|, on absolute scale. 78 80 … … 89 91 $\Psi = 0$ when the *short_b* axis is parallel to the *x*-axis of the detector. 90 92 91 For 2d, constraints must be applied during fitting to ensure that the inequality92 $A < B < C$ is not violated, and hence the correct definition of angles is preserved. The calculation will not report an error,93 but the results may be not correct.94 95 93 .. figure:: img/parallelepiped_angle_definition.png 96 94 97 95 Definition of the angles for oriented core-shell parallelepipeds. 98 96 Note that rotation $\theta$, initially in the $xz$ plane, is carried out first, then 99 rotation $\phi$ about the $z$ axis, finally rotation $\Psi$ is now around the axis of the parallelepiped.97 rotation $\phi$ about the $z$ axis, finally rotation $\Psi$ is now around the axis of the cylinder. 100 98 The neutron or X-ray beam is along the $z$ axis. 101 99 … … 111 109 Equations (1), (13-14). (in German) 112 110 .. [#] D Singh (2009). *Small angle scattering studies of self assembly in 113 lipid mixtures*, John s Hopkins University Thesis (2009) 223-225. `Available111 lipid mixtures*, John's Hopkins University Thesis (2009) 223-225. `Available 114 112 from Proquest <http://search.proquest.com/docview/304915826?accountid 115 113 =26379>`_ … … 221 219 [{'theta':10.0, 'phi':20.0}, [(qx, qy)], [0.0853299803222]], 222 220 ] 221 del tests # TODO: fix the tests 223 222 del qx, qy # not necessary to delete, but cleaner
Note: See TracChangeset
for help on using the changeset viewer.