Changeset 68532f3 in sasmodels for _sources/model/parallelepiped.txt
- Timestamp:
- Nov 1, 2015 4:10:22 PM (8 years ago)
- Branches:
- gh-pages
- Children:
- 4a9a316
- Parents:
- d1fe925
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
_sources/model/parallelepiped.txt
rd1fe925 r68532f3 1 # parallelepiped model 2 # Note: model title and parameter table are inserted automatically 3 r""" 1 .. _parallelepiped: 2 3 Parallelepiped 4 ======================================================= 5 6 Rectangular parallelepiped with uniform scattering length density. 7 8 =========== ==================================================== ============ ============= 9 Parameter Description Units Default value 10 =========== ==================================================== ============ ============= 11 scale Source intensity None 1 12 background Source background |cm^-1| 0 13 sld Parallelepiped scattering length density |1e-6Ang^-2| 4 14 solvent_sld Solvent scattering length density |1e-6Ang^-2| 1 15 a_side Shorter side of the parallelepiped |Ang| 35 16 b_side Second side of the parallelepiped |Ang| 75 17 c_side Larger side of the parallelepiped |Ang| 400 18 theta In plane angle degree 60 19 phi Out of plane angle degree 60 20 psi Rotation angle around its own c axis against q plane degree 60 21 =========== ==================================================== ============ ============= 22 23 The returned value is scaled to units of |cm^-1|. 24 25 4 26 The form factor is normalized by the particle volume. 5 27 … … 99 121 provided by the NIST Center for Neutron Research (Kline, 2006). 100 122 101 """102 123 103 from numpy import pi, inf, sqrt104 105 name = "parallelepiped"106 title = "Rectangular parallelepiped with uniform scattering length density."107 description = """108 P(q)= scale/V*integral from 0 to 1 of ...109 phi(mu*sqrt(1-sigma^2),a) * S(mu*c*sigma/2)^2 * dsigma110 111 phi(mu,a) = integral from 0 to 1 of ..112 (S((mu/2)*cos(pi*u/2))*S((mu*a/2)*sin(pi*u/2)))^2 * du113 S(x) = sin(x)/x114 mu = q*B115 """116 category = "shape:parallelpiped"117 118 # ["name", "units", default, [lower, upper], "type","description"],119 parameters = [["sld", "1e-6/Ang^2", 4, [-inf, inf], "",120 "Parallelepiped scattering length density"],121 ["solvent_sld", "1e-6/Ang^2", 1, [-inf, inf], "",122 "Solvent scattering length density"],123 ["a_side", "Ang", 35, [0, inf], "volume",124 "Shorter side of the parallelepiped"],125 ["b_side", "Ang", 75, [0, inf], "volume",126 "Second side of the parallelepiped"],127 ["c_side", "Ang", 400, [0, inf], "volume",128 "Larger side of the parallelepiped"],129 ["theta", "degrees", 60, [-inf, inf], "orientation",130 "In plane angle"],131 ["phi", "degrees", 60, [-inf, inf], "orientation",132 "Out of plane angle"],133 ["psi", "degrees", 60, [-inf, inf], "orientation",134 "Rotation angle around its own c axis against q plane"],135 ]136 137 source = ["lib/J1.c", "lib/gauss76.c", "parallelepiped.c"]138 139 def ER(a_side, b_side, c_side):140 141 # surface average radius (rough approximation)142 surf_rad = sqrt(a_side * b_side / pi)143 144 # DiamCyl recoded here (to check and possibly put in a library?)145 a = surf_rad146 b = 0.5 * c_side147 t1 = a * a * b148 t2 = 1.0 + (b / a) * (1.0 + a / b / 2.0) * (1.0 + pi * a / b / 2.0)149 ddd = 3.0 * t1 * t2150 151 return 0.5 * (ddd) ** (1. / 3.)152 153 # parameters for demo154 demo = dict(scale=1, background=0,155 sld=6.3e-6, solvent_sld=1.0e-6,156 a_side=35, b_side=75, c_side=400,157 theta=45, phi=30, psi=15,158 a_side_pd=0.1, a_side_pd_n=10,159 b_side_pd=0.1, b_side_pd_n=1,160 c_side_pd=0.1, c_side_pd_n=10,161 theta_pd=10, theta_pd_n=1,162 phi_pd=10, phi_pd_n=1,163 psi_pd=10, psi_pd_n=10)164 165 # For testing against the old sasview models, include the converted parameter166 # names and the target sasview model name.167 oldname = 'ParallelepipedModel'168 oldpars = dict(theta='parallel_theta', phi='parallel_phi', psi='parallel_psi',169 a_side='short_a', b_side='short_b', c_side='long_c',170 sld='sldPipe', solvent_sld='sldSolv')171
Note: See TracChangeset
for help on using the changeset viewer.