Ticket #289: L3 Sq_1peak_Eq.1 modified.py

File L3 Sq_1peak_Eq.1 modified.py, 713 bytes (added by butler, 5 years ago)

Modified Equation 1 with one peak

Line 
1
2from math import *
3import os
4import sys
5import numpy
6
7#name
8name = "L3_B_Sq" 
9
10#title
11title = "User model for L3_Sq"
12
13#description
14description = "Lei et al. structure factor_Porte et al."
15
16#parameters
17parameters = [ 
18                ['q3', '', 0.05, [-numpy.inf, numpy.inf], '', ''],
19                ['CorrLength3', '', 40, [-numpy.inf, numpy.inf], '', ''],
20             ]
21
22
23def form_volume(*arg): 
24    return 1.0 
25
26def ER(*arg): 
27    return 1.0 
28
29def Iq(x , q3, CorrLength3):
30    if x > 0:
31
32        y = 1/((1/(CorrLength3**2)) + (x - q3)**2)
33
34    else:
35
36        y = 1
37
38    return y
39
40def Iqxy(x, y , q3, CorrLength3):
41    return Iq(numpy.sqrt(x**2+y**2) , q3, CorrLength3)