Changeset 745b7bb in sasmodels for sasmodels/models/spherical_sld.py


Ignore:
Timestamp:
Aug 4, 2016 9:32:17 PM (8 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
4e0968b
Parents:
54bcd4a
Message:

spherical sld: doc cleanup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/spherical_sld.py

    r54bcd4a r745b7bb  
    11r""" 
    2 This model calculates an empirical functional form for SAS data using 
    3 SpericalSLD profile 
    4  
    5 Similarly to the OnionExpShellModel, this model provides the form factor, 
    6 P(q), for a multi-shell sphere, where the interface between the each neighboring 
    7 shells can be described by one of a number of functions including error, 
    8 power-law, and exponential functions. 
    9 This model is to calculate the scattering intensity by building a continuous 
    10 custom SLD profile against the radius of the particle. 
    11 The SLD profile is composed of a flat core, a flat solvent, a number (up to 9 ) 
    12 flat shells, and the interfacial layers between the adjacent flat shells 
    13 (or core, and solvent) (see below). 
    14  
    15 .. figure:: img/spherical_sld_profile.gif 
    16  
    17     Exemplary SLD profile 
     2Similarly to the onion, this model provides the form factor, $P(q)$, for 
     3a multi-shell sphere, where the interface between the each neighboring 
     4shells can be described by the error function, power-law, or exponential 
     5functions.  The scattering intensity is computed by building a continuous 
     6custom SLD profile along the radius of the particle. The SLD profile is 
     7composed of a number of uniform shells with interfacial shells between them. 
     8 
     9.. figure:: img/spherical_sld_profile.png 
     10 
     11    Example SLD profile 
    1812 
    1913Unlike the <onion> model (using an analytical integration), the interfacial 
    20 layers here are sub-divided and numerically integrated assuming each of the 
    21 sub-layers are described by a line function. 
    22 The number of the sub-layer can be given by users by setting the integer values 
    23 of npts_inter. The form factor is normalized by the total volume of the sphere. 
     14shells here are sub-divided and numerically integrated assuming each 
     15sub-shell is described by a line function, with *n_steps* sub-shells per 
     16interface. The form factor is normalized by the total volume of the sphere. 
    2417 
    2518Definition 
     
    4235 
    4336 
    44 so that individual terms can be calcualted as follows: 
     37so that individual terms can be calculated as follows: 
    4538 
    4639.. math:: 
     
    7265 
    7366 
    74 Here we assumed that the SLDs of the core and solvent are constant against $r$. 
     67Here we assumed that the SLDs of the core and solvent are constant in $r$. 
    7568The SLD at the interface between shells, $\rho_{\text {inter}_i}$ 
    7669is calculated with a function chosen by an user, where the functions are 
     
    107100The functions are normalized so that they vary between 0 and 1, and they are 
    108101constrained such that the SLD is continuous at the boundaries of the interface 
    109 as well as each sub-layers. Thus B and C are determined. 
    110  
    111 Once $\rho_{\text{inter}_i}$ is found at the boundary of the sub-layer of the 
     102as well as each sub-shell. Thus B and C are determined. 
     103 
     104Once $\rho_{\text{inter}_i}$ is found at the boundary of the sub-shell of the 
    112105interface, we can find its contribution to the form factor $P(q)$ 
    113106 
     
    121114    4 \pi \sum_{j=0}^{npts_{\text{inter}_i} -1 } \Big[ 
    122115    3 ( \rho_{ \text{inter}_i } ( r_{j+1} ) - \rho_{ \text{inter}_i } 
    123     ( r_{j} ) V ( r_{ \text{sublayer}_j } ) 
     116    ( r_{j} ) V ( r_{ \text{subshell}_j } ) 
    124117    \Big[ \frac {r_j^2 \beta_\text{out}^2 \sin(\beta_\text{out}) 
    125118    - (\beta_\text{out}^2-2) \cos(\beta_\text{out}) } 
     
    127120 
    128121    - 3 ( \rho_{ \text{inter}_i } ( r_{j+1} ) - \rho_{ \text{inter}_i } 
    129     ( r_{j} ) V ( r_{ \text{sublayer}_j-1 } ) 
     122    ( r_{j} ) V ( r_{ \text{subshell}_j-1 } ) 
    130123    \Big[ \frac {r_{j-1}^2 \sin(\beta_\text{in}) 
    131124    - (\beta_\text{in}^2-2) \cos(\beta_\text{in}) } 
     
    152145 
    153146 
    154 We assume the $\rho_{\text{inter}_i} (r)$ can be approximately linear 
    155 within a sub-layer $j$ 
    156  
    157 Finally form factor can be calculated by 
     147We assume $\rho_{\text{inter}_j} (r)$ is approximately linear 
     148within the sub-shell $j$. 
     149 
     150Finally the form factor can be calculated by 
    158151 
    159152.. math:: 
     
    169162    q = \sqrt{q_x^2 + q_y^2} 
    170163 
    171  
    172 .. figure:: img/spherical_sld_1d.jpg 
    173  
    174     1D plot using the default values (w/400 data point). 
    175  
    176 .. figure:: img/spherical_sld_default_profile.jpg 
    177  
    178     SLD profile from the default values. 
    179  
    180164.. note:: 
     165 
    181166    The outer most radius is used as the effective radius for S(Q) 
    182167    when $P(Q) * S(Q)$ is applied. 
     
    206191# pylint: disable=bad-whitespace, line-too-long 
    207192#            ["name", "units", default, [lower, upper], "type", "description"], 
    208 parameters = [["n_shells",             "",           1,      [1, 11],        "volume", "number of shells"], 
     193parameters = [["n_shells",             "",           1,      [1, 10],        "volume", "number of shells"], 
    209194              ["sld_solvent",          "1e-6/Ang^2", 1.0,    [-inf, inf],    "sld", "solvent sld"], 
    210195              ["sld[n_shells]",        "1e-6/Ang^2", 4.06,   [-inf, inf],    "sld", "sld of the shell"], 
     
    258243    rho.append(sld_solvent) 
    259244    # return sld profile (r, beta) 
    260     return np.asarray(z), np.asarray(rho)*1e-6 
     245    return np.asarray(z), np.asarray(rho) 
    261246 
    262247 
Note: See TracChangeset for help on using the changeset viewer.