Changeset 62dc889 in sasmodels


Ignore:
Timestamp:
Mar 28, 2019 2:08:22 PM (6 years ago)
Author:
smk78
Branches:
master, core_shell_microgels, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
adb84f6, 5e1875c
Parents:
6607260
Message:

Reworked documentation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/onion.py

    r0507e09 r62dc889  
    66solvent. We currently provide up to 9 shells with this model. 
    77 
    8 NB: *radius* represents the core radius $r_0$ and 
    9 *thickness[k]* represents the thickness of the shell, $r_{k+1} - r_k$. 
     8.. note:: 
     9 
     10    *radius* represents the core radius $r_0$ and *thickness[k]* represents  
     11    the thickness of the shell, $r_{k+1} - r_k$. 
    1012 
    1113Definition 
     
    5658    j_1(x) = \frac{\sin(x)}{x^2} - \frac{\cos(x)}{x} 
    5759 
    58 and the volume is $V(r) = \frac{4\pi}{3}r^3$. The volume of the particle 
    59 is determined by the radius of the outer shell, so $V_\text{particle} = V(r_N)$. 
    60  
    61 Now lets consider the SLD of a shell defined by 
     60and the volume is $V(r) = \frac{4\pi}{3}r^3$. 
     61 
     62The volume of the particle is determined by the radius of the outer  
     63shell, so $V_\text{particle} = V(r_N)$. 
     64 
     65Now consider the SLD of a shell defined by 
    6266 
    6367.. math:: 
     
    7478thickness of the $k^\text{th}$ shell in the equation above, respectively. 
    7579 
    76 For $A > 0$, 
     80.. figure:: img/onion_geometry.png 
     81 
     82    Example of an onion model profile. 
     83 
     84 
     85**Exponential SLD profiles** ($A > 0$ or $A < 0$): 
    7786 
    7887.. math:: 
     
    8796        - 3CV(r_{\text{shell}-1}) \frac{j_1(\beta_\text{in})}{\beta_\text{in}} 
    8897 
    89 for 
     98where 
    9099 
    91100.. math:: 
     
    95104    B&=\frac{\rho_\text{out} - \rho_\text{in}}{e^A-1} 
    96105         & C &= \frac{\rho_\text{in}e^A - \rho_\text{out}}{e^A-1} \\ 
     106          
    97107    \alpha_\text{in} &= A\frac{r_{\text{shell}-1}}{\Delta t_\text{shell}} 
    98108         & \alpha_\text{out} &= A\frac{r_\text{shell}}{\Delta t_\text{shell}} \\ 
     109          
    99110    \beta_\text{in} &= qr_{\text{shell}-1} 
    100111        & \beta_\text{out} &= qr_\text{shell} \\ 
    101112    \end{align*} 
    102113 
    103 where $h$ is 
     114and 
    104115 
    105116 .. math:: 
    106117 
    107     h(x,y) = \frac{x \sin(y) - y\cos(y)}{(x^2+y^2)y} 
     118     h(x,y) = \frac{x \sin(y) - y\cos(y)}{(x^2+y^2)y} 
    108119               - \frac{(x^2-y^2)\sin(y) - 2xy\cos(y)}{(x^2+y^2)^2y} 
    109120 
    110121 
    111 For $A \sim 0$, e.g., $A = -0.0001$, this function converges to that of the 
    112 linear SLD profile with 
    113 $\rho_\text{shell}(r) \approx A(r-r_{\text{shell}-1})/\Delta t_\text{shell})+B$, 
    114 so this case is equivalent to 
     122 
     123**Linear SLD profile** ($A \sim 0$): 
     124 
     125For small $A$, say, $A = -0.0001$, the function converges to that of of a linear  
     126SLD profile with 
     127 
     128     $\rho_\text{shell}(r) \approx A(r-r_{\text{shell}-1})/\Delta t_\text{shell})+B$, 
     129 
     130which is equivalent to 
    115131 
    116132.. math:: 
     
    140156    \end{align*} 
    141157 
    142 For $A = 0$, the exponential function has no dependence on the radius (so that 
     158 
     159**Constant SLD** ($A = 0$): 
     160 
     161When $A = 0$ the exponential function has no dependence on the radius (meaning  
    143162$\rho_\text{out}$ is ignored in this case) and becomes flat. We set the constant 
    144163to $\rho_\text{in}$ for convenience, and thus the form factor contributed by 
     
    153172            \frac{j_1(qr_\text{in})}{qr_\text{in}} 
    154173 
    155 .. figure:: img/onion_geometry.png 
    156  
    157     Example of an onion model profile. 
    158  
    159174The 2D scattering intensity is the same as $P(q)$ above, regardless of the 
    160175orientation of the $q$ vector which is defined as 
     
    184199* **Author:**  
    185200* **Last Modified by:**  
    186 * **Last Reviewed by:**  
     201* **Last Reviewed by:** Steve King **Date:** March 28, 2019 
    187202* **Source added by :** Steve King **Date:** March 25, 2019 
    188203""" 
     
    284299 
    285300description = """\ 
    286 Form factor of mutishells normalized by the volume. Here each shell is 
     301Form factor of multishells normalized by the volume. Here each shell is 
    287302described by an exponential function; 
    288303 
     
    297312        II) For the exact point of A_shell == 0, 
    298313                f(r) = sld_in ,i.e., it crosses over flat function 
    299         Note that the 'sld_out' becaomes NULL in this case. 
     314        Note that the 'sld_out' becomes NULL in this case. 
    300315 
    301316        background:background, 
     
    312327# TODO: n is a volume parameter that is not polydisperse 
    313328 
     329# NOTE: Joachim Wuttke has suggested an alternative parameterisation 
     330#       in Ticket #1107 
     331 
    314332# pylint: disable=bad-whitespace, line-too-long 
    315333#   ["name", "units", default, [lower, upper], "type","description"], 
     
    318336    ["radius_core", "Ang", 200., [0, inf], "volume", "Radius of the core"], 
    319337    ["sld_solvent", "1e-6/Ang^2", 6.4, [-inf, inf], "sld", "Solvent scattering length density"], 
    320     ["n_shells", "", 1, [0, 10], "volume", "number of shells"], 
     338    ["n_shells", "", 1, [0, 10], "volume", "number of shells (must be integer)"], 
    321339    ["sld_in[n_shells]", "1e-6/Ang^2", 1.7, [-inf, inf], "sld", "scattering length density at the inner radius of shell k"], 
    322340    ["sld_out[n_shells]", "1e-6/Ang^2", 2.0, [-inf, inf], "sld", "scattering length density at the outer radius of shell k"], 
Note: See TracChangeset for help on using the changeset viewer.