Numerical ODE explorer
Change initial values, parameters and step size; compare Euler and RK4 on the same equation and watch the phase portrait.
Equation
Time series
Method exactEuler error at end: 5.5336RK4 error at end: 0.0016
What did you observe?Play first, then answer. Read the explanation only after you have thought it through.
- 1.For “Exponential growth”, halve the step h. By what factor does each method's end-point error shrink?
- 2.Push h to its maximum. Does Euler's curve still look exponential? Which step goes wrong?
- 3.In “Damped oscillator”, increase γ. What does the phase portrait turn into? And once γ exceeds ω?
Euler's error roughly halves (first order) while RK4's drops to about (fourth order): global errors and . With a large step Euler walks straight along the current slope and misses the curvature within each step; the errors accumulate, and beyond it even oscillates and diverges. Damping turns the ellipse into an inward spiral (underdamped); once it stops circling and heads straight to the origin (overdamped). The sign of the characteristic discriminant decides between the three.
Related concept: What is an ODE · First-order equations · Second-order linear equations · Numerical solutions
Discussion
Found a mistake, have a question or a suggestion? You can also write to 620026600@qq.com
No comments yet. Share your understanding, ask a question, or point out an error on this page.
Log in to join the discussion