From 716ac6d8c08e4fe2904a608d0efffb88598b1cde Mon Sep 17 00:00:00 2001 From: Zaher Salman Date: Fri, 19 Jan 2018 11:34:38 +0100 Subject: [PATCH] Fixed a bug in the calculation of SExpRlx for beta-NMR (reported by Gerald Morris)/ --- src/external/libBNMR/TBNMR.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/external/libBNMR/TBNMR.cpp b/src/external/libBNMR/TBNMR.cpp index bf139803..245f820c 100644 --- a/src/external/libBNMR/TBNMR.cpp +++ b/src/external/libBNMR/TBNMR.cpp @@ -88,15 +88,15 @@ double SExpRlx::operator()(double x, const vector &par) const { if ( x >= 0 && x <= par[0] ) { - TF1 sexp("sexp", "exp(-([0]-x)/[3])*exp(-pow(([1]*([0]-x)),[2]))", 0.0, 10000.0); + TF1 sexp("sexp", "exp(-([0]-x)/[3])*exp(-pow(([1]*([0]-x)),[2]))", 0.0, 20000.0); sexp.SetParameters(x, par[1], par[2],tau_Li); sexp.SetNpx(1000); y=sexp.Integral(0.0,x)/(1-exp(-x/tau_Li))/tau_Li; } else if ( x > par[0] ) { - TF1 sexp("sexp", "exp(-([3]-x)/[4])*exp(-pow(([1]*([0]-x)),[2]))", 0.0, 10000.0); + TF1 sexp("sexp", "exp(-([3]-x)/[4])*exp(-pow(([1]*([0]-x)),[2]))", 0.0, 20000.0); sexp.SetParameters(x, par[1], par[2], par[0],tau_Li); sexp.SetNpx(1000); - y=sexp.Integral(0.0,par[0])/(1-exp(-x/tau_Li))/tau_Li; + y=sexp.Integral(0.0,par[0])/(1-exp(-par[0]/tau_Li))/tau_Li; } else { y = 0; } @@ -124,7 +124,7 @@ double MLRes::operator()(double x, const vector &par) const { TF1 sexp("sexp", "exp(-([3]-x)/[4])*exp(-pow(([1]*([0]-x)),[2]))", 0.0, 10000.0); sexp.SetParameters(x, par[1], par[2], par[0],tau_Li); sexp.SetNpx(1000); - y=sexp.Integral(0.0,par[0])/(1-exp(-x/tau_Li))/tau_Li; + y=sexp.Integral(0.0,par[0])/(1-exp(-par[0]/tau_Li))/tau_Li; } else { y = 0; }