# Running an ODEProblem until given a signal

**URL:** <https://discourse.julialang.org/t/running-an-odeproblem-until-given-a-signal/8913>\
**Category:** Modelling & Simulations\
**Tags:** question, diffeq\
**Created:** [February 7, 2018, 11:42pm UTC](https://discourse.julialang.org/t/running-an-odeproblem-until-given-a-signal/8913 "2018-02-07T23:42:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mindbound](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mindbound/32/587_2.png) [@mindbound](https://discourse.julialang.org/u/mindbound)\
**Post date:** [February 7, 2018, 11:42pm UTC](https://discourse.julialang.org/t/running-an-odeproblem-until-given-a-signal/8913/1 "2018-02-07T23:42:53Z")

</div>

Is it possible for the timespan of an `ODEProblem` to be open-ended, i.e. for the problem to run until given an external signal (possibly via a discrete callback with an appropriate condition)? Intuitively, this would mean giving something like `tspan = (0.0, Inf)`, although I’m not sure if that is allowed and can’t seem to find anything in the [documentation](http://docs.juliadiffeq.org/latest/index.html). TIA.

Cross-posted in [callback - Running an ODEProblem until given a signal - Stack Overflow](https://stackoverflow.com/questions/48675180/running-an-odeproblem-until-given-a-signal)

---

<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:** [February 7, 2018, 11:46pm UTC](https://discourse.julialang.org/t/running-an-odeproblem-until-given-a-signal/8913/2 "2018-02-07T23:46:05Z")

</div>

Yes, `Inf` is allowed. I’m surprised I didn’t use `Inf` in the terminating example in the docs, but you can definitely use it as long as you set a terminating event or manually step via the integrator interface.

---

<div class="post-metadata">

**Author:** ![mindbound](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mindbound/32/587_2.png) [@mindbound](https://discourse.julialang.org/u/mindbound)\
**Post date:** [February 7, 2018, 11:51pm UTC](https://discourse.julialang.org/t/running-an-odeproblem-until-given-a-signal/8913/3 "2018-02-07T23:51:02Z")

</div>

Thanks for the quick answer. So far, using DifferentialEquations.jl is by far easier and more pleasant than my old hand-written codes, and features like this, together with how generally easy it is with it to port maths into working code, are turning it into by far my favourite [meta-]package.
