# How to address the domain of an outputed interpolating function

I am solving a system of ODEs with DSolve, which returns the results as interpolating functions. The solver always stops after some finite time because of resolution issues, so the domain of the outputted interpolating function is limited.

Hence, if I then plot those functions with a Plot command, I have to specify the range {t,0,tmax}. However tmax would change a bit everytime I run the DSolve command, and it is a pain to always change tmax manually.

Is there a way to address the domain of such a function directly?

You can get the domain of an interpolation-object quite simple.

For example the simulation timerange of

sol = NDSolveValue[{x'[t] == -x[t], x == 1, WhenEvent[x[t] < .5, "StopIntegration"]}, x, {t, 0, 1}]


is

sol["Domain"][]
(*{0., 0.693147}*)

• Perfect, thanks! – Britzel Mar 26 '19 at 16:02
• You're welcome! – Ulrich Neumann Mar 26 '19 at 16:05
• Short followup question: Is it possible to remove the { } around those two numbers in a simple way? I know I could address now each element of that list. But perhaps there is a smarter solution. – Britzel Mar 26 '19 at 16:11
• Perhaps {t0,t1}= sol["Domain"][]? – Ulrich Neumann Mar 26 '19 at 16:18
• Suppose that works, thanks a lot! – Britzel Mar 28 '19 at 21:04