Pictures of numerical methods
The pictures for numerical analysis (roadmap 13.3): Newton's tangents, interpolation and Runge's phenomenon, the pieces of a quadrature rule, stability regions, and observed orders of convergence.
Newton's method
Newton's step replaces by its tangent at and goes to where the tangent meets the axis: . newtonFigure(f, x0, n) draws each tangent; near a simple root the error is squared at each step, so the tangents crowd together fast.
Interpolation
Through points there is one polynomial of degree below . interpolationFigure(f, n) builds it by divided differences and draws , the interpolant and the error. For on equally spaced points the error near the ends grows with (Runge's phenomenon); with nodes: "chebyshev", the points , it shrinks.
Quadrature
quadratureFigure(f, [a, b], n, { rule }) shades what the rule integrates: rectangles for the midpoint rule, trapezoids, or for Simpson's rule a parabola through each pair of panels, which integrates cubics exactly.
Stability regions
A one-step method applied to multiplies by at each step: for Euler, for Heun, for the classical Runge–Kutta method. The solution stays bounded when . stabilityRegion(R) shades that set; Euler's is the disc of radius 1 about .
Orders of convergence
If the error behaves like , then : a line of slope on log–log axes. convergenceFigure(rows) plots and fits the slope, the observed order.
@ratmath/graphics and Core's Rational in scope. The last line's value is shown; PRINT(…) adds lines, TEX(…) typesets math, and SHOW(svg) draws a picture.