Numerical Methods for ODEs

the numerical initial value problem

Most differential equations have no formula for their solution. You can write down the rule y' = f(t, y) and the starting point y(t0) = y0, and yet there may be no combination of familiar functions — no exponentials, sines, logarithms — that solves it. So what do you do? You do what a hiker with a compass but no map does: you start where you are, look at which way the ground tilts, take a small step in that direction, then look again. Numerical methods turn a differential equation into exactly this kind of step-by-step walk.

Precisely, the numerical initial value problem is this setup: given f(t, y), a starting time t0, and a starting value y0, produce approximate values y1, y2, y3, ... of the true solution at later times t1, t2, t3, ..., usually spaced a step h apart so t_(n+1) = t_n + h. We never get the whole function y(t); we get a table of numbers, one per step, that traces it out. The differential equation tells us the slope f(t_n, y_n) at any point we are standing on, and every method is some clever rule for using that slope information to guess the next value y_(n+1) from the current one y_n.

This is how almost all real differential equations are actually solved — in weather models, spacecraft trajectories, drug-dosing simulations, circuit design. The analytic methods of the rest of this subject solve a small, special list of equations exactly; numerical methods solve everything else, approximately but well. The cost is honesty: a numerical solution is never exact. Two separate errors creep in — the error of approximating the step (truncation) and the error of finite-precision arithmetic (round-off) — and a good practitioner always knows roughly how big they are.

To solve y' = y, y(0) = 1 numerically with step h = 0.1, you compute y1 from y0 using the slope f(0, 1) = 1, then y2 from y1 using the slope at that new point, and so on. After 10 steps you reach t = 1 with an estimate of y(1), which the exact solution says should be e = 2.71828...

A numerical solution is a table of points marching forward, not a formula.

A numerical method produces only a finite set of approximate points, not the continuous function. Asking for the value 'between steps' requires interpolation, and every value carries some error you should never pretend is zero.

Also called
IVPstepping an ODE forward向前推進的初值問題