Changeset 01eece6 in sasmodels


Ignore:
Timestamp:
Mar 19, 2016 5:24:04 AM (8 years ago)
Author:
richardh
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:
787be86
Parents:
f3d7abd
Message:

renamed params, checked docs, some cylinder models

Location:
sasmodels/models
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/core_shell_cylinder.py

    rf4878dc r01eece6  
    1212.. math:: 
    1313 
    14     P(q,\alpha) = \frac{\text{scale}}{V_s} F^2(q) + \text{background} 
     14    I(q,\alpha) = \frac{\text{scale}}{V_s} F^2(q) + \text{background} 
    1515 
    1616where 
     
    5252 
    5353To provide easy access to the orientation of the core-shell cylinder, we 
    54 define the axis of the cylinder using two angles $\theta$ and $\phi$. As 
    55 for the case of the cylinder, those angles are defined in 
    56 :num:`figure #cylinder-orientation`. 
     54define the axis of the cylinder using two angles $\theta$ and $\phi$.  
     55(see :ref:`cylinder model <cylinder-angle-definition>`) 
    5756 
    5857NB: The 2nd virial coefficient of the cylinder is calculated based on 
     
    7473distribution $p(\theta,\phi) = 1.0$. 
    7574 
    76 2013/11/26 - Description reviewed by Heenan, R. 
     75Reference 
     76--------- 
     77see, for example, Ian Livsey  J. Chem. Soc., Faraday Trans. 2, 1987,83, 1445-1452 
     78 
     792016/03/18 - Description reviewed by RKH 
    7780""" 
    7881 
     
    8386description = """ 
    8487P(q,alpha)= scale/Vs*f(q)^(2) + background, 
    85       where: f(q)= 2(core_sld - solvant_sld) 
     88      where: f(q)= 2(sld_core - solvant_sld) 
    8689        * Vc*sin[qLcos(alpha/2)] 
    8790        /[qLcos(alpha/2)]*J1(qRsin(alpha)) 
    88         /[qRsin(alpha)]+2(shell_sld-solvent_sld) 
     91        /[qRsin(alpha)]+2(sld_shell-sld_solvent) 
    8992        *Vs*sin[q(L+T)cos(alpha/2)][[q(L+T) 
    9093        *cos(alpha/2)]*J1(q(R+T)sin(alpha)) 
     
    9699    Vc: the volume of the core 
    97100    L: the length of the core 
    98         shell_sld: the scattering length density of the shell 
    99     solvent_sld: the scattering length density of the solvent 
     101        sld_shell: the scattering length density of the shell 
     102    sld_solvent: the scattering length density of the solvent 
    100103    background: the background 
    101104    T: the thickness 
     
    109112 
    110113#             ["name", "units", default, [lower, upper], "type", "description"], 
    111 parameters = [["core_sld", "1e-6/Ang^2", 4, [-inf, inf], "", 
     114parameters = [["sld_core", "1e-6/Ang^2", 4, [-inf, inf], "", 
    112115               "Cylinder core scattering length density"], 
    113               ["shell_sld", "1e-6/Ang^2", 4, [-inf, inf], "", 
     116              ["sld_shell", "1e-6/Ang^2", 4, [-inf, inf], "", 
    114117               "Cylinder shell scattering length density"], 
    115               ["solvent_sld", "1e-6/Ang^2", 1, [-inf, inf], "", 
     118              ["sld_solvent", "1e-6/Ang^2", 1, [-inf, inf], "", 
    116119               "Solvent scattering length density"], 
    117120              ["radius", "Ang", 20, [0, inf], "volume", 
     
    147150 
    148151demo = dict(scale=1, background=0, 
    149             core_sld=6, shell_sld=8, solvent_sld=1, 
     152            sld_core=6, sld_shell=8, sld_solvent=1, 
    150153            radius=45, thickness=25, length=340, 
    151154            theta=30, phi=15, 
     
    156159            phi_pd=15, phi_pd_n=1) 
    157160oldname = 'CoreShellCylinderModel' 
    158 oldpars = dict(theta='axis_theta', phi='axis_phi') 
     161oldpars = dict( sld_core='core_sld', 
     162               sld_shell='shell_sld', 
     163               sld_solvent='solvent_sld', 
     164               theta='axis_theta', phi='axis_phi') 
     165# ADDED by:  RKH  ON: 18Mar2016 renamed sld's etc 
  • sasmodels/models/cylinder.py

    raa2edb2 r01eece6  
    22# Note: model title and parameter table are inserted automatically 
    33r""" 
    4 The form factor is normalized by the particle volume. 
     4The form factor is normalized by the particle volume V = \piR^2L. 
    55 
    66Definition 
     
    1919 
    2020    F(q) = 2 (\Delta \rho) V 
    21            \frac{\sin \left(q\tfrac12 L\cos\alpha \right)} 
    22                 {q\tfrac12 L \cos \alpha} 
     21           \frac{\sin \left(\tfrac12 qL\cos\alpha \right)} 
     22                {\tfrac12 qL \cos \alpha} 
    2323           \frac{J_1 \left(q R \sin \alpha\right)}{q R \sin \alpha} 
    2424 
     
    8888title = "Right circular cylinder with uniform scattering length density." 
    8989description = """ 
    90      f(q,alpha) = 2*(sld - solvent_sld)*V*sin(qLcos(alpha/2)) 
    91                 /[qLcos(alpha/2)]*J1(qRsin(alpha/2))/[qRsin(alpha)] 
     90     f(q,alpha) = 2*(sld - sld_solvent)*V*sin(qLcos(alpha)/2)) 
     91                /[qLcos(alpha)/2]*J1(qRsin(alpha))/[qRsin(alpha)] 
    9292 
    9393            P(q,alpha)= scale/V*f(q,alpha)^(2)+background 
     
    107107parameters = [["sld", "4e-6/Ang^2", 4, [-inf, inf], "", 
    108108               "Cylinder scattering length density"], 
    109               ["solvent_sld", "1e-6/Ang^2", 1, [-inf, inf], "", 
     109              ["sld_solvent", "1e-6/Ang^2", 1, [-inf, inf], "", 
    110110               "Solvent scattering length density"], 
    111111              ["radius", "Ang", 20, [0, inf], "volume", 
     
    130130# parameters for demo 
    131131demo = dict(scale=1, background=0, 
    132             sld=6, solvent_sld=1, 
     132            sld=6, sld_solvent=1, 
    133133            radius=20, length=300, 
    134134            theta=60, phi=60, 
     
    141141# names and the target sasview model name. 
    142142oldname = 'CylinderModel' 
    143 oldpars = dict(theta='cyl_theta', phi='cyl_phi', sld='sldCyl', solvent_sld='sldSolv') 
     143oldpars = dict(theta='cyl_theta', phi='cyl_phi', sld='sldCyl', sld_solvent='sldSolv') 
    144144 
    145145 
     
    151151        ] 
    152152del qx, qy  # not necessary to delete, but cleaner 
     153# ADDED by:  RKH  ON: 18Mar2016 renamed sld's etc 
  • sasmodels/models/hollow_cylinder.py

    r2f0c07d r01eece6  
    3131    J_1(x)         &= (\sin(x)-x\cdot \cos(x)) / x^2 
    3232 
    33 where *scale* is a scale factor and $J_1$ is the 1st order 
     33where *scale* is a scale factor, $H = L/2$ and $J_1$ is the 1st order 
    3434Bessel function. 
    3535 
     
    6262length = the total length of the cylinder 
    6363sld = SLD of the shell 
    64 solvent_sld = SLD of the solvent 
     64sld_solvent = SLD of the solvent 
    6565background = incoherent background 
    6666""" 
     
    7373    ["length",      "Ang",    400.0, [0, inf],    "volume",      "Cylinder length"], 
    7474    ["sld",         "1/Ang^2",  6.3, [-inf, inf], "",            "Cylinder sld"], 
    75     ["solvent_sld", "1/Ang^2",  1,   [-inf, inf], "",            "Solvent sld"], 
     75    ["sld_solvent", "1/Ang^2",  1,   [-inf, inf], "",            "Solvent sld"], 
    7676    ["theta",       "degrees", 90,   [-360, 360], "orientation", "Theta angle"], 
    7777    ["phi",         "degrees",  0,   [-360, 360], "orientation", "Phi angle"], 
     
    113113# parameters for demo 
    114114demo = dict(scale=1.0, background=0.0, length=400.0, radius=30.0, 
    115             core_radius=20.0, sld=6.3, solvent_sld=1, theta=90, phi=0, 
     115            core_radius=20.0, sld=6.3, sld_solvent=1, theta=90, phi=0, 
    116116            radius_pd=.2, radius_pd_n=9, 
    117117            length_pd=.2, length_pd_n=10, 
     
    125125oldpars = dict(scale='scale', background='background', radius='radius', 
    126126               core_radius='core_radius', sld='sldCyl', length='length', 
    127                solvent_sld='sldSolv', phi='axis_phi', theta='axis_theta') 
     127               sld_solvent='sldSolv', phi='axis_phi', theta='axis_theta') 
    128128 
    129129# Parameters for unit tests 
Note: See TracChangeset for help on using the changeset viewer.