source: sasview/src/sas/sasgui/perspectives/calculator/media/sas_calculator_help.rst @ 6ccc55f

magnetic_scattrelease-4.2.2ticket-1009ticket-1094-headlessticket-1242-2d-resolutionticket-1243ticket-1249ticket885unittest-saveload
Last change on this file since 6ccc55f was 6ccc55f, checked in by Paul Kienzle <pkienzle@…>, 6 years ago

translate equation images back into latex for sas_calculator_help

  • Property mode set to 100644
File size: 5.4 KB
RevLine 
[ec392464]1.. sas_calculator_help.rst
2
3.. This is a port of the original SasView html help file to ReSTructured text
4.. by S King, ISIS, during SasView CodeCamp-III in Feb 2015.
5
[da456fb]6.. _SANS_Calculator_Tool:
7
[a9dc4eb]8Generic SANS Calculator Tool
9============================
[ec392464]10
[a9dc4eb]11Description
12-----------
[ec392464]13
[a9dc4eb]14This tool attempts to simulate the SANS expected from a specified
15shape/structure or scattering length density profile. The tool can
16handle both nuclear and magnetic contributions to the scattering.
[850c753]17
[a9dc4eb]18Theory
19------
[ec392464]20
[5ed76f8]21In general, a particle with a volume $V$ can be described by an ensemble
22containing $N$ 3-dimensional rectangular pixels where each pixel is much
23smaller than $V$.
[ec392464]24
[5ed76f8]25Assuming that all the pixel sizes are the same, the elastic scattering
[850c753]26intensity from the particle is
[ec392464]27
[2f7ea43]28.. math::
29
30    I(\vec Q) = \frac{1}{V}\left|
31        \sum_j^N v_j \beta_j \exp(i\vec Q \cdot \vec r_j)\right|^2
[ec392464]32
[850c753]33Equation 1.
34
[5ed76f8]35where $\beta_j$ and $r_j$ are the scattering length density and
36the position of the $j^\text{th}$ pixel respectively.
[850c753]37
[5ed76f8]38The total volume $V$
[ec392464]39
[5ed76f8]40.. math::
[ec392464]41
[5ed76f8]42    V = \sum_j^N v_j
43
44for $\beta_j \ne 0$ where $v_j$ is the volume of the $j^\text{th}$
45pixel (or the $j^\text{th}$ natural atomic volume (= atomic mass / (natural molar
[850c753]46density * Avogadro number) for the atomic structures).
47
[5ed76f8]48$V$ can be corrected by users. This correction is useful especially for an
49atomic structure (such as taken from a PDB file) to get the right normalization.
[850c753]50
[2f7ea43]51*NOTE!* $\beta_j$ *displayed in the GUI may be incorrect but this will not
[850c753]52affect the scattering computation if the correction of the total volume V is made.*
53
[5ed76f8]54The scattering length density (SLD) of each pixel, where the SLD is uniform, is
55a combination of the nuclear and magnetic SLDs and depends on the spin states
[850c753]56of the neutrons as follows.
57
[a9dc4eb]58Magnetic Scattering
59^^^^^^^^^^^^^^^^^^^
[850c753]60
[2f7ea43]61For magnetic scattering, only the magnetization component, $\mathbf{M}_\perp$,
62perpendicular to the scattering vector $\vec Q$ contributes to the magnetic
[850c753]63scattering length.
[ec392464]64
[6aad2e8]65.. image:: mag_vector.png
[ec392464]66
67The magnetic scattering length density is then
68
[2f7ea43]69.. math::
70
71    \beta_M = \frac{\gamma r_0}{2 \mu_B}\sigma \cdot \mathbf{M}_\perp
72        = D_M\sigma \cdot \mathbf{M}_\perp
[ec392464]73
[5ed76f8]74where the gyromagnetic ratio is $\gamma = -1.913$, $\mu_B$ is the Bohr
75magneton, $r_0$ is the classical radius of electron, and $\sigma$ is the
[850c753]76Pauli spin.
[ec392464]77
[850c753]78For a polarized neutron, the magnetic scattering is depending on the spin states.
[ec392464]79
[5ed76f8]80Let us consider that the incident neutrons are polarised both parallel (+) and
81anti-parallel (-) to the x' axis (see below). The possible states after
82scattering from the sample are then
[ec392464]83
[850c753]84*  Non-spin flips: (+ +) and (- -)
85*  Spin flips:     (+ -) and (- +)
[ec392464]86
[6aad2e8]87.. image:: gen_mag_pic.png
[ec392464]88
[6ccc55f]89Now let us assume that the angles of the $\vec Q$ vector and the spin-axis ($x'$)
[2f7ea43]90to the $x$-axis are $\phi$ and $\theta_\text{up}$ respectively (see above). Then,
[5ed76f8]91depending upon the polarization (spin) state of neutrons, the scattering
92length densities, including the nuclear scattering length density ($\beta_N$)
[850c753]93are given as
[ec392464]94
[850c753]95*  for non-spin-flips
[ec392464]96
[2f7ea43]97.. math::
98    \beta_{\pm\pm} = \beta_N \mp D_M M_{\perp x'}
[ec392464]99
[850c753]100*  for spin-flips
101
[2f7ea43]102.. math::
103    \beta_{\pm\mp} = - D_M(M_{\perp y'} \pm i M_{\perp z'})
[ec392464]104
105where
106
[2f7ea43]107.. math::
[ec392464]108
[2f7ea43]109    M_{\perp x'} &= M_{0q_x}\cos\theta_\text{up} + M_{0q_y}\sin\theta_\text{up} \\
110    M_{\perp y'} &= M_{0q_y}\cos\theta_\text{up} + M_{0q_x}\sin\theta_\text{up} \\
111    M_{\perp z'} &= M_{0z} \\
112    M_{0q_x} &= (M_{0x}\cos\phi - M_{0y}\sin\phi)\cos\phi \\
113    M_{0q_y} &= (M_{0y}\sin\phi - M_{0y}\cos\phi)\sin\phi
[ec392464]114
[2f7ea43]115Here the $M_{0x}$, $M_{0y}$ and $M_{0z}$ are
116the $x$, $y$ and $z$ components of the magnetisation vector in the
117laboratory $x$-$y$-$z$ frame.
[ec392464]118
119.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
120
[a9dc4eb]121Using the tool
122--------------
[ec392464]123
[6aad2e8]124.. image:: gen_gui_help.png
[ec392464]125
[5ed76f8]126After computation the result will appear in the *Theory* box in the SasView
[850c753]127*Data Explorer* panel.
128
[5ed76f8]129*Up_frac_in* and *Up_frac_out* are the ratio
[ec392464]130
[850c753]131   (spin up) / (spin up + spin down)
[5ed76f8]132
[850c753]133of neutrons before the sample and at the analyzer, respectively.
[ec392464]134
[5ed76f8]135*NOTE 1. The values of* Up_frac_in *and* Up_frac_out *must be in the range
[850c753]1360.0 to 1.0. Both values are 0.5 for unpolarized neutrons.*
[ec392464]137
[5ed76f8]138*NOTE 2. This computation is totally based on the pixel (or atomic) data fixed
[850c753]139in xyz coordinates. No angular orientational averaging is considered.*
140
[5ed76f8]141*NOTE 3. For the nuclear scattering length density, only the real component
[ec392464]142is taken account.*
143
144.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
145
[a9dc4eb]146Using PDB/OMF or SLD files
147--------------------------
[ec392464]148
[a9dc4eb]149The SANS Calculator tool can read some PDB, OMF or SLD files but ignores
[5ed76f8]150polarized/magnetic scattering when doing so, thus related parameters such as
[850c753]151*Up_frac_in*, etc, will be ignored.
[ec392464]152
[5ed76f8]153The calculation for fixed orientation uses Equation 1 above resulting in a 2D
154output, whereas the scattering calculation averaged over all the orientations
[850c753]155uses the Debye equation below providing a 1D output
[ec392464]156
[2f7ea43]157.. math::
158
159    I(|\vec Q|) = \frac{1}{V}\sum_j^N v_j\beta_j \sum_k^N v_k \beta_k
160        \frac{\sin(|\vec Q||\vec r_j - \vec r_k|)}{|\vec Q||\vec r_j - \vec r_k|}
[ec392464]161
[5ed76f8]162where $v_j \beta_j \equiv b_j$ is the scattering
163length of the $j^\text{th}$ atom. The calculation output is passed to the *Data Explorer*
[850c753]164for further use.
[ec392464]165
166.. image:: pdb_combo.jpg
[850c753]167
168.. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
169
[a9dc4eb]170.. note::  This help document was last changed by Steve King, 01May2015
Note: See TracBrowser for help on using the repository browser.