# Piecewise differential equations

**URL:** <https://discourse.julialang.org/t/piecewise-differential-equations/12187>\
**Category:** Numerics\
**Tags:** diffeq\
**Created:** [July 5, 2018, 4:56pm UTC](https://discourse.julialang.org/t/piecewise-differential-equations/12187 "2018-07-05T16:56:41Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [July 5, 2018, 5:24pm UTC](https://discourse.julialang.org/t/piecewise-differential-equations/12187/2 "2018-07-05T17:24:46Z")

</div>

This is discussed here and I haven’t added it to the FAQ yet:

> [@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/piecewise-differential-equations/12187)._
