Changeset 4493288 in sasmodels for sasmodels/models/core_shell_parallelepiped.py
- Timestamp:
- Nov 29, 2017 11:25:39 PM (7 years ago)
- Branches:
- master, core_shell_microgels, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- 10ee838
- Parents:
- 0e55afe
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/core_shell_parallelepiped.py
r0e55afe r4493288 40 40 amplitudes of the core and the slabs on the edges. 41 41 42 the scattering amplitude is computed for a particular orientation of the core-shell 43 parallelepiped with respect to the scattering vector and then averaged over all 44 possible orientations, where $\alpha$ is the angle between the $z$ axis and the longest axis $C$ 45 of the parallelepiped, $\beta$ is the angle between projection of the particle in the $xy$ detector plane and the $y$ axis. 46 47 .. math:: 48 \begin{align*} 49 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) \\ 50 &+ 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)\\ 51 &+ 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)\\ 52 &+ 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] 53 \end{align*} 42 the scattering amplitude is computed for a particular orientation of the 43 core-shell parallelepiped with respect to the scattering vector and then 44 averaged over all possible orientations, where $\alpha$ is the angle between 45 the $z$ axis and the $C$ axis of the parallelepiped, $\beta$ is 46 the angle between projection of the particle in the $xy$ detector plane 47 and the $y$ axis. 48 49 .. math:: 50 51 F(Q) 52 &= (\rho_\text{core}-\rho_\text{solvent}) 53 S(Q_A, A) S(Q_B, B) S(Q_C, C) \\ 54 &+ (\rho_\text{A}-\rho_\text{solvent}) 55 \left[S(Q_A, A+2t_A) - S(Q_A, Q)\right] S(Q_B, B) S(Q_C, C) \\ 56 &+ (\rho_\text{B}-\rho_\text{solvent}) 57 S(Q_A, A) \left[S(Q_B, B+2t_B) - S(Q_B, B)\right] S(Q_C, C) \\ 58 &+ (\rho_\text{C}-\rho_\text{solvent}) 59 S(Q_A, A) S(Q_B, B) \left[S(Q_C, C+2t_C) - S(Q_C, C)\right] 54 60 55 61 with … … 57 63 .. math:: 58 64 59 S(x) = \frac{\sin \tfrac{1}{2}Q x}{\tfrac{1}{2}Q x} 60 61 where $\rho_\text{core}$, $\rho_\text{A}$, $\rho_\text{B}$ and $\rho_\text{C}$ are 62 the scattering length of the parallelepiped core, and the rectangular slabs of 63 thickness $t_A$, $t_B$ and $t_C$, respectively. 64 $\rho_\text{solvent}$ is the scattering length of the solvent. 65 S(Q, L) = L \frac{\sin \tfrac{1}{2} Q L}{\tfrac{1}{2} Q L} 66 67 and 68 69 .. math:: 70 71 Q_A &= \sin\alpha \sin\beta \\ 72 Q_B &= \sin\alpha \cos\beta \\ 73 Q_C &= \cos\alpha 74 75 76 where $\rho_\text{core}$, $\rho_\text{A}$, $\rho_\text{B}$ and $\rho_\text{C}$ 77 are the scattering length of the parallelepiped core, and the rectangular 78 slabs of thickness $t_A$, $t_B$ and $t_C$, respectively. $\rho_\text{solvent}$ 79 is the scattering length of the solvent. 65 80 66 81 FITTING NOTES 82 ~~~~~~~~~~~~~ 83 67 84 If the scale is set equal to the particle volume fraction, $\phi$, the returned 68 value is the scattered intensity per unit volume, $I(q) = \phi P(q)$. 69 However, **no interparticle interference effects are included in this 70 calculation.** 85 value is the scattered intensity per unit volume, $I(q) = \phi P(q)$. However, 86 **no interparticle interference effects are included in this calculation.** 71 87 72 88 There are many parameters in this model. Hold as many fixed as possible with … … 77 93 NB: The 2nd virial coefficient of the core_shell_parallelepiped is calculated 78 94 based on the the averaged effective radius $(=\sqrt{(A+2t_A)(B+2t_B)/\pi})$ 79 and length $(C+2t_C)$ values, after appropriately 80 sorting the three dimensions to give an oblate or prolate particle, to give an 81 effective radius,for $S(Q)$ when $P(Q) * S(Q)$ is applied.95 and length $(C+2t_C)$ values, after appropriately sorting the three dimensions 96 to give an oblate or prolate particle, to give an effective radius, 97 for $S(Q)$ when $P(Q) * S(Q)$ is applied. 82 98 83 99 For 2d data the orientation of the particle is required, described using 84 angles $\theta$, $\phi$ and $\Psi$ as in the diagrams below, for further details85 of the calculation and angular dispersions see :ref:`orientation`.100 angles $\theta$, $\phi$ and $\Psi$ as in the diagrams below, for further 101 details of the calculation and angular dispersions see :ref:`orientation`. 86 102 The angle $\Psi$ is the rotational angle around the *long_c* axis. For example, 87 103 $\Psi = 0$ when the *short_b* axis is parallel to the *x*-axis of the detector. 88 104 89 For 2d, constraints must be applied during fitting to ensure that the inequality 90 $A < B < C$ is not violated, and hence the correct definition of angles is preserved. The calculation will not report an error, 105 For 2d, constraints must be applied during fitting to ensure that the 106 inequality $A < B < C$ is not violated, and hence the correct definition 107 of angles is preserved. The calculation will not report an error, 91 108 but the results may be not correct. 92 109 … … 173 190 174 191 # surface average radius (rough approximation) 175 surf_rad = sqrt((length_a + 2.0*thick_rim_a) * (length_b + 2.0*thick_rim_b) / pi) 192 surf_rad = sqrt((length_a + 2.0*thick_rim_a) 193 * (length_b + 2.0*thick_rim_b) / pi) 176 194 177 195 height = length_c + 2.0*thick_rim_c 178 196 179 ddd = 0.75 * surf_rad * (2 * surf_rad * height + (height + surf_rad) * (height + pi * surf_rad)) 197 ddd = (0.75 * surf_rad * (2 * surf_rad * height 198 + (height + surf_rad) * (height + pi * surf_rad))) 180 199 return 0.5 * (ddd) ** (1. / 3.) 181 200 … … 212 231 psi_pd=10, psi_pd_n=1) 213 232 214 # rkh 7/4/17 add random unit test for 2d, note make all params different, 2d values not tested against other codes or models 233 # rkh 7/4/17 add random unit test for 2d, note make all params different, 234 # 2d values not tested against other codes or models 215 235 if 0: # pak: model rewrite; need to update tests 216 236 qx, qy = 0.2 * cos(pi/6.), 0.2 * sin(pi/6.)
Note: See TracChangeset
for help on using the changeset viewer.