From da0171cf51100155677bbf353f5802e15714fa72 Mon Sep 17 00:00:00 2001 From: astrojhgu Date: Sun, 8 Nov 2009 13:03:54 +0000 Subject: git-svn-id: file:///home/svn/opt_utilities@91 ed2142bd-67ad-457f-ba7c-d818d4011675 --- models/beta1d.hpp | 3 +-- models/bpl1d.hpp | 5 ++--- models/bremss.hpp | 3 +-- models/gauss1d.hpp | 5 ++--- models/lin1d.hpp | 5 +++-- models/nbeta1d.hpp | 9 ++++----- 6 files changed, 13 insertions(+), 17 deletions(-) (limited to 'models') diff --git a/models/beta1d.hpp b/models/beta1d.hpp index d6468b4..c3a5469 100644 --- a/models/beta1d.hpp +++ b/models/beta1d.hpp @@ -43,8 +43,7 @@ namespace opt_utilities std::string do_to_string()const { - return "Beta model\n" - "S=S0*(1+(r/rc)^2)^(-3*beta+0.5)\n"; + return "f(x;S0,β,rc,bkg) = S0 1 + rrc 2 3β+12 + bkg"; } }; } diff --git a/models/bpl1d.hpp b/models/bpl1d.hpp index 29c6afd..7cb7377 100644 --- a/models/bpl1d.hpp +++ b/models/bpl1d.hpp @@ -49,9 +49,8 @@ namespace opt_utilities private: std::string do_to_string()const { - return "broken power law\n" - "y=y_b*(x/x_b)^gamma1 for xf(x;xb,yb,γ1,γ2) = yb xγ1xbγ1 x < xb yb xγ2xbγ2 otherwise "; } }; } diff --git a/models/bremss.hpp b/models/bremss.hpp index 51b1415..f9be848 100644 --- a/models/bremss.hpp +++ b/models/bremss.hpp @@ -38,8 +38,7 @@ namespace opt_utilities private: std::string do_to_string()const { - return "Simplified bremss model\n" - "flux=norm*kT^0.5*e^{-E/kT}\n"; + return "f(x;norm,kT) = normkTexkT "; } }; } diff --git a/models/gauss1d.hpp b/models/gauss1d.hpp index ad54510..1fb0b24 100644 --- a/models/gauss1d.hpp +++ b/models/gauss1d.hpp @@ -34,15 +34,14 @@ namespace opt_utilities T N=get_element(param,0); T x0=get_element(param,1); T sigma=get_element(param,2); - T y=(x-x0)/sigma; + T y=(x-x0)/2./sigma; return N*exp(-y*y); } private: std::string do_to_string()const { - return "Gaussian model\n" - "y=N*exp(-(x-x0)^2/sigma^2\n"; + return "f(x;N,x0,σ) = Ne(xx0)22σ2 "; } }; } diff --git a/models/lin1d.hpp b/models/lin1d.hpp index 0db54ae..6268b0d 100644 --- a/models/lin1d.hpp +++ b/models/lin1d.hpp @@ -36,8 +36,9 @@ namespace opt_utilities private: std::string do_to_string()const { - return "linear model\n" - "y=k*x+b\n"; + return " f(x;k,b)=k x+b \ + \ +"; } }; } diff --git a/models/nbeta1d.hpp b/models/nbeta1d.hpp index 7ae8c0c..d43a8d8 100644 --- a/models/nbeta1d.hpp +++ b/models/nbeta1d.hpp @@ -23,7 +23,7 @@ namespace opt_utilities public: nbeta1d() { - this->push_param_info(param_info >("S0",1)); + this->push_param_info(param_info >("n0",1)); this->push_param_info(param_info >("rc",10)); this->push_param_info(param_info >("beta",2./3.)); this->push_param_info(param_info >("bkg",0)); @@ -32,19 +32,18 @@ namespace opt_utilities T do_eval(const T& x,const std::vector& param) { - T S0=get_element(param,0); + T n0=get_element(param,0); T r_c=get_element(param,1); T beta=get_element(param,2); T bkg=get_element(param,3); - return bkg+S0*pow(1+(x*x)/(r_c*r_c),-3./2.*beta); + return bkg+n0*pow(1+(x*x)/(r_c*r_c),-3./2.*beta); } private: std::string do_to_string()const { - return "density beta model\n" - "n=n0*(1+(r/rc)^2)^(-1.5*beta)\n"; + return "f(x;n0,β,rc,bkg) = n0 1 + rrc 2 32β+12 + bkg"; } }; } -- cgit v1.2.2