doughnut_ode


doughnut_ode, a MATLAB code which sets up and solves a system of ordinary differential equations (ODE) whose trajectories lie on a torus or doughnut, and for which an exact solution is known.

Licensing:

The information on this web page is distributed under the MIT license.

Languages:

doughnut_ode is available in a MATLAB version and an Octave version.

Related Data and codes:

doughnut_ode_test

doughnut_exact, a MATLAB code which evaluates an exact solution of the doughnut ODE.

matlab_ode, a MATLAB code which sets up various ordinary differential equations (ODE).

Reference:

  1. John D Cook,
    Differential equation on a doughnut,
    https://www.johndcook.com/blog/2025/10/08/diffeq-donut/
    Posted 08 October 2025.
  2. Richard Parris,
    A Three-Dimensional System with Knotted Trajectories.
    The American Mathematical Monthly,
    Volume 84, Number 6 , June/July 1977, pages 468-469.

Source Code:


Last revised on 09 October 2025.