Solving coupled ODE systems

I would like to solve two coupled ode systems. The first is integrated by any method as usual, while the second is integrated once every 10 steps and its solution is used to modify the parameters (also the rhs) in the first problem. They are coupled in the sense that the second ode should be integrated using the same method and time step size as the first one every 10 steps.

I found that callbacks may be used to achieve this. But I am not clear how to define the callback as another ode and interact these two ode systems. The step callback is not enough because the second ode needs to be solved simultaneously as the first one. I appreciate any inputs on this.

2 Likes

I don’t know how to do it, but the problem is interesting: I assume the problem is to solve two coupled systems with very different “time constants”?

Is there a reason to not solve it simultaneously just using an implicit method? MWE?

1 Like