Changeset a7684e5 in sasmodels for sasmodels/models/cylinder.py
- Timestamp:
- Aug 26, 2014 9:07:44 AM (10 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:
- ff7119b
- Parents:
- 13d86bc
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/cylinder.py
r32c160a ra7684e5 1 # Note: model title and parameter table are inserted automatically 1 2 r""" 2 CylinderModel 3 ============= 4 5 This model provides the form factor for a right circular cylinder with uniform 6 scattering length density. The form factor is normalized by the particle volume. 3 The form factor is normalized by the particle volume. 7 4 8 5 For information about polarised and magnetic scattering, click here_. … … 38 35 .. _CylinderModel-orientation: 39 36 40 .. figure:: img/image061.JPG 37 .. figure:: img/image061.JPG (should be img/cylinder-1.jpg, or img/cylinder-orientation.jpg) 41 38 42 39 Definition of the angles for oriented cylinders. … … 49 46 radius and length values, and used as the effective radius for $S(Q)$ 50 47 when $P(Q) \cdot S(Q)$ is applied. 51 52 The returned value is scaled to units of |cm^-1| and the parameters of53 the CylinderModel are the following:54 55 %(parameters)s56 48 57 49 The output of the 1D scattering intensity function for randomly oriented … … 67 59 use the c-library from NIST. 68 60 69 Validation of the CylinderModel70 ---------- ---------------------61 Validation 62 ---------- 71 63 72 64 Validation of our code was done by comparing the output of the 1D model … … 116 108 from numpy import pi, inf 117 109 110 name = "cylinder" 111 title = "Right circular cylinder with uniform scattering length density." 112 description = """ 113 f(q)= 2*(sldCyl - sldSolv)*V*sin(qLcos(alpha/2)) 114 /[qLcos(alpha/2)]*J1(qRsin(alpha/2))/[qRsin(alpha)] 115 116 P(q,alpha)= scale/V*f(q)^(2)+background 117 V: Volume of the cylinder 118 R: Radius of the cylinder 119 L: Length of the cylinder 120 J1: The bessel function 121 alpha: angle betweenthe axis of the 122 cylinder and the q-vector for 1D 123 :the ouput is P(q)=scale/V*integral 124 from pi/2 to zero of... 125 f(q)^(2)*sin(alpha)*dalpha+ bkg 126 """ 127 128 parameters = [ 129 # [ "name", "units", default, [lower, upper], "type", 130 # "description" ], 131 [ "sld", "1e-6/Ang^2", 4, [-inf,inf], "", 132 "Cylinder scattering length density" ], 133 [ "solvent_sld", "1e-6/Ang^2", 1, [-inf,inf], "", 134 "Solvent scattering length density" ], 135 [ "radius", "Ang", 20, [0, inf], "volume", 136 "Cylinder radius" ], 137 [ "length", "Ang", 400, [0, inf], "volume", 138 "Cylinder length" ], 139 [ "theta", "degrees", 60, [-inf, inf], "orientation", 140 "In plane angle" ], 141 [ "phi", "degrees", 60, [-inf, inf], "orientation", 142 "Out of plane angle" ], 143 ] 144 145 source = [ "lib/J1.c", "lib/gauss76.c", "lib/cylkernel.c", "cylinder.c"] 146 118 147 def ER(radius, length): 119 148 ddd = 0.75*radius*(2*radius*length + (length+radius)*(length+pi*radius)) 120 149 return 0.5 * (ddd)**(1./3.) 121 150 122 INFO = {123 "name": "cylinder",124 "title": "Cylinder with uniform scattering length density",125 "source": [ "lib/J1.c", "lib/gauss76.c", "lib/cylkernel.c", "cylinder.c"],126 "parameters": [127 # [ "name", "units", default, [lower, upper], "type",128 # "description" ],129 [ "sld", "1e-6/Ang^2", 4, [-inf,inf], "",130 "Cylinder scattering length density" ],131 [ "solvent_sld", "1e-6/Ang^2", 1, [-inf,inf], "",132 "Solvent scattering length density" ],133 [ "radius", "Ang", 20, [0, inf], "volume",134 "Cylinder radius" ],135 [ "length", "Ang", 400, [0, inf], "volume",136 "Cylinder length" ],137 [ "theta", "degrees", 60, [-inf, inf], "orientation",138 "In plane angle" ],139 [ "phi", "degrees", 60, [-inf, inf], "orientation",140 "Out of plane angle" ],141 ],142 "description": """143 f(q)= 2*(sldCyl - sldSolv)*V*sin(qLcos(alpha/2))144 /[qLcos(alpha/2)]*J1(qRsin(alpha/2))/[qRsin(alpha)]145 146 P(q,alpha)= scale/V*f(q)^(2)+background147 V: Volume of the cylinder148 R: Radius of the cylinder149 L: Length of the cylinder150 J1: The bessel function151 alpha: angle betweenthe axis of the152 cylinder and the q-vector for 1D153 :the ouput is P(q)=scale/V*integral154 from pi/2 to zero of...155 f(q)^(2)*sin(alpha)*dalpha+ bkg156 """,157 "ER": ER,158 }159
Note: See TracChangeset
for help on using the changeset viewer.