From 2096238ff6af0745726e9e18897983d2887a7d39 Mon Sep 17 00:00:00 2001 From: Andrew Zhen Ning Yong Date: Mon, 29 Jul 2019 19:39:14 +0800 Subject: [PATCH] Last commit before sync with original repo --- physics/2pt-fit.cpp | 32 ++++++++++++++++++++++++-------- physics/eff-mass.cpp | 18 +++++++++--------- utils/plot.cpp | 18 +++++++++--------- 3 files changed, 42 insertions(+), 26 deletions(-) diff --git a/physics/2pt-fit.cpp b/physics/2pt-fit.cpp index 2f61884..554f8e4 100644 --- a/physics/2pt-fit.cpp +++ b/physics/2pt-fit.cpp @@ -30,7 +30,7 @@ int main(int argc, char *argv[]) opt.addOption("s", "shift" , OptParser::OptType::value , true, "time variable shift", "0"); opt.addOption("m", "model" , OptParser::OptType::value , true, - "fit model (exp|exp2|exp3|sinh|cosh|cosh2|cosh3|cotanh|explin|const|)", "cosh"); + "fit model (exp|exp2|exp3|sinh|cosh|cosh2|cosh3|coth|explin|const|)", "cosh"); opt.addOption("" , "nPar" , OptParser::OptType::value , true, "number of model parameters for custom models " "(-1 if irrelevant)", "-1"); @@ -186,13 +186,16 @@ int main(int argc, char *argv[]) + p[5]*(exp(-p[2]*x[0])+exp(-p[4]*(nt-x[0]))); }, 1, nPar); } - else if (model == "cotanh") + else if (model == "coth") { cotanhModel = true; nPar = 2; mod.setFunction([nt](const double *x, const double *p) { - return p[0] + p[1]/tanh(0.1892*(nt/2-x[0])); // 0.1892 is the meson eff mass in lattice unit from 2pt fit + // cout << "Using effective pion mass, am = 0.1892" << endl; + // kaon physical mass:0.28856 + // pion physical mass: 0.08046 + return p[0] + p[1]/tanh(0.28856*(nt/2-x[0])); // 0.1892 is the meson eff mass in lattice unit from 2pt fit; 0.08046 is the meson mass at physical point }, 1, nPar); } else if (model == "explin") @@ -270,8 +273,13 @@ int main(int argc, char *argv[]) } else if(cotanhModel) { - init(0) = 0.5*(data.y(0, 0)[central]+ data.y(nt-1, 0)[central]); - init(1) = 0.5*(data.y(0, 0)[central]- data.y(nt-1, 0)[central]); + // init(0) = 0.5*(data.y(0, 0)[central]+ data.y(nt-1, 0)[central]); + // init(1) = 0.5*(data.y(0, 0)[central]- data.y(nt-1, 0)[central]); + init(0) = -0.1677; + init(1) = 0.02526; + cout << init(0) << endl; + + } else { @@ -282,6 +290,7 @@ int main(int argc, char *argv[]) { init(p) = 2*init(p - 2); init(p + 1) = init(p - 1)/2.; + } // set limits for minimiser ////////////// for (Index p = 0; p < nPar; p += 2) @@ -299,9 +308,16 @@ int main(int argc, char *argv[]) } else if(cotanhModel) { - globMin.setLowLimit(p,-0.5); - locMin.setLowLimit(p, -0.3); - globMin.setHighLimit(p,1); + // globMin.setLowLimit(p,-0.5); + // locMin.setLowLimit(p, -0.3); + // globMin.setHighLimit(p,1); + globMin.setLowLimit(p,-1); + locMin.setLowLimit(p, -0.3); + globMin.setHighLimit(p,0); + + globMin.setLowLimit(p+1,-0.12); + locMin.setLowLimit(p+1, -0.1); + globMin.setHighLimit(p+1,0.9); } else { diff --git a/physics/eff-mass.cpp b/physics/eff-mass.cpp index 4680b58..1846523 100644 --- a/physics/eff-mass.cpp +++ b/physics/eff-mass.cpp @@ -1,12 +1,12 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include using namespace std; using namespace Latan; diff --git a/utils/plot.cpp b/utils/plot.cpp index 485b682..6afc53a 100644 --- a/utils/plot.cpp +++ b/utils/plot.cpp @@ -1,12 +1,12 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include using namespace std; using namespace Latan;