Changeset 6e5c0b7 in sasmodels for sasmodels/models/triaxial_ellipsoid.py


Ignore:
Timestamp:
Apr 4, 2017 5:28:58 PM (7 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
3a45c2c
Parents:
933af72 (diff), c4e3215 (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.
Message:

Merge branch 'master' into ticket-890

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/triaxial_ellipsoid.py

    r925ad6e r28d3067  
    22# Note: model title and parameter table are inserted automatically 
    33r""" 
    4 All three axes are of different lengths with $R_a \leq R_b \leq R_c$ 
    5 **Users should maintain this inequality for all calculations**. 
     4Definition 
     5---------- 
     6 
     7.. figure:: img/triaxial_ellipsoid_geometry.jpg 
     8 
     9    Ellipsoid with $R_a$ as *radius_equat_minor*, $R_b$ as *radius_equat_major* 
     10    and $R_c$ as *radius_polar*. 
     11 
     12Given an ellipsoid 
    613 
    714.. math:: 
    815 
    9     P(q) = \text{scale} V \left< F^2(q) \right> + \text{background} 
     16    \frac{X^2}{R_a^2} + \frac{Y^2}{R_b^2} + \frac{Z^2}{R_c^2} = 1 
    1017 
    11 where the volume $V = 4/3 \pi R_a R_b R_c$, and the averaging 
    12 $\left<\ldots\right>$ is applied over all orientations for 1D. 
    13  
    14 .. figure:: img/triaxial_ellipsoid_geometry.jpg 
    15  
    16     Ellipsoid schematic. 
    17  
    18 Definition 
    19 ---------- 
    20  
    21 The form factor calculated is 
     18the scattering is defined by the average over all orientations $\Omega$, 
    2219 
    2320.. math:: 
    2421 
    25     P(q) = \frac{\text{scale}}{V}\int_0^1\int_0^1 
    26         \Phi^2(qR_a^2\cos^2( \pi x/2) + qR_b^2\sin^2(\pi y/2)(1-y^2) + R_c^2y^2) 
    27         dx dy 
     22    P(q) = \text{scale}\frac{V}{4 \pi}\int_\Omega \Phi^2(qr) d\Omega + \text{background} 
    2823 
    2924where 
     
    3126.. math:: 
    3227 
    33     \Phi(u) = 3 u^{-3} (\sin u - u \cos u) 
     28    \Phi(qr) &= 3 j_1(qr)/qr = 3 (\sin qr - qr \cos qr)/(qr)^3 \\ 
     29    r^2 &= R_a^2e^2 + R_b^2f^2 + R_c^2g^2 \\ 
     30    V &= \tfrac{4}{3} \pi R_a R_b R_c 
     31 
     32The $e$, $f$ and $g$ terms are the projections of the orientation vector on $X$, 
     33$Y$ and $Z$ respectively.  Keeping the orientation fixed at the canonical 
     34axes, we can integrate over the incident direction using polar angle 
     35$-\pi/2 \le \gamma \le \pi/2$ and equatorial angle $0 \le \phi \le 2\pi$ 
     36(as defined in ref [1]), 
     37 
     38 .. math:: 
     39 
     40     \langle\Phi^2\rangle = \int_0^{2\pi} \int_{-\pi/2}^{\pi/2} \Phi^2(qr) \cos \gamma\,d\gamma d\phi 
     41 
     42with $e = \cos\gamma \sin\phi$, $f = \cos\gamma \cos\phi$ and $g = \sin\gamma$. 
     43A little algebra yields 
     44 
     45.. math:: 
     46 
     47    r^2 = b^2(p_a \sin^2 \phi \cos^2 \gamma + 1 + p_c \sin^2 \gamma) 
     48 
     49for 
     50 
     51.. math:: 
     52 
     53    p_a = \frac{a^2}{b^2} - 1 \text{ and } p_c = \frac{c^2}{b^2} - 1 
     54 
     55Due to symmetry, the ranges can be restricted to a single quadrant 
     56$0 \le \gamma \le \pi/2$ and $0 \le \phi \le \pi/2$, scaling the resulting 
     57integral by 8. The computation is done using the substitution $u = \sin\gamma$, 
     58$du = \cos\gamma\,d\gamma$, giving 
     59 
     60.. math:: 
     61 
     62    \langle\Phi^2\rangle &= 8 \int_0^{\pi/2} \int_0^1 \Phi^2(qr) du d\phi \\ 
     63    r^2 &= b^2(p_a \sin^2(\phi)(1 - u^2) + 1 + p_c u^2) 
    3464 
    3565To provide easy access to the orientation of the triaxial ellipsoid, 
     
    6999---------- 
    70100 
    71 L A Feigin and D I Svergun, *Structure Analysis by Small-Angle X-Ray 
    72 and Neutron Scattering*, Plenum, New York, 1987. 
     101[1] Finnigan, J.A., Jacobs, D.J., 1971. 
     102*Light scattering by ellipsoidal particles in solution*, 
     103J. Phys. D: Appl. Phys. 4, 72-77. doi:10.1088/0022-3727/4/1/310 
     104 
    73105""" 
    74106 
     
    91123               "Solvent scattering length density"], 
    92124              ["radius_equat_minor", "Ang", 20, [0, inf], "volume", 
    93                "Minor equatorial radius"], 
     125               "Minor equatorial radius, Ra"], 
    94126              ["radius_equat_major", "Ang", 400, [0, inf], "volume", 
    95                "Major equatorial radius"], 
     127               "Major equatorial radius, Rb"], 
    96128              ["radius_polar", "Ang", 10, [0, inf], "volume", 
    97                "Polar radius"], 
     129               "Polar radius, Rc"], 
    98130              ["theta", "degrees", 60, [-inf, inf], "orientation", 
    99131               "In plane angle"], 
Note: See TracChangeset for help on using the changeset viewer.