MakarovSuites
English
EnglishDeutschРусскийУкраїнськаFrançaisEspañolItalianoPolski
Contact & licences

Math

Why a computed trajectory lies

A computer cannot follow a trajectory; it can only take steps. Halving the step divides the error by two, four or sixteen depending on the method - until so many steps accumulate round-off that a smaller step makes the answer WORSE. On an orbit the most accurate method of the four still loses energy in a straight line while a less accurate one merely wobbles for ever, because accuracy and respect for an invariant are different virtues. And in a chaotic system the path is doomed whatever the method: what survives is the attractor, not the trajectory.

Why a computed trajectory lies — Actual application image
Actual application image

What happens

A computer cannot follow a trajectory; it can take a step, look at the forces where it landed, and take another. Everything that goes wrong afterwards comes from that. Euler's step spirals an oscillator outward, gaining energy it has no right to; swap the order of two lines and the same first-order method keeps the energy bounded for ever - that is what symplectic means. Verlet is second order and symplectic, the planets' integrator; Runge-Kutta 4 is far more accurate per step and still drifts, slowly. Halve the step and read the measured order; then run the Lorenz attractor and watch two methods part company at the same time.

Equations used in the module
Equations
Euler: y' = y + h f(y), order 1, energy drifts
symplectic Euler: q' = q + hv, v' = v + h a(q'), order 1, energy bounded
velocity Verlet: order 2, symplectic
Runge-Kutta 4: order 4, energy drifts slowly

Related experiments

Back to catalogue
Length and area are not what a shape looks like — Actual application image

Math

Length and area are not what a shape looks like

An approximation can hug a curve as closely as you please and still have the wrong length: a staircase converging to a diagonal is 41 % too long at every refinement, for ever. One dimension up it is worse. Schwarz's lantern has every vertex on a cylinder and triangles as small as you like, and its total area tends to the true 2π, or to five times that, or to infinity - depending only on how its two refinements race each other. What decides is not the size of the pieces but their tilt, and the panel measures it.

The precision race — Actual application image

Math

The precision race

Accuracy is bought with work, and the exchange rate is not a property of the method. Four rules integrate the same function and the currency is how many times the function is read: the race is run on a chart of error against evaluations with a tolerance line you set, after you predict the winner. On a smooth function Gauss reaches machine precision in eight readings where the trapezoid rule needs sixty-five thousand; put one kink in the function and every high-order rule collapses to the same crawl. And past ten million terms the additions themselves lose six digits.

Wallpaper groups and Penrose — Actual application image

Math

Wallpaper groups and Penrose

The seventeen wallpaper groups, each built from one or two generators and applied to a motif you drag; mirrored copies in a second colour, so rotations, reflections and glides can be told apart by eye. The group's order, its rotations and its mirrors read off the elements, not off the name. And the eighteenth pattern - Penrose rhombi - with thick and thin counts walking to the golden ratio.