0

When solving a system of ODEs with boost::odeint, I can have control of every iteration in time by using the stepper.do_step function. This way, I can store u(t).

I'm working on an algorithm that requires storing the k-vectors of an s-stage Runge-Kutta method at every time iteration. For example, for a RK4 I would need to store the values of k1,k2,k3 and k4.

Is there anyway I can obtain these values from the boost::odeint library? I don't think there is a built-in way to do this.

I tried searching around the generic_rk_algorithm.hpp for a way to change the library in some way . I found that at the do_step function, I want the de-referenced value of the F attribute of the calculate_stage structure, but Im not sure how to alter the code to obtain it.

Lutz Lehmann
  • 25,219
  • 2
  • 22
  • 51
  • The k+vectors might be modified from the simple function evaluation or reused to save memory. Is what you really want the "dense output" interpolation inside the step? – Lutz Lehmann Apr 09 '23 at 14:31
  • https://www.boost.org/doc/libs/1_81_0/libs/numeric/odeint/doc/html/boost_numeric_odeint/concepts/dense_output_stepper.html implements this dense output for some solver methods. – Lutz Lehmann Apr 10 '23 at 13:35
  • 1
    Sorry for the late reply. I really wanted the values of the k-vectors, not the dense output interpolation. I decided to recompute the k-vectors myself. Thank you for your answers – Rui Martins Jun 12 '23 at 17:55

0 Answers0