Changeset 3fd0499 in sasmodels for sasmodels/models/core_shell_parallelepiped.py
- Timestamp:
- Apr 8, 2017 4:32:39 AM (7 years ago)
- Branches:
- master, core_shell_microgels, costrafo411, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- afd4692, 3a45c2c
- Parents:
- 16a8c63 (diff), b2921d0 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/core_shell_parallelepiped.py
rcb0dc22 r1916c52 10 10 11 11 .. note:: 12 This model was originally ported from NIST IGOR macros. However, t is not13 yet fully understood by the SasView developers and is currently review.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. 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] 50 57 51 58 .. note:: 52 59 60 Why does t_B not appear in the above equation? 53 61 For the calculation of the form factor to be valid, the sides of the solid 54 MUST be chosen such that** $A < B < C$.62 MUST (perhaps not any more?) be chosen such that** $A < B < C$. 55 63 If this inequality is not satisfied, the model will not report an error, 56 64 but the calculation will not be correct and thus the result wrong. 57 65 58 66 FITTING NOTES 59 If the scale is set equal to the particle volume fraction, |phi|, the returned67 If the scale is set equal to the particle volume fraction, $\phi$, the returned 60 68 value is the scattered intensity per unit volume, $I(q) = \phi P(q)$. 61 69 However, **no interparticle interference effects are included in this … … 73 81 NB: The 2nd virial coefficient of the core_shell_parallelepiped is calculated 74 82 based on the the averaged effective radius $(=\sqrt{(A+2t_A)(B+2t_B)/\pi})$ 75 and length $(C+2t_C)$ values, and used as the effective radius 76 for $S(Q)$ when $P(Q) * S(Q)$ is applied. 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. 77 86 78 87 To provide easy access to the orientation of the parallelepiped, we define the … … 83 92 *x*-axis of the detector. 84 93 85 .. figure:: img/parallelepiped_angle_definition. jpg94 .. figure:: img/parallelepiped_angle_definition.png 86 95 87 96 Definition of the angles for oriented core-shell parallelepipeds. 88 97 89 .. figure:: img/parallelepiped_angle_projection. jpg98 .. figure:: img/parallelepiped_angle_projection.png 90 99 91 100 Examples of the angles for oriented core-shell parallelepipeds against the … … 112 121 113 122 import numpy as np 114 from numpy import pi, inf, sqrt 123 from numpy import pi, inf, sqrt, cos, sin 115 124 116 125 name = "core_shell_parallelepiped" … … 186 195 psi_pd=10, psi_pd_n=1) 187 196 188 qx, qy = 0.2 * np.cos(2.5), 0.2 * np.sin(2.5) 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.) 189 199 tests = [[{}, 0.2, 0.533149288477], 190 200 [{}, [0.2], [0.533149288477]], 191 [{'theta':10.0, 'phi': 10.0}, (qx, qy), 0.032102135569],192 [{'theta':10.0, 'phi': 10.0}, [(qx, qy)], [0.032102135569]],201 [{'theta':10.0, 'phi':20.0}, (qx, qy), 0.0853299803222], 202 [{'theta':10.0, 'phi':20.0}, [(qx, qy)], [0.0853299803222]], 193 203 ] 194 204 del qx, qy # not necessary to delete, but cleaner
Note: See TracChangeset
for help on using the changeset viewer.