[32c160a] | 1 | |
---|
| 2 | from numpy import pi, inf |
---|
| 3 | |
---|
| 4 | name = "CylinderModel" |
---|
| 5 | title = "Cylinder with uniform scattering length density" |
---|
[a7684e5] | 6 | description = """\ |
---|
| 7 | f(q)= 2*(sldCyl - sldSolv)*V*sin(qLcos(alpha/2)) |
---|
| 8 | /[qLcos(alpha/2)]*J1(qRsin(alpha/2))/[qRsin(alpha)] |
---|
| 9 | |
---|
| 10 | P(q,alpha)= scale/V*f(q)^(2)+background |
---|
| 11 | V: Volume of the cylinder |
---|
| 12 | R: Radius of the cylinder |
---|
| 13 | L: Length of the cylinder |
---|
| 14 | J1: The bessel function |
---|
| 15 | alpha: angle betweenthe axis of the |
---|
| 16 | cylinder and the q-vector for 1D |
---|
| 17 | :the ouput is P(q)=scale/V*integral |
---|
| 18 | from pi/2 to zero of... |
---|
| 19 | f(q)^(2)*sin(alpha)*dalpha+ bkg |
---|
| 20 | """ |
---|
| 21 | |
---|
[32c160a] | 22 | parameters = [ |
---|
| 23 | # [ "name", "units", default, [lower, upper], "type", |
---|
| 24 | # "description" ], |
---|
| 25 | [ "sldCyl", "1/Ang^2", 4e-6, [-inf,inf], "", |
---|
| 26 | "Cylinder scattering length density" ], |
---|
| 27 | [ "sldSolv", "1/Ang^2", 1e-6, [-inf,inf], "", |
---|
| 28 | "Solvent scattering length density" ], |
---|
| 29 | [ "radius", "Ang", 20, [0, inf], "volume", |
---|
| 30 | "Cylinder radius" ], |
---|
| 31 | [ "length", "Ang", 400, [0, inf], "volume", |
---|
| 32 | "Cylinder length" ], |
---|
| 33 | [ "cyl_theta", "degrees", 60, [-inf, inf], "orientation", |
---|
| 34 | "In plane angle" ], |
---|
| 35 | [ "cyl_phi", "degrees", 60, [-inf, inf], "orientation", |
---|
| 36 | "Out of plane angle" ], |
---|
| 37 | ] |
---|
[5d4777d] | 38 | source = [ "lib/J1.c", "lib/gauss76.c", "cylinder_clone.c" ] |
---|
[32c160a] | 39 | |
---|
| 40 | def ER(radius, length): |
---|
| 41 | ddd = 0.75*radius*(2*radius*length + (length+radius)*(length+pi*radius)) |
---|
| 42 | return 0.5 * (ddd)**(1./3.) |
---|
| 43 | |
---|