I'm using NDSolve
to solve a system of coupled ODEs for a range of different parameters. For most points in the parameter space, the integration breaks down prematurely. However, I would still like to plot the resulting InterpolatingFunction
s up to the point where NDSolve
broke down.
Of course, that point NDSolve
changes based on the chosen parameters so I find myself constantly having to adjust the plot bounds manually.
It seems to me that there should be an easier way. Can I tell Mathematica to simply plot an InterpolatingFunction
for all values inside the domain (i.e. without using extrapolation)?
ipf
within(List)LinePlot
? Say I consideripf
a function of $x$, can I somehow listlineplotipf[x] e^x
? Also,ListLinePlot
seems to stop just before the point whereNDSolve
broke down; the plot it gives looks completely regular. But when I copy the last point fromNDSolve
's output into aPlot
range, I see a singularity. $\endgroup$ListPlot[if]
seems a special case, and it just connected the interpolated points with (straight) lines. For other kinds of plots usePlot[]
withif["Domain"]
as in the 2nd way (or MikeY's answer). -- "ListLinePlot
seems to stop": I'm not sure what you're seeing, but it could be due to automatic plot range adjustments. This would be the case ifNDSolve
stopped because the solution was going to infinity. Did you tryListLinePlot[if, PlotRange -> All]
? $\endgroup$