diff options
Diffstat (limited to 'vmodels')
-rw-r--r-- | vmodels/nfw_int.hpp | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/vmodels/nfw_int.hpp b/vmodels/nfw_int.hpp new file mode 100644 index 0000000..b3e8b54 --- /dev/null +++ b/vmodels/nfw_int.hpp @@ -0,0 +1,57 @@ +/** + \file nfw_int.hpp + \brief NFW_INT model + \author Junhua Gu + */ + + +#ifndef NFW_INT_MODEL_H_ +#define NFW_INT_MODEL_H_ +#define OPT_HEADER +#include <core/fitter.hpp> +#include <cmath> +#include <misc/optvec.hpp> + +namespace opt_utilities +{ + template <typename T> + class nfw_int + :public model<optvec<T>,optvec<T>,optvec<T>,std::string> + { + private: + nfw_int* do_clone()const + { + return new nfw_int<T>(*this); + } + + const char* do_get_type_name()const + { + return "nfw_int mass profile"; + } + public: + nfw_int() + { + this->push_param_info(param_info<optvec<T> >("rho0",1)); + this->push_param_info(param_info<optvec<T> >("rs",1)); + } + + optvec<T> do_eval(const optvec<T>& x,const optvec<T>& param) + { + T rho0=get_element(param,0); + T rs=get_element(param,1); + return 4*3.1415926*rho0*rs*rs*rs*(std::log((x+rs)/rs)-x/(x+rs)); + } + + private: + std::string do_get_information()const + { + return "integrated NFW mass profile\n" + "y=rho0/(x/rs*(1+x/rs)^2)\n"; + } + }; +} + + + +#endif +//EOF |