Changeset 2941abf in sasmodels
- Timestamp:
- Oct 15, 2016 2:17:44 PM (8 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:
- ed0827a
- Parents:
- 14838a3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/rectangular_prism.py
ra807206 r2941abf 3 3 r""" 4 4 5 This model provides the form factor, *P(q)*, for a rectangular prism.5 This model provides the form factor, $P(q)$, for a rectangular prism. 6 6 7 7 Note that this model is almost totally equivalent to the existing 8 8 :ref:`parallelepiped` model. 9 9 The only difference is that the way the relevant 10 parameters are defined here ( *a*, *b/a*, *c/a* instead of *a*, *b*, *c*)10 parameters are defined here ($a$, $b/a$, $c/a$ instead of $a$, $b$, $c$) 11 11 which allows use of polydispersity with this model while keeping the shape of 12 the prism (e.g. setting *b/a* = 1 and *c/a* = 1and applying polydispersity12 the prism (e.g. setting $b/a = 1$ and $c/a = 1$ and applying polydispersity 13 13 to *a* will generate a distribution of cubes of different sizes). 14 14 Note also that, contrary to :ref:`parallelepiped`, it does not compute … … 24 24 Note also that the angle definitions used in the code and the present 25 25 documentation correspond to those used in (Nayuk, 2012) (see Fig. 1 of 26 that reference), with |theta| corresponding to |alpha|in that paper,26 that reference), with $\theta$ corresponding to $\alpha$ in that paper, 27 27 and not to the usual convention used for example in the 28 28 :ref:`parallelepiped` model. As the present model does not compute … … 30 30 31 31 In this model the scattering from a massive parallelepiped with an 32 orientation with respect to the scattering vector given by |theta|33 and |phi|32 orientation with respect to the scattering vector given by $\theta$ 33 and $\phi$ 34 34 35 35 .. math:: 36 A_P\,(q) = \frac{\sin \bigl( q \frac{C}{2} \cos\theta \bigr)}{\left( q \frac{C}{2}37 \cos\theta \right)} \, \times \, \frac{\sin \bigl( q \frac{A}{2} \sin\theta \sin\phi38 \bigr)}{\left( q \frac{A}{2} \sin\theta \sin\phi \right)} \, \times \, \frac{\sin \bigl(39 q \frac{B}{2} \sin\theta \cos\phi \bigr)}{\left( q \frac{B}{2} \sin\theta \cos\phi \right)}40 36 41 where *A*, *B* and *C* are the sides of the parallelepiped and must fulfill 42 :math:`A \le B \le C`, |theta| is the angle between the *z* axis and the 43 longest axis of the parallelepiped *C*, and |phi| is the angle between the 44 scattering vector (lying in the *xy* plane) and the *y* axis. 37 A_P\,(q) = 38 \frac{\sin \left( \tfrac{1}{2}qC \cos\theta \right) }{\tfrac{1}{2} qC \cos\theta} 39 \,\times\, 40 \frac{\sin \left( \tfrac{1}{2}qA \cos\theta \right) }{\tfrac{1}{2} qA \cos\theta} 41 \,\times\ , 42 \frac{\sin \left( \tfrac{1}{2}qB \cos\theta \right) }{\tfrac{1}{2} qB \cos\theta} 43 44 where $A$, $B$ and $C$ are the sides of the parallelepiped and must fulfill 45 $A \le B \le C$, $\theta$ is the angle between the $z$ axis and the 46 longest axis of the parallelepiped $C$, and $\phi$ is the angle between the 47 scattering vector (lying in the $xy$ plane) and the $y$ axis. 45 48 46 49 The normalized form factor in 1D is obtained averaging over all possible … … 48 51 49 52 .. math:: 50 P(q) = \frac{2}{\pi} \ times \, \int_0^{\frac{\pi}{2}} \,53 P(q) = \frac{2}{\pi} \int_0^{\frac{\pi}{2}} \, 51 54 \int_0^{\frac{\pi}{2}} A_P^2(q) \, \sin\theta \, d\theta \, d\phi 52 55 … … 54 57 55 58 .. math:: 56 I(q) = \ mbox{scale} \times V \times (\rho_{\mbox{p}} -57 \rho_ {\mbox{solvent}})^2 \times P(q)59 I(q) = \text{scale} \times V \times (\rho_\text{p} - 60 \rho_\text{solvent})^2 \times P(q) 58 61 59 where *V* is the volume of the rectangular prism, :math:`\rho_{\mbox{p}}`60 is the scattering length of the parallelepiped, :math:`\rho_{\mbox{solvent}}`62 where $V$ is the volume of the rectangular prism, $\rho_\text{p}$ 63 is the scattering length of the parallelepiped, $\rho_\text{solvent}$ 61 64 is the scattering length of the solvent, and (if the data are in absolute 62 65 units) *scale* represents the volume fraction (which is unitless).
Note: See TracChangeset
for help on using the changeset viewer.