Changeset 01eece6 in sasmodels
- Timestamp:
- Mar 19, 2016 7:24:04 AM (9 years ago)
- 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
- Location:
- sasmodels/models
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/core_shell_cylinder.py
rf4878dc r01eece6 12 12 .. math:: 13 13 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} 15 15 16 16 where … … 52 52 53 53 To 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`. 54 define the axis of the cylinder using two angles $\theta$ and $\phi$. 55 (see :ref:`cylinder model <cylinder-angle-definition>`) 57 56 58 57 NB: The 2nd virial coefficient of the cylinder is calculated based on … … 74 73 distribution $p(\theta,\phi) = 1.0$. 75 74 76 2013/11/26 - Description reviewed by Heenan, R. 75 Reference 76 --------- 77 see, for example, Ian Livsey J. Chem. Soc., Faraday Trans. 2, 1987,83, 1445-1452 78 79 2016/03/18 - Description reviewed by RKH 77 80 """ 78 81 … … 83 86 description = """ 84 87 P(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) 86 89 * Vc*sin[qLcos(alpha/2)] 87 90 /[qLcos(alpha/2)]*J1(qRsin(alpha)) 88 /[qRsin(alpha)]+2(s hell_sld-solvent_sld)91 /[qRsin(alpha)]+2(sld_shell-sld_solvent) 89 92 *Vs*sin[q(L+T)cos(alpha/2)][[q(L+T) 90 93 *cos(alpha/2)]*J1(q(R+T)sin(alpha)) … … 96 99 Vc: the volume of the core 97 100 L: the length of the core 98 s hell_sld: the scattering length density of the shell99 s olvent_sld: the scattering length density of the solvent101 sld_shell: the scattering length density of the shell 102 sld_solvent: the scattering length density of the solvent 100 103 background: the background 101 104 T: the thickness … … 109 112 110 113 # ["name", "units", default, [lower, upper], "type", "description"], 111 parameters = [[" core_sld", "1e-6/Ang^2", 4, [-inf, inf], "",114 parameters = [["sld_core", "1e-6/Ang^2", 4, [-inf, inf], "", 112 115 "Cylinder core scattering length density"], 113 ["s hell_sld", "1e-6/Ang^2", 4, [-inf, inf], "",116 ["sld_shell", "1e-6/Ang^2", 4, [-inf, inf], "", 114 117 "Cylinder shell scattering length density"], 115 ["s olvent_sld", "1e-6/Ang^2", 1, [-inf, inf], "",118 ["sld_solvent", "1e-6/Ang^2", 1, [-inf, inf], "", 116 119 "Solvent scattering length density"], 117 120 ["radius", "Ang", 20, [0, inf], "volume", … … 147 150 148 151 demo = 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, 150 153 radius=45, thickness=25, length=340, 151 154 theta=30, phi=15, … … 156 159 phi_pd=15, phi_pd_n=1) 157 160 oldname = 'CoreShellCylinderModel' 158 oldpars = dict(theta='axis_theta', phi='axis_phi') 161 oldpars = 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 2 2 # Note: model title and parameter table are inserted automatically 3 3 r""" 4 The form factor is normalized by the particle volume .4 The form factor is normalized by the particle volume V = \piR^2L. 5 5 6 6 Definition … … 19 19 20 20 F(q) = 2 (\Delta \rho) V 21 \frac{\sin \left( q\tfrac12L\cos\alpha \right)}22 { q\tfrac12L \cos \alpha}21 \frac{\sin \left(\tfrac12 qL\cos\alpha \right)} 22 {\tfrac12 qL \cos \alpha} 23 23 \frac{J_1 \left(q R \sin \alpha\right)}{q R \sin \alpha} 24 24 … … 88 88 title = "Right circular cylinder with uniform scattering length density." 89 89 description = """ 90 f(q,alpha) = 2*(sld - s olvent_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)] 92 92 93 93 P(q,alpha)= scale/V*f(q,alpha)^(2)+background … … 107 107 parameters = [["sld", "4e-6/Ang^2", 4, [-inf, inf], "", 108 108 "Cylinder scattering length density"], 109 ["s olvent_sld", "1e-6/Ang^2", 1, [-inf, inf], "",109 ["sld_solvent", "1e-6/Ang^2", 1, [-inf, inf], "", 110 110 "Solvent scattering length density"], 111 111 ["radius", "Ang", 20, [0, inf], "volume", … … 130 130 # parameters for demo 131 131 demo = dict(scale=1, background=0, 132 sld=6, s olvent_sld=1,132 sld=6, sld_solvent=1, 133 133 radius=20, length=300, 134 134 theta=60, phi=60, … … 141 141 # names and the target sasview model name. 142 142 oldname = 'CylinderModel' 143 oldpars = dict(theta='cyl_theta', phi='cyl_phi', sld='sldCyl', s olvent_sld='sldSolv')143 oldpars = dict(theta='cyl_theta', phi='cyl_phi', sld='sldCyl', sld_solvent='sldSolv') 144 144 145 145 … … 151 151 ] 152 152 del 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 31 31 J_1(x) &= (\sin(x)-x\cdot \cos(x)) / x^2 32 32 33 where *scale* is a scale factor and $J_1$ is the 1st order33 where *scale* is a scale factor, $H = L/2$ and $J_1$ is the 1st order 34 34 Bessel function. 35 35 … … 62 62 length = the total length of the cylinder 63 63 sld = SLD of the shell 64 s olvent_sld= SLD of the solvent64 sld_solvent = SLD of the solvent 65 65 background = incoherent background 66 66 """ … … 73 73 ["length", "Ang", 400.0, [0, inf], "volume", "Cylinder length"], 74 74 ["sld", "1/Ang^2", 6.3, [-inf, inf], "", "Cylinder sld"], 75 ["s olvent_sld", "1/Ang^2", 1, [-inf, inf], "", "Solvent sld"],75 ["sld_solvent", "1/Ang^2", 1, [-inf, inf], "", "Solvent sld"], 76 76 ["theta", "degrees", 90, [-360, 360], "orientation", "Theta angle"], 77 77 ["phi", "degrees", 0, [-360, 360], "orientation", "Phi angle"], … … 113 113 # parameters for demo 114 114 demo = dict(scale=1.0, background=0.0, length=400.0, radius=30.0, 115 core_radius=20.0, sld=6.3, s olvent_sld=1, theta=90, phi=0,115 core_radius=20.0, sld=6.3, sld_solvent=1, theta=90, phi=0, 116 116 radius_pd=.2, radius_pd_n=9, 117 117 length_pd=.2, length_pd_n=10, … … 125 125 oldpars = dict(scale='scale', background='background', radius='radius', 126 126 core_radius='core_radius', sld='sldCyl', length='length', 127 s olvent_sld='sldSolv', phi='axis_phi', theta='axis_theta')127 sld_solvent='sldSolv', phi='axis_phi', theta='axis_theta') 128 128 129 129 # Parameters for unit tests
Note: See TracChangeset
for help on using the changeset viewer.