我有一个非常类似的问题: Using Boost::odeint with Eigen::Matrix as state vector 。 但是我没有使用恒定步进器,而是想使用受控步进器。因此,我改变了代码的工作原理:
typedef runge_kutta_dopri5<state_type,double,state_type,double,vector_space_algebra> error_stepper_type;
integrate_const( error_stepper_type() , odefunction,X0 , 0 , 10, dt));
到
typedef runge_kutta_dopri5<state_type,double,state_type,double,vector_space_algebra> error_stepper_type;
typedef controlled_runge_kutta< error_stepper_type > controlled_stepper_type;
double abs_err = 1.0e-10 , rel_err = 1.0e-6 , a_x = 1.0 , a_dxdt = 1.0;
controlled_stepper_type controlled_stepper( default_error_checker< double,vector_space_algebra >( abs_err , rel_err , a_x , a_dxdt ) );
integrate_adaptive( controlled_stepper , odefunction, X0 , 0.0 , 10.0 ,dt );
再次获得有关vector_space_algebra的编译器错误。 是否有一个像恒定步进一样容易的解决方案?