# Can you prevent Julia from erroring out when solving ODE problem, if Domain Error arises?

**URL:** https://discourse.julialang.org/t/can-you-prevent-julia-from-erroring-out-when-solving-ode-problem-if-domain-error-arises/42842
**Category:** General Usage
**Tags:** ode
**Created:** [July 10, 2020, 12:24pm UTC](https://discourse.julialang.org/t/can-you-prevent-julia-from-erroring-out-when-solving-ode-problem-if-domain-error-arises/42842 "2020-07-10T12:24:10Z")
**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 10, 2020, 1:35pm UTC](https://discourse.julialang.org/t/can-you-prevent-julia-from-erroring-out-when-solving-ode-problem-if-domain-error-arises/42842/2 "2020-07-10T13:35:27Z")

</div>

Set `isoutofdomain` but do `abs(u[1])^0.8`. That way it won’t error but it will also reject any step where it goes negative.

---

_[View the full topic](https://discourse.julialang.org/t/can-you-prevent-julia-from-erroring-out-when-solving-ode-problem-if-domain-error-arises/42842)._
