diff options
author | astrojhgu <astrojhgu@ed2142bd-67ad-457f-ba7c-d818d4011675> | 2009-11-08 13:03:54 +0000 |
---|---|---|
committer | astrojhgu <astrojhgu@ed2142bd-67ad-457f-ba7c-d818d4011675> | 2009-11-08 13:03:54 +0000 |
commit | da0171cf51100155677bbf353f5802e15714fa72 (patch) | |
tree | 173d47273ba1066815de6c9e14d1dede04301ab9 /models | |
parent | 066f0968350a0efa7f908f901940ffee3775cfb7 (diff) | |
download | opt-utilities-da0171cf51100155677bbf353f5802e15714fa72.tar.bz2 |
git-svn-id: file:///home/svn/opt_utilities@91 ed2142bd-67ad-457f-ba7c-d818d4011675
Diffstat (limited to 'models')
-rw-r--r-- | models/beta1d.hpp | 3 | ||||
-rw-r--r-- | models/bpl1d.hpp | 5 | ||||
-rw-r--r-- | models/bremss.hpp | 3 | ||||
-rw-r--r-- | models/gauss1d.hpp | 5 | ||||
-rw-r--r-- | models/lin1d.hpp | 5 | ||||
-rw-r--r-- | models/nbeta1d.hpp | 9 |
6 files changed, 13 insertions, 17 deletions
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 "<math xmlns=\"http://www.w3.org/1998/Math/MathML\" display=\"block\" class=\"equation\"><mi>f</mi><mrow><mo class=\"MathClass-open\">(</mo><mrow><mi>x</mi><mo class=\"MathClass-punc\">;</mo><msub><mrow><mi>S</mi></mrow><mrow><mn>0</mn></mrow></msub><mo class=\"MathClass-punc\">,</mo><mi>β</mi><mo class=\"MathClass-punc\">,</mo><msub><mrow><mi>r</mi></mrow><mrow><mi>c</mi></mrow></msub><mo class=\"MathClass-punc\">,</mo><mi>b</mi><mi>k</mi><mi>g</mi></mrow><mo class=\"MathClass-close\">)</mo></mrow> <mo class=\"MathClass-rel\">=</mo> <mi>S</mi><mn>0</mn> <mo class=\"MathClass-bin\">∗</mo><msup><mrow><mfenced separators=\"\" open=\"(\" close=\")\"><mrow><mn>1</mn> <mo class=\"MathClass-bin\">+</mo><msup><mrow> <mfenced separators=\"\" open=\"(\" close=\")\"><mrow> <mfrac><mrow><mi>r</mi></mrow><mrow><msub><mrow><mi>r</mi></mrow><mrow><mi>c</mi></mrow></msub></mrow></mfrac></mrow></mfenced> </mrow><mrow><mn>2</mn></mrow></msup></mrow></mfenced> </mrow><mrow><mo class=\"MathClass-bin\">−</mo><mn>3</mn><mi>β</mi><mo class=\"MathClass-bin\">+</mo><mn>1</mn><mo class=\"MathClass-bin\">∕</mo><mn>2</mn></mrow></msup> <mo class=\"MathClass-bin\">+</mo> <mi>b</mi><mi>k</mi><mi>g</mi></math>"; } }; } 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 x<x_b\n" - "y=y_b*(x/x_b)^gamma2 otherwise\n"; + return ""; + //return "<math xmlns=\"http://www.w3.org/1998/Math/MathML\" display=\"block\" class=\"equation\"><mi>f</mi><mrow><mo class=\"MathClass-open\">(</mo><mrow><mi>x</mi><mo class=\"MathClass-punc\">;</mo><msub><mrow><mi>x</mi></mrow><mrow><mi>b</mi></mrow></msub><mo class=\"MathClass-punc\">,</mo><msub><mrow><mi>y</mi></mrow><mrow><mi>b</mi></mrow></msub><mo class=\"MathClass-punc\">,</mo><msub><mrow><mi>γ</mi></mrow><mrow><mn>1</mn></mrow></msub><mo class=\"MathClass-punc\">,</mo><msub><mrow><mi>γ</mi></mrow><mrow><mn>2</mn></mrow></msub></mrow><mo class=\"MathClass-close\">)</mo></mrow> <mo class=\"MathClass-rel\">=</mo> <mfenced separators=\"\" open=\"{\" close=\"\"><mrow> <mtable style=\"\" equalrows=\"false\" equalcolumns=\"false\" class=\"array\"><mtr><mtd class=\"array\" columnalign=\"center\"><msub><mrow><mi>y</mi></mrow><mrow><mi>b</mi></mrow></msub> <mfrac><mrow><msup><mrow><mi>x</mi></mrow><mrow><msub><mrow><mi>γ</mi></mrow><mrow><mn>1</mn></mrow></msub></mrow></msup></mrow><mrow><msubsup><mrow><mi>x</mi></mrow><mrow><mi>b</mi></mrow><mrow><msub><mrow><mi>γ</mi></mrow><mrow><mn>1</mn></mrow></msub></mrow></msubsup></mrow></mfrac></mtd><mtd class=\"array\" columnalign=\"center\"> <mi>x</mi> <mo class=\"MathClass-rel\"><</mo> <msub><mrow><mi>x</mi></mrow><mrow><mi>b</mi></mrow></msub></mtd></mtr><mtr><mtd class=\"array\" columnalign=\"center\"> <msub><mrow><mi>y</mi></mrow><mrow><mi>b</mi></mrow></msub> <mfrac><mrow><msup><mrow><mi>x</mi></mrow><mrow><msub><mrow><mi>γ</mi></mrow><mrow><mn>2</mn></mrow></msub></mrow></msup></mrow><mrow><msubsup><mrow><mi>x</mi></mrow><mrow><mi>b</mi></mrow><mrow><msub><mrow><mi>γ</mi></mrow><mrow><mn>2</mn></mrow></msub></mrow></msubsup></mrow></mfrac> </mtd><mtd class=\"array\" columnalign=\"center\"><mi>o</mi><mi>t</mi><mi>h</mi><mi>e</mi><mi>r</mi><mi>w</mi><mi>i</mi><mi>s</mi><mi>e</mi></mtd></mtr><mtr><mtd class=\"array\" columnalign=\"center\"> </mtd></mtr> <!--cc--></mtable></mrow></mfenced></math>"; } }; } 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 "<math xmlns=\"http://www.w3.org/1998/Math/MathML\" display=\"block\" class=\"equation\"><mi>f</mi><mrow><mo class=\"MathClass-open\">(</mo><mrow><mi>x</mi><mo class=\"MathClass-punc\">;</mo><mi>n</mi><mi>o</mi><mi>r</mi><mi>m</mi><mo class=\"MathClass-punc\">,</mo><mi>k</mi><mi>T</mi></mrow><mo class=\"MathClass-close\">)</mo></mrow> <mo class=\"MathClass-rel\">=</mo> <mi>n</mi><mi>o</mi><mi>r</mi><mi>m</mi><msqrt><mrow><mi>k</mi><mi>T</mi></mrow></msqrt><msup><mrow><mi>e</mi></mrow><mrow><mo class=\"MathClass-bin\">−</mo><mi>x</mi><mo class=\"MathClass-bin\">∕</mo><mi>k</mi><mi>T</mi> </mrow></msup></math>"; } }; } 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 "<math xmlns=\"http://www.w3.org/1998/Math/MathML\" display=\"block\" class=\"equation\"><mi>f</mi><mrow><mo class=\"MathClass-open\">(</mo><mrow><mi>x</mi><mo class=\"MathClass-punc\">;</mo><mi>N</mi><mo class=\"MathClass-punc\">,</mo><msub><mrow><mi>x</mi></mrow><mrow><mn>0</mn></mrow></msub><mo class=\"MathClass-punc\">,</mo><mi>σ</mi></mrow><mo class=\"MathClass-close\">)</mo></mrow> <mo class=\"MathClass-rel\">=</mo> <mi>N</mi><msup><mrow><mi>e</mi></mrow><mrow><mo class=\"MathClass-bin\">−</mo><mfrac><mrow><msup><mrow><mrow><mo class=\"MathClass-open\">(</mo><mrow><mi>x</mi><mo class=\"MathClass-bin\">−</mo><msub><mrow><mi>x</mi></mrow><mrow><mn>0</mn></mrow></msub></mrow><mo class=\"MathClass-close\">)</mo></mrow></mrow><mrow><mn>2</mn></mrow></msup></mrow><mrow><mn>2</mn><msup><mrow><mi>σ</mi></mrow><mrow><mn>2</mn></mrow></msup></mrow></mfrac> </mrow></msup></math>"; } }; } 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 "<math><mrow> <mtext>f(x;k,b)=k x+b</mtext> \ + </mrow> \ +</math>"; } }; } 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<std::vector<T> >("S0",1)); + this->push_param_info(param_info<std::vector<T> >("n0",1)); this->push_param_info(param_info<std::vector<T> >("rc",10)); this->push_param_info(param_info<std::vector<T> >("beta",2./3.)); this->push_param_info(param_info<std::vector<T> >("bkg",0)); @@ -32,19 +32,18 @@ namespace opt_utilities T do_eval(const T& x,const std::vector<T>& 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 "<math xmlns=\"http://www.w3.org/1998/Math/MathML\" display=\"block\" class=\"equation\"><mi>f</mi><mrow><mo class=\"MathClass-open\">(</mo><mrow><mi>x</mi><mo class=\"MathClass-punc\">;</mo><msub><mrow><mi>n</mi></mrow><mrow><mn>0</mn></mrow></msub><mo class=\"MathClass-punc\">,</mo><mi>β</mi><mo class=\"MathClass-punc\">,</mo><msub><mrow><mi>r</mi></mrow><mrow><mi>c</mi></mrow></msub><mo class=\"MathClass-punc\">,</mo><mi>b</mi><mi>k</mi><mi>g</mi></mrow><mo class=\"MathClass-close\">)</mo></mrow> <mo class=\"MathClass-rel\">=</mo> <msub><mrow><mi>n</mi></mrow><mrow><mn>0</mn></mrow></msub><msup><mrow> <mfenced separators=\"\" open=\"[\" close=\"]\"><mrow><mn>1</mn> <mo class=\"MathClass-bin\">+</mo><msup><mrow> <mfenced separators=\"\" open=\"(\" close=\")\"><mrow> <mfrac><mrow><mi>r</mi></mrow><mrow><msub><mrow><mi>r</mi></mrow><mrow><mi>c</mi></mrow></msub></mrow></mfrac></mrow></mfenced> </mrow><mrow><mn>2</mn></mrow></msup></mrow></mfenced> </mrow><mrow><mo class=\"MathClass-bin\">−</mo><mfrac><mrow><mn>3</mn></mrow><mrow><mn>2</mn></mrow></mfrac><mi>β</mi><mo class=\"MathClass-bin\">+</mo><mn>1</mn><mo class=\"MathClass-bin\">∕</mo><mn>2</mn></mrow></msup> <mo class=\"MathClass-bin\">+</mo> <mi>b</mi><mi>k</mi><mi>g</mi></math>"; } }; } |