# Max function in differential equation

**URL:** <https://discourse.julialang.org/t/max-function-in-differential-equation/89176>\
**Category:** General Usage\
**Tags:** question, diffeq\
**Created:** [October 24, 2022, 5:02am UTC](https://discourse.julialang.org/t/max-function-in-differential-equation/89176 "2022-10-24T05:02:52Z")\
**Posts on this page:** 1\
**Showing post:** 3

<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:** [October 24, 2022, 12:42pm UTC](https://discourse.julialang.org/t/max-function-in-differential-equation/89176/3 "2022-10-24T12:42:30Z")

</div>

> [@Handling Instability When Solving ODE Problems](https://discourse.julialang.org/t/handling-instability-when-solving-ode-problems/9019/5):
>
> Thanks for the example. I will share as little as possible but just a snippet in order to explain what’s going on to others. This is a good teaching opportunity. I was able to find out that the problem is that, in the statement k9\*X3/(k10\*k11/(k12\*(1.-min(1.,k13+k14\*X5))) + X3) when X3 and X5 are dual numbers, the value of k11/(k12\*(1.-min(1.,k13+k14\*X5))) is NaN for the derivative components when the condition makes it the constant 1.0 (since the derivative of the minimum of in the denominat…

---

_[View the full topic](https://discourse.julialang.org/t/max-function-in-differential-equation/89176)._
