【发布时间】:2016-05-26 17:22:08
【问题描述】:
不幸的是,我注意到 BOOST 的 odeint 无法及时解决 ODE 系统,即当我更改条件以使
typedef std::vector< double > state_type;
void ode_function(const state_type &x, state_type &dxdt, const double
{
dxdt[0] = x[0];
}
using namespace std;
using namespace boost::numeric::odeint;
state_type x(1);
x[0] = std::exp(1);
runge_kutta4< state_type > stepper;
integrate_const(stepper, ode_function, x, 1., 0., 0.01);
cout << x[0] << endl;
这实际上什么都不做,并且返回初始条件不变。在这个简单的例子中,可以通过改变变量 s=-t 来解决这个问题。但是,我不确定这个技巧是否适用于任何 ODE 系统。当我在我的程序中使用它时,我不确定它是否给出了正确的结果。 因此,有人知道任何允许向后时间集成的 c++ 库吗?
【问题讨论】: