Commit bbd7e23e authored by Gonzalez, Miguel's avatar Gonzalez, Miguel

Added new QENS model

parent 7a72731c
......@@ -1974,6 +1974,23 @@ case uv[0] of
Pexplain[12] = 'Rotational diffusion constant (in E units)'
end
;QENS_Mix2
97: begin & formu ='Y = QENS_Mix2(X, P1, P2, P3, P4, P5, P6, P7) ;QENS delta + Lorentzian + random walk translation'
npp = 7 ;Number of parameters
editf = 0 ;Not editable formula
fixpi = [0,0,0,0,0,0,0] ;Fixed params (definitively)
txtpi = ['P1.scale', 'P2.u2', 'P3.pos', 'P4.fixed', 'P5.fraction', 'P6.HWHM', 'P7.D']
valpi = ['I: 1 >0', 'u2: 0 >0', 'C: 0', 'f0: 0.5 >0<1', 'f1: 0.3 >0<1', $ ;Initial values
'HWHM: 0.5 >0', 'D: 0.1 >0']
Pexplain[1] = 'Intensity scaling (arbitrary units).'
Pexplain[2] = 'u^2 for DW term'
Pexplain[3] = 'Position'
Pexplain[4] = 'Fraction of immobile protons [f0]'
Pexplain[5] = 'Fraction of protons contributing to Lorentzian [f1]'
Pexplain[6] = 'HWHM of Lorenzian'
Pexplain[7] = 'Self-diffusion constant [D] (in E/Q^2 units) for long-range translation'
end
endcase
bsf=115
......@@ -3725,9 +3742,9 @@ TBname=[TBname, 'QENS_IL1', 'QENS_IL2', 'QENS_IL3']
TBname=[TBname, 'QENS_Fixed_JumpsNsites', 'QENS_Fixed_2JumpsNsites', 'QENS_Fixed_JumpsNsitesLogNormDist']
;SubIndex UV(5) 93 94 95
;
; 105
TBname=[TBname, 'QENS_Mix1']
;SubIndex UV(5) 96
; 105 106
TBname=[TBname, 'QENS_Mix1', 'QENS_Mix2']
;SubIndex UV(5) 96 97
;
Flist=widget_button(row1 ,value='ADD a Function',/menu ,font=ft_b_normal) ; ,TBname IDX ,Case IDX
......@@ -3837,6 +3854,7 @@ but9 =widget_button(mau1 ,value='- Teubner-Strey' ,font=ft_b_normal, uva
but9=widget_button(but ,value='- Fixed pop + Jumps between N & M sites in a circle ' ,font=ft_b_normal, uvalue=[40,103,leader,base0,Flist,94, mess])
but9=widget_button(but ,value='- Fixed pop + Jumps on N sites in a circle with log-norm distribution' , uvalue=[40,104,leader,base0,Flist,95, mess], font=ft_b_normal)
but9=widget_button(but ,value='- Fixed pop + Long-range and confined translation + isotropic rotation' , uvalue=[40,105,leader,base0,Flist,96, mess], font=ft_b_normal)
but9=widget_button(but ,value='- Fixed pop + Lorentzian + Random-walk translation' , uvalue=[40,106,leader,base0,Flist,97, mess], font=ft_b_normal)
bid =widget_button(but ,value='---') & widget_control,bid,sens=0
if Qmanual gt ' ' then begin
......@@ -6638,6 +6656,51 @@ function QENS_Mix1, X, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12
end
function QENS_Mix2, X, P1, P2, P3, P4, P5, P6, P7
;+
;******************************************************************************
;** Delta +
;** Lorentzian +
;** Random translational diffusion
;**
;** This assumes 3 independent populations, each contributing to
;** a single type of motion. However there is no way to ensure
;** that P4+P5 < 1, so the fit can go to non-physical values
;** such that the fraction for the last component 1-P4-P5 < 0.
;**
;** As the position of the delta can be between two energy values,
;** the intensity of the delta is shared into 2 deltas placed at those two energies.
;**
;** Parameters:
;** P1 = Scaling factor
;** P2 = u^2 for DW term
;** P3 = Center
;** P4 = Fraction of atoms contributing to delta
;** P5 = Fraction of atoms contributing to Lorentzian
;** P6 = HWHM of Lorenzian function
;** P7 = D (self-diffusion coefficient in A^2*meV)
;-
common c_str_fitqens, func_resol, Qcurrent1D, Qcurrent2D, mig2, mig3, mig4, mig5
Y = QENS_delta(X, 1.0, 0.0, P3, P4) ;delta (area=1, DW=0, position, fraction=P4)
;General Lorentzian function
Y += P5 * strnormLorentz(X, P3, P6)
;Random walk translation
hwhm = P7 * Qcurrent1D^2
Y += (1-P4-P5) * strnormLorentz(X, P3, hwhm)
;scaling & DW
Y *= P1
if P2 gt 0. then Y *= EXP((-P2*Qcurrent1D^2/3.)>(-70.))
return, Y
end
;
;;End QENS functions
;******************************************************************************
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment