source: sasmodels/_sources/model/parallelepiped.txt @ 68532f3

gh-pages
Last change on this file since 68532f3 was 68532f3, checked in by ajj, 8 years ago

Adding docs

  • Property mode set to 100644
File size: 4.4 KB
Line 
1.. _parallelepiped:
2
3Parallelepiped
4=======================================================
5
6Rectangular parallelepiped with uniform scattering length density.
7
8=========== ==================================================== ============ =============
9Parameter   Description                                          Units        Default value
10=========== ==================================================== ============ =============
11scale       Source intensity                                     None                     1
12background  Source background                                    |cm^-1|                  0
13sld         Parallelepiped scattering length density             |1e-6Ang^-2|             4
14solvent_sld Solvent scattering length density                    |1e-6Ang^-2|             1
15a_side      Shorter side of the parallelepiped                   |Ang|                   35
16b_side      Second side of the parallelepiped                    |Ang|                   75
17c_side      Larger side of the parallelepiped                    |Ang|                  400
18theta       In plane angle                                       degree                  60
19phi         Out of plane angle                                   degree                  60
20psi         Rotation angle around its own c axis against q plane degree                  60
21=========== ==================================================== ============ =============
22
23The returned value is scaled to units of |cm^-1|.
24
25
26The form factor is normalized by the particle volume.
27
28For information about polarised and magnetic scattering, click here_.
29
30Definition
31----------
32
33This model provides the form factor, *P(q)*, for a rectangular parallelepiped
34(below) where the form factor is normalized by the volume of the
35parallelepiped. If you need to apply polydispersity, see also the
36RectangularPrismModel_.
37
38The calculated form factor is:
39
40.. math::
41
42    P(Q) = {\text{scale} \over V} F^2(Q) + \text{background}
43
44where the volume *V* = *A B C* and the averaging < > is applied over all
45orientations for 1D.
46
47.. image:: img/parallelepiped.jpg
48
49*Figure. Parallelepiped with the corresponding Definition of sides.
50
51The edge of the solid must satisfy the condition that** *A* < *B* < *C*.
52Then, assuming *a* = *A* / *B* < 1, *b* = *B* / *B* = 1, and
53*c* = *C* / *B* > 1, the form factor is
54
55.. math::
56
57    P(q) = \frac{\textstyle{scale}}{V}\int_0^1 \phi(\mu \sqrt{1-\sigma^2},a)
58    [S(\mu c \sigma/2)]^2 d\sigma
59
60with
61
62.. math::
63
64    \phi(\mu,a) = \int_0^1 \{S[\frac{\mu}{2}\cos(\frac{\pi}{2}u)]
65    S[\frac{\mu a}{2}\sin(\frac{\pi}{2}u)]\}^2 du
66
67    S(x) = \frac{\sin x}{x}
68
69    \mu = qB
70
71and the contrast is defined as
72
73.. math::
74
75    \Delta\rho = \rho_{\textstyle p} - \rho_{\textstyle solvent}
76
77The scattering intensity per unit volume is returned in units of |cm^-1|;
78ie, *I(q)* = |phi| *P(q)*\ .
79
80NB: The 2nd virial coefficient of the parallelpiped is calculated based on
81the averaged effective radius (= sqrt(*short_a* \* *short_b* / |pi|)) and
82length(= *long_c*) values, and used as the effective radius for
83*S(Q)* when *P(Q)* \* *S(Q)* is applied.
84
85To provide easy access to the orientation of the parallelepiped, we define
86three angles |theta|, |phi| and |bigpsi|. The definition of |theta| and |phi|
87is the same as for the cylinder model (see also figures below).
88The angle |bigpsi| is the rotational angle around the *long_c* axis against
89the *q* plane. For example, |bigpsi| = 0 when the *short_b* axis is parallel
90to the *x*-axis of the detector.
91
92
93.. _parallelepiped-orientation:
94
95.. figure:: img/orientation.jpg
96
97    Definition of the angles for oriented parallelepipeds.
98
99.. figure:: img/orientation2.jpg
100
101    Examples of the angles for oriented parallelepipeds against the detector plane.
102
103
104Validation
105----------
106
107Validation of the code was done by comparing the output of the 1D calculation
108to the angular average of the output of a 2D calculation over all possible
109angles. The Figure below shows the comparison where the solid dot refers to
110averaged 2D while the line represents the result of the 1D calculation (for
111the averaging, 76, 180, 76 points are taken for the angles of |theta|, |phi|,
112and |psi| respectively).
113
114.. _parallelepiped-compare:
115
116.. figure:: img/parallelepiped_compare.jpg
117
118*Figure. Comparison between 1D and averaged 2D.*
119
120This model reimplements the form factor calculations implemented in a c-library
121provided by the NIST Center for Neutron Research (Kline, 2006).
122
123
Note: See TracBrowser for help on using the repository browser.