# Using DiffEq isoutofdomain to enforce positivity

**URL:** <https://discourse.julialang.org/t/using-diffeq-isoutofdomain-to-enforce-positivity/42443>\
**Category:** General Usage\
**Created:** [July 2, 2020, 6:15pm UTC](https://discourse.julialang.org/t/using-diffeq-isoutofdomain-to-enforce-positivity/42443 "2020-07-02T18:15:03Z")\
**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 2, 2020, 6:26pm UTC](https://discourse.julialang.org/t/using-diffeq-isoutofdomain-to-enforce-positivity/42443/2 "2020-07-02T18:26:48Z")

</div>

It will get a negative and then reject that time step. You need to make your derivative function robust to this (for example, just give Infs), and then it’ll pull back when it realizes it goes negative.

---

_[View the full topic](https://discourse.julialang.org/t/using-diffeq-isoutofdomain-to-enforce-positivity/42443)._
