Changes in sasmodels/models/core_shell_parallelepiped.py [9b79f29:cb0dc22] in sasmodels
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/core_shell_parallelepiped.py
r9b79f29 rcb0dc22 6 6 The thickness and the scattering length density of the shell or 7 7 "rim" can be different on each (pair) of faces. However at this time 8 the 1D calculationdoes **NOT** actually calculate a c face rim despite the presence of9 the parameter. Some other aspects of the 1D calculation may be wrong.8 the model does **NOT** actually calculate a c face rim despite the presence of 9 the parameter. 10 10 11 11 .. note:: 12 This model was originally ported from NIST IGOR macros. However, it is not13 yet fully understood by the SasView developers and is currently underreview.12 This model was originally ported from NIST IGOR macros. However,t is not 13 yet fully understood by the SasView developers and is currently review. 14 14 15 15 The form factor is normalized by the particle volume $V$ such that … … 48 48 amplitudes of the core and shell, in the same manner as a core-shell model. 49 49 50 .. math::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 50 58 51 .. note:: 59 52 60 Why does t_B not appear in the above equation?61 53 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$.54 MUST be chosen such that** $A < B < C$. 63 55 If this inequality is not satisfied, the model will not report an error, 64 56 but the calculation will not be correct and thus the result wrong. 65 57 66 58 FITTING NOTES 67 If the scale is set equal to the particle volume fraction, $\phi$, the returned59 If the scale is set equal to the particle volume fraction, |phi|, the returned 68 60 value is the scattered intensity per unit volume, $I(q) = \phi P(q)$. 69 61 However, **no interparticle interference effects are included in this … … 81 73 NB: The 2nd virial coefficient of the core_shell_parallelepiped is calculated 82 74 based on the the averaged effective radius $(=\sqrt{(A+2t_A)(B+2t_B)/\pi})$ 83 and length $(C+2t_C)$ values, after appropriately 84 sorting the three dimensions to give an oblate or prolate particle, to give an 85 effective radius, for $S(Q)$ when $P(Q) * S(Q)$ is applied. 75 and length $(C+2t_C)$ values, and used as the effective radius 76 for $S(Q)$ when $P(Q) * S(Q)$ is applied. 86 77 87 78 To provide easy access to the orientation of the parallelepiped, we define the … … 92 83 *x*-axis of the detector. 93 84 94 .. figure:: img/parallelepiped_angle_definition. png85 .. figure:: img/parallelepiped_angle_definition.jpg 95 86 96 87 Definition of the angles for oriented core-shell parallelepipeds. 97 88 98 .. figure:: img/parallelepiped_angle_projection. png89 .. figure:: img/parallelepiped_angle_projection.jpg 99 90 100 91 Examples of the angles for oriented core-shell parallelepipeds against the … … 121 112 122 113 import numpy as np 123 from numpy import pi, inf, sqrt , cos, sin114 from numpy import pi, inf, sqrt 124 115 125 116 name = "core_shell_parallelepiped" … … 153 144 ["thick_rim_c", "Ang", 10, [0, inf], "volume", 154 145 "Thickness of C rim"], 155 ["theta", "degrees", 0, [- 360, 360], "orientation",156 " c axis to beamangle"],157 ["phi", "degrees", 0, [- 360, 360], "orientation",158 " rotation about beam"],159 ["psi", "degrees", 0, [- 360, 360], "orientation",160 " rotation about c axis"],146 ["theta", "degrees", 0, [-inf, inf], "orientation", 147 "In plane angle"], 148 ["phi", "degrees", 0, [-inf, inf], "orientation", 149 "Out of plane angle"], 150 ["psi", "degrees", 0, [-inf, inf], "orientation", 151 "Rotation angle around its own c axis against q plane"], 161 152 ] 162 153 … … 195 186 psi_pd=10, psi_pd_n=1) 196 187 197 # rkh 7/4/17 add random unit test for 2d, note make all params different, 2d values not tested against other codes or models 198 qx, qy = 0.2 * cos(pi/6.), 0.2 * sin(pi/6.) 188 qx, qy = 0.2 * np.cos(2.5), 0.2 * np.sin(2.5) 199 189 tests = [[{}, 0.2, 0.533149288477], 200 190 [{}, [0.2], [0.533149288477]], 201 [{'theta':10.0, 'phi': 20.0}, (qx, qy), 0.0853299803222],202 [{'theta':10.0, 'phi': 20.0}, [(qx, qy)], [0.0853299803222]],191 [{'theta':10.0, 'phi':10.0}, (qx, qy), 0.032102135569], 192 [{'theta':10.0, 'phi':10.0}, [(qx, qy)], [0.032102135569]], 203 193 ] 204 194 del qx, qy # not necessary to delete, but cleaner
Note: See TracChangeset
for help on using the changeset viewer.