Ticket #289: L3 Sq_2peaks_Eq.1 modified.py

File L3 Sq_2peaks_Eq.1 modified.py, 1.1 KB (added by butler, 5 years ago)

Modified Equation 2 with 2 peaks

Line 
1
2from math import *
3import os
4import sys
5import numpy
6
7#name
8name = "L3_2x_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                ['B', '', 1, [-numpy.inf, numpy.inf], '', ''],
20                ['C', '', 1, [-numpy.inf, numpy.inf], '', ''],
21                ['q4', '', 0.1, [-numpy.inf, numpy.inf], '', ''],
22                ['CorrLength3', '', 40, [-numpy.inf, numpy.inf], '', ''],
23                ['CorrLength4', '', 20, [-numpy.inf, numpy.inf], '', ''],
24             ]
25
26
27def form_volume(*arg): 
28    return 1.0 
29
30def ER(*arg): 
31    return 1.0 
32
33def Iq(x , q3, B, C, q4, CorrLength3, CorrLength4):
34    if x > 0:
35
36        y = (B/((1/(CorrLength3**2)) + (x - q3)**2)) + (C/((1/(CorrLength4**2)) + (x - q4)**2))
37
38    else:
39
40        y = 1
41
42    return y
43
44def Iqxy(x, y , q3, B, C, q4, CorrLength3, CorrLength4):
45    return Iq(numpy.sqrt(x**2+y**2) , q3, B, C, q4, CorrLength3, CorrLength4)