Loading...
Loading...
Differential Equations · Axiom Academy
Where the simplest numerical ODE solver comes from — and exactly how good (and how not-good) it really is. 1. Derivation from Taylor Series Given the initial value problem y' = f(x,y) with y(x_0)=y_0 , we want the solution at discrete points a step h apart. Start from the exact Taylor expansion of y(x+h) about x : Since y'(x) = f(x,y(x)) from the differential equation itself, substitute it in: Keeping only the linear term and discarding O(h^2) gives Euler's method : where h is the step size and f(x_n,y_n) is the slope at the current point. Geometrically: stand at (x_n,y_n) , follow that point's own tangent line for a horizontal distance h , land at (x_ n+1 ,y_ n+1 ) — then compute a brand-new tangent line there and repeat. Watch how the straight-line steps drift away from the true curve, which is exactly what a tangent line does away from its point of tangency: The local truncation error (LTE) is the error introduced in a single step, assuming the starting value was exact. It's precisely the term we truncated: Watch what happens to that error bar as the step size is cut in half, then in half again: The global error is the accumulated error at a fixed target point after many steps. To reach x = x_0 + L takes n = L/h steps — watch each step's slice of local error stack up as the Euler path pulls away from the true solution: Each of the n=L/h steps contributes local error O(h^2) :
This is the written version of the interactive lesson above. See the full Differential Equations course.