# Detecting warnings in ODE system during solving

**URL:** <https://discourse.julialang.org/t/detecting-warnings-in-ode-system-during-solving/100075>\
**Category:** Modelling & Simulations\
**Created:** [June 8, 2023, 9:26pm UTC](https://discourse.julialang.org/t/detecting-warnings-in-ode-system-during-solving/100075 "2023-06-08T21:26:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nick1](https://avatars.discourse-cdn.com/v4/letter/n/47e85d/32.png) [@Nick1](https://discourse.julialang.org/u/Nick1)\
**Post date:** [June 8, 2023, 9:26pm UTC](https://discourse.julialang.org/t/detecting-warnings-in-ode-system-during-solving/100075/1 "2023-06-08T21:26:15Z")

</div>

I do scanning in a big number of parameters in a system of ODEs to detect possible warnings during solving by changing one parameter value at a time (increase and/or decrease by some orders of magnitude). I would like to do it in a more automatic way. How could I extract a warning in an if statement in order to mark the variable that happened?

---

<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:** [June 9, 2023, 7:05pm UTC](https://discourse.julialang.org/t/detecting-warnings-in-ode-system-during-solving/100075/2 "2023-06-09T19:05:50Z")

</div>

`@test_warn`, though what you’re really looking for is to check the return code, i.e. `sol.retcode` which returns a code that describes why it failed. See:

[https://docs.sciml.ai/SciMLBase/stable/interfaces/Solutions/#retcodes](https://docs.sciml.ai/SciMLBase/stable/interfaces/Solutions/#retcodes)

`if successful_retcode(sol.retcode) ...` is a way to branch on whether the solver successfully exited or not.

---

<div class="post-metadata">

**Author:** ![Nick1](https://avatars.discourse-cdn.com/v4/letter/n/47e85d/32.png) [@Nick1](https://discourse.julialang.org/u/Nick1)\
**Post date:** [June 21, 2023, 4:14pm UTC](https://discourse.julialang.org/t/detecting-warnings-in-ode-system-during-solving/100075/3 "2023-06-21T16:14:47Z")

</div>

Thank you Chris!
