# Solving coupled ODE systems

**URL:** <https://discourse.julialang.org/t/solving-coupled-ode-systems/106685>\
**Category:** Numerics\
**Tags:** ordinarydiffeq\
**Created:** [November 24, 2023, 4:02pm UTC](https://discourse.julialang.org/t/solving-coupled-ode-systems/106685 "2023-11-24T16:02:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![JunmingDuan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/junmingduan/32/204253_2.png) [@JunmingDuan](https://discourse.julialang.org/u/JunmingDuan)\
**Post date:** [November 24, 2023, 4:02pm UTC](https://discourse.julialang.org/t/solving-coupled-ode-systems/106685/1 "2023-11-24T16:02:59Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![BLI](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bli/32/37206_2.png) [@BLI](https://discourse.julialang.org/u/BLI)\
**Post date:** [November 24, 2023, 4:56pm UTC](https://discourse.julialang.org/t/solving-coupled-ode-systems/106685/2 "2023-11-24T16:56:54Z")

</div>

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”?

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [November 24, 2023, 5:24pm UTC](https://discourse.julialang.org/t/solving-coupled-ode-systems/106685/3 "2023-11-24T17:24:26Z")

</div>

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