Ticket #1142: L3_Porcar_et_alNEW.py

File L3_Porcar_et_alNEW.py, 1.5 KB (added by butler, 6 years ago)

New version of Maria's model

Line 
1r"""
2Definition
3----------
4
5Calculates L3_Porcar_et_alNEW.
6
7Form factor of discoids averaged over random orientations
8
9References
10----------
11
12Authorship and Verification
13---------------------------
14
15* **Author:** --- **Date:** 2018YYY-08m-07d
16* **Last Modified by:** --- **Date:** 2018YYY-08m-07d
17* **Last Reviewed by:** --- **Date:** 2018YYY-08m-07d
18"""
19
20from math import *
21from numpy import inf
22
23name = "L3_Porcar_et_alNEW"
24title = "User model for L3_Porcar_et_alNEW"
25description = """Form factor of discoids averaged over random orientations"""
26
27parameters = [ 
28#   ["name", "units", default, [lower, upper], "type", "description"],
29    ['sld_solv', '', 6.35, [-inf, inf], '', ''],
30    ['sld_L3', '', 0.8, [-inf, inf], '', ''],
31    ['thickness', '', 300, [-inf, inf], '', ''],
32    ['radii', '', 700, [-inf, inf], '', ''],
33    ]
34
35def Iq(x, sld_solv, sld_L3, thickness, radii):
36    """Absolute scattering"""
37    if x > 0:
38
39        y = 4*(pi*(radii**2)*((sld_L3 - sld_solv)**2))*((1 - cos(x*thickness)*exp(- (x**2)*(thickness**2)/32))/(x**2))/((x**2)*(radii**2) + 2*exp(- (x**2)*(radii**2)/6))
40
41    else:
42
43        y= 1
44
45    return y
46## uncomment the following if Iq works for vector x
47#Iq.vectorized = True
48
49#def Iqxy(x, y, sld_solv, sld_L3, thickness, radii):
50#    """Absolute scattering of oriented particles."""
51#    ...
52#    return oriented_form(x, y, args)
53## uncomment the following if Iqxy works for vector x, y
54#Iqxy.vectorized = True