Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/multilayer_vesicle.py

    r68f45cb r925ad6e  
    55This model is a trivial extension of the core_shell_sphere function to include 
    66*N* shells where the core is filled with solvent and the shells are interleaved 
    7 with layers of solvent. For $N = 1$, this returns the same as the vesicle model, 
     7with layers of solvent. For *N = 1*, this returns the same as the vesicle model, 
    88except for the normalisation, which here is to outermost volume. 
    99The shell thicknessess and SLD are constant for all shells as expected for 
     
    1919 
    2020.. math:: 
    21     P(q) = \text{scale} \cdot \frac{\phi}{V(R_N)} F^2(q) + \text{background} 
     21 
     22    P(q) = \frac{\text{scale.volfraction}}{V_t} F^2(q) + \text{background} 
    2223 
    2324where 
    2425 
    2526.. math:: 
    26      F(q) = (\rho_\text{shell}-\rho_\text{solv}) \sum_{i=1}^{N} \left[ 
    27      3V(r_i)\frac{\sin(qr_i) - qr_i\cos(qr_i)}{(qr_i)^3} 
    28      - 3V(R_i)\frac{\sin(qR_i) - qR_i\cos(qR_i)}{(qR_i)^3} 
     27 
     28     F(q) = (\rho_{shell}-\rho_{solv}) \sum_{i=1}^{n\_pairs} \left[ 
     29     3V(R_i)\frac{\sin(qR_i)-qR_i\cos(qR_i)}{(qR_i)^3} \\ 
     30      - 3V(R_i+t_s)\frac{\sin(q(R_i+t_s))-q(R_i+t_s)\cos(q(R_i+t_s))}{(q(R_i+t_s))^3} 
    2931     \right] 
    3032 
    31 for 
    3233 
    33 .. math:: 
     34where $R_i = r_c + (i-1)(t_s + t_w)$ 
     35    
     36where $V_t$ is the volume of the whole particle, $V(R)$ is the volume of a sphere 
     37of radius $R$, $r_c$ is the radius of the core, $\rho_{shell}$ is the scattering length  
     38density of a shell, $\rho_{solv}$ is the scattering length density of the solvent. 
    3439 
    35      r_i &= r_c + (i-1)(t_s + t_w) && \text{ solvent radius before shell } i \\ 
    36      R_i &= r_i + t_s && \text{ shell radius for shell } i 
    37  
    38 $\phi$ is the volume fraction of particles, $V(r)$ is the volume of a sphere 
    39 of radius $r$, $r_c$ is the radius of the core, $t_s$ is the thickness of 
    40 the shell, $t_w$ is the thickness of the solvent layer between the shells, 
    41 $\rho_\text{shell}$ is the scattering length density of a shell, and 
    42 $\rho_\text{solv}$ is the scattering length density of the solvent. 
    43  
    44 The outer-most shell radius $R_N$ is used as the effective radius 
    45 for $P(Q)$ when $P(Q) * S(Q)$ is applied. 
    46  
    47 For mixed systems in which some vesicles have 1 shell, some have 2, 
    48 etc., use polydispersity on $N$ to model the data.  For example, 
    49 create a file such as *shell_dist.txt* containing the relative portion 
    50 of each vesicle size:: 
    51  
    52     1 20 
    53     2  4 
    54     3  1 
    55  
    56 Turn on polydispersity and select an array distribution for the *n_shells* 
    57 parameter.  Choose the above *shell_dist.txt* file, and the model will be 
    58 computed with 80% 1-shell vesicles, 16% 2-shell vesicles and 4% 
    59 3-shell vesicles. 
    6040 
    6141The 2D scattering intensity is the same as 1D, regardless of the orientation 
     
    6545 
    6646    q = \sqrt{q_x^2 + q_y^2} 
     47 
     48 
     49The outer most radius 
     50 
     51$radius + n\_pairs * thick\_shell + (n\_pairs- 1) * thick\_solvent$ 
     52 
     53is used for both the volume fraction normalization and for the  
     54effective radius for *S(Q)* when $P(Q) * S(Q)$ is applied. 
    6755 
    6856For information about polarised and magnetic scattering, see 
     
    8270**Author:** NIST IGOR/DANSE **on:** pre 2010 
    8371 
    84 **Last Modified by:** Piotr Rozyczko **on:** Feb 24, 2016 
     72**Last Modified by:** Piotr Rozyczko**on:** Feb 24, 2016 
    8573 
    8674**Last Reviewed by:** Paul Butler **on:** March 20, 2016 
     
    10189    sld_solvent: solvent scattering length density 
    10290    sld: shell scattering length density 
    103     n_shells:number of "shell plus solvent" layer pairs 
     91    n_pairs:number of "shell plus solvent" layer pairs 
    10492    background: incoherent background 
    10593        """ 
     
    11098parameters = [ 
    11199    ["volfraction", "",  0.05, [0.0, 1],  "", "volume fraction of vesicles"], 
    112     ["radius", "Ang", 60.0, [0.0, inf],  "volume", "radius of solvent filled core"], 
    113     ["thick_shell", "Ang",        10.0, [0.0, inf],  "volume", "thickness of one shell"], 
    114     ["thick_solvent", "Ang",        10.0, [0.0, inf],  "volume", "solvent thickness between shells"], 
     100    ["radius", "Ang", 60.0, [0.0, inf],  "", "radius of solvent filled core"], 
     101    ["thick_shell", "Ang",        10.0, [0.0, inf],  "", "thickness of one shell"], 
     102    ["thick_solvent", "Ang",        10.0, [0.0, inf],  "", "solvent thickness between shells"], 
    115103    ["sld_solvent",    "1e-6/Ang^2",  6.4, [-inf, inf], "sld", "solvent scattering length density"], 
    116104    ["sld",   "1e-6/Ang^2",  0.4, [-inf, inf], "sld", "Shell scattering length density"], 
    117     ["n_shells",     "",            2.0, [1.0, inf],  "volume", "Number of shell plus solvent layer pairs"], 
     105    ["n_pairs",     "",            2.0, [1.0, inf],  "", "Number of shell plus solvent layer pairs"], 
    118106    ] 
    119107# pylint: enable=bad-whitespace, line-too-long 
    120108 
    121 # TODO: proposed syntax for specifying which parameters can be polydisperse 
    122 #polydispersity = ["radius", "thick_shell"] 
    123  
    124109source = ["lib/sas_3j1x_x.c", "multilayer_vesicle.c"] 
    125110 
    126 def ER(radius, thick_shell, thick_solvent, n_shells): 
    127     n_shells = int(n_shells+0.5) 
    128     return radius + n_shells * (thick_shell + thick_solvent) - thick_solvent 
     111polydispersity = ["radius", "n_pairs"] 
    129112 
    130113demo = dict(scale=1, background=0, 
     
    135118            sld_solvent=6.4, 
    136119            sld=0.4, 
    137             n_shells=2.0) 
     120            n_pairs=2.0) 
    138121 
    139122tests = [ 
     
    144127      'sld_solvent': 6.4, 
    145128      'sld': 0.4, 
    146       'n_shells': 2.0, 
     129      'n_pairs': 2.0, 
    147130      'scale': 1.0, 
    148131      'background': 0.001, 
     
    155138      'sld_solvent': 6.4, 
    156139      'sld': 0.4, 
    157       'n_shells': 2.0, 
     140      'n_pairs': 2.0, 
    158141      'scale': 1.0, 
    159142      'background': 0.001, 
Note: See TracChangeset for help on using the changeset viewer.