/* Boost libs/numeric/odeint/examples/integrate_times.cpp Copyright 2009-2014 Karsten Ahnert Copyright 2009-2014 Mario Mulansky example for the use of integrate_times Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) */ #include #include using namespace std; using namespace boost::numeric::odeint; /* * simple 1D ODE */ void rhs( const double x , double &dxdt , const double t ) { dxdt = 3.0/(2.0*t*t) + x/(2.0*t); } void write_cout( const double &x , const double t ) { cout << t << '\t' << x << endl; } // state_type = double typedef runge_kutta_dopri5< double > stepper_type; const double dt = 0.1; int main() { // create a vector with observation time points std::vector times( 91 ); for( size_t i=0 ; i