Fundamentals / Numerical mathematics / Numerical ordinary differential equations / Notebooks

A constrained integrator can get the circle right and the clock wrong

A frictionless bead moves on an ideal circular guide. Its exact path, speed and angular phase can all be calculated by hand. Use this unusually informative reference to derive RATTLE's two constraint corrections and see which numerical errors would escape a camera that measured position alone.

Change parameters · Explore the workshop parameters

Change one input at a time and compare the recalculated curves with the argument above. The browser evaluates this small model locally; the accompanying numerical values state its assumptions and reference checks. Reset restores the reference inputs, and the data can be downloaded as CSV.

Save notebook (.ipynb)

Python runs on this device. The first run loads the scientific libraries.

The optional OneSimulation calculation uses the local OneSimulation installation. Save this notebook to run that comparison in Jupyter.

Observe three independent diagnostics: radius, tangency and phase. A force-free bead in a circular guide has an exact orbit with which to compare both a constrained step and a simple normalisation. NumPy and Matplotlib are sufficient.

Read both the shape and the clock

The left panel samples the first part of the trajectory. On the right, unwrapped angles are compared at the same physical times. Halve the step and double the number of steps to retain the final time.

Compare a different local solver

An installed OneSimulation environment also lets you integrate the continuous Cartesian acceleration with classical RK4. This alternative implements the centripetal force directly and has no algebraic projection. Compare the end radius with the constrained run at the same step.