I have heard about a lot of fancy numerical methods for solving ODEs. I know that there are methods

burkinaval1b

burkinaval1b

Answered question

2022-01-15

I have heard about a lot of fancy numerical methods for solving ODEs. I know that there are methods that (assuming sufficient smoothness) asymptotically give a low error, like the Runge-Kutta methods. These estimate the solution in a set of points t0,t1, etc. But what if I want to have a function that is close to the correct solution everywhere, not just in a discrete set of points?
I can extend the numerical solution to a piecewise linear function. This will be a continuous function and it will converge to the correct solution if the step-size goes to zero.
But the error estimate will be poor in most places unless I use a very small step-size, which rather defeats the purpose of using a high-order method. So how does one go about estimating the solution in practice between the ti?

Answer & Explanation

Mary Nicholson

Mary Nicholson

Beginner2022-01-16Added 38 answers

Remember that whatever method you use for solving y=f(t,y), be it Runge-Kutta, Bulirsch-Stoer (extrapolative), Gear/Adams multistep, or fancier methods, one always has a triple of values (ti,yi,yi)(yi=f(ti,yi)) at each evaluation point. Thus, one can always do cubic Hermite interpolation across the points (ti,yi) and (ti+1,yi+1) (note that I am not assuming that the evaluation points are equispaced, as is often the case when doing adaptive solving). If the underlying method is at most third order accurate, cubic Hermite is a good choice.
Now, the upshot is that modern implementations of DE solvers always support so-called ''dense output''; briefly, associated with a method with pth order ''accuracy'' (in quotes since ''high order doesn't always imply high accuracy'' ;) ) has with it an associated pth order interpolating function. To use my favorite example, the (4,5) adaptive Runge-Kutta solver based on the Dormand-Prince coefficients has with it an associated fifth order interpolating function. The special properties inherent in the coefficients allow the existence of an associated interpolating function with the same order of ''accuracy''; in general, not all Runge-Kutta coefficients will have an associated ''nice'' interpolating function (but again, one can always do cubic Hermite).
xandir307dc

xandir307dc

Beginner2022-01-17Added 35 answers

You can then use your favorite interpolation technique. As you say, you have a bunch of points (t,x). So you can feed them to a spline routine, or a polynomial fit, or whatever. If you have some knowledge of the functional form, you can take these data points to fit the form, but it may be better to use your differential equation for that.
alenahelenash

alenahelenash

Expert2022-01-24Added 556 answers

Take for example Runge-Kutta methods. Let t1,t2, etc., be the points given by the step-size of the method. Then the Runge-Kutta method not only give you the approximate solution at points t1,t2, etc., but also at intermediate points between, say, t1 and t2, depending on the order of the method. You can use these intermediate points (between t1 and t2, together with the endpoints t1 and t2) to construct an interpolation polynomial between t1 and t2, so that the resulting approximate solution will be a piecewise polynomial function, more general than piecewise linears, and the accuracy will as good as the accuracy of the Runge-Kutta method at the mesh points.

Do you have a similar question?

Recalculate according to your conditions!

New Questions in Differential Equations

Ask your question.
Get an expert answer.

Let our experts help you. Answer in as fast as 15 minutes.

Didn't find what you were looking for?