#ifndef VT_T #define VT_T #include #include #include #include #include using namespace std; using namespace opt_utilities; template class vk_temperature :public model,optvec,optvec,std::string> { private: vk_temperature* do_clone()const { return new vk_temperature(*this); } typedef optvec Tv; public: vk_temperature() { this->push_param_info(param_info("T0",2,0.1,10)); this->push_param_info(param_info("rcool",1e22,0.001,10)); this->push_param_info(param_info("acool",1)); this->push_param_info(param_info("Tmin",1,0.1,10)); this->push_param_info(param_info("rt",1e22,0.001,10)); this->push_param_info(param_info("a",1,-10,10)); this->push_param_info(param_info("c",1,-10,10)); this->push_param_info(param_info("b",1,-10,10)); }; Tv do_eval(const Tv& r,const Tv& param) { Tv result(r.size()); T T0=param[0]; T rcool=param[1]; T acool=param[2]; T Tmin=param[3]; T rt=param[4]; T a=param[5]; T c=param[6]; T b=param[7]; for(size_t i=0;i!=r.size();++i) { T x=pow(r[i]/rcool,acool); T tcool=(x+Tmin/T0)/(x+1); T t=pow(r[i]/rt,-a)/pow(pow(r[i]/rt,b)+T(1),c/b); result[i]=T0*tcool*t; } return result; } std::string do_get_information()const { #ifdef WITH_OPT_DOC #include #endif return ""; } }; #endif