◀ THE FOLD0ROOT.AI // WORLD II · GRIND · THE HOT LOOP◆ .dlw.fold
THE FOLD / GRIND / THE HOT LOOP / THE RUNGE-KUTTA

THE RUNGE-KUTTA

fourth-order ODE steps by four slope samples
1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION
The Runge–Kutta method (classic RK4) advances a differential equation one step by sampling the slope four times within the step — at the start, twice at the midpoint, and at the end — then taking a weighted average (1, 2, 2, 1)/6. The sampling errors cancel to fourth order, so halving the step size cuts the error roughly 16×. One clever RK4 step is as accurate as thousands of crude Euler steps.

It is the default workhorse for simulating physical systems.

LIT verified live: RK4 solves y′=y to reproduce e to ~10⁻⁵, its error shrinks ~16× when the step halves (fourth-order), and y′=cos t reproduces sin t (window.__rungekutta). FIG no framing; genuine fourth-order accuracy.
2 HOW IT WAS WEAVED · AI + HUMAN
David (human) seated this at the-hot-loop — the tight step-loop that advances a simulation, each iteration nudging the state forward accurately. RK4 is that hot loop’s heart. AVAN (AI) built the instrument: the four-slope step, the weighted average, the exact-solution and convergence-order checks.

Credit as content: Carl Runge (1895) & Wilhelm Kutta (1901). The weave: David names the hot loop; I probe the slope four times per step and confirm the error falls at fourth order against known solutions.
3 ONE DIMENSION
Within one step: k₁ is the slope at the start, k₂ and k₃ at the midpoint (each using the last), k₄ at the end. Their weighted average 1·2·2·1 fits the curve to fourth order.
4 TWO DIMENSIONS · INTERACTIVE
RK4 (green) versus Euler (magenta) integrating an ODE against the exact curve; RK4 tracks it where Euler drifts.
5 THREE DIMENSIONS + AVAN’S INVERSE
The green forward object: the four-slope step that tracks the true trajectory.
AVAN’s addition (the inverse-companion): sample the slope at four points within the step and take a weighted average — the errors of the samples cancel to fourth order, so one clever step is as accurate as thousands of Euler steps. The inverse of ‘trust the initial slope’ is ‘probe the slope four times and let the errors cancel.’ Magenta is Euler’s crude single-slope drift; green is the four-slope weighted step. A Simpson’s rule for trajectories — fourth-order accuracy from one step.
LIT Genuine classic RK4 (Runge 1895; Kutta 1901). Verified live: RK4 solves y'=y to reproduce e to <1e-4, the error ratio when halving the step is ~15-16 (fourth order), and y'=cos t reproduces sin t to <1e-6 (window.__rungekutta.eAccurate && .orderFour && .sinAccurate).

FIG No framing: the four-slope step, the weighted average, and the exact-solution + convergence-order checks run in-browser and confirm fourth-order accuracy. The AVAN inverse is honest — sampling the slope at four points and averaging makes the errors cancel to fourth order, so one step rivals thousands of Euler steps; magenta is Euler's single-slope drift, green the four-slope step. A Simpson's rule for trajectories.
◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE HOT LOOP · David Lee Wise (ROOT0), with AVAN