chaos :: mathr chaos feedOscillator crisis resolved

In my previous post I tried to solve a differential equation using a port of Octave's adaptive Runge-Kutta 4/5 integration algorithm. It failed with energy explosions. Today I tried a different, much simpler, integration algorithm, and the energy explosions seem to be solved.

Velocity Verlet integration can be implemented for this problem in a few lines of code:

#include <math.h>

// compute acceleration from position
static inline void f(double *a, const double x[2])
  a[0] = -exp(x[1] * x[1]) * x[0];
  a[1] = -exp(x[0] * x[0]) * x[1];

// Velocity Verlet integration
void compute()
  const double h = 0.01;
  double x[2] = { 0, 1 };
  double v[2] = { 1, 1 };
  double a[2] = { 0, 0 };
  f(a, x);
  v[0] += 0.5 * h * a[0];
  v[1] += 0.5 * h * a[1];
  while (1)
    x[0] += h * v[0];
    x[1] += h * v[1];
    f(a, x);
    v[0] += h * a[0];
    v[1] += h * a[1];

You can download C99 source code for a JACK client which sonifies the chaotic coupled oscillators. I've been running it for 45mins at 48kHz sample rate, and no explosions yet, but be careful in case this is still transient behaviour...

No explosions may seem like a good thing, but what if the original differential equations are truly explosive, and the stability is a computational artifact? I still don't know the answer to that question.

]]> Feb 2017 14:04:36 GMTchaosphysics
Coupled oscillator crisis


Simple harmonic motion is the solution to the differential equation:

\[\frac{\partial^2}{\partial t^2} x = -\omega^2 x\]

Interested in chaos I wanted to make the angular frequency \(\omega\) be cross-coupled in a pair of oscillators, and I came up with this differential equation:

\[\begin{aligned} \frac{\partial^2}{\partial t^2} x &= -e^{y^2} x \\ \frac{\partial^2}{\partial t^2} y &= -e^{x^2} y \end{aligned}\]

It sounds something like this: audio snippet.

I initially experimented with Octave's ode45() function, but it was rather slow, so I ported it to C99 (specialized to 4-vectors containing the displacement and velocity of each oscillator). Unfortunately it exploded after some time, with the amplitude of the oscillators swinging ever-larger, and the frequency of oscillation getting very very high too (which meant that the adaptive step size Runge-Kutta integration scheme would effectively get stuck and stop making progress).


Investigating this crisis, I thought to plot the energy of the system, and sure enough it exploded:


So this experiment failed, I'll have to try some other coupling expressions to see if they suffer the same fate or otherwise. Eventually I wanted to try controlling chaos by small perturbations to nudge the oscillators into unstable periodic orbits of various kinds, but no joy this week.

You can download the C source code for the integration calculations, gnuplot source code for the diagrams, and Octave source code for converting to audio.

]]> Jan 2017 20:29:59 GMTchaosphysics
Calendar 2015 - Lyapunov FM

Calendar 2015 Lyapunov FM

I blogged about my LAC paper in 2013.

]]> Aug 2016 23:38:19 GMTcalendarchaosgraphics
Drip versions

Drip versions

drip version 1 (400MB FLAC)

drip version 2 (90MB FLAC)

a tap


landing near the inside edge
of a metal bowl suspended in mid air
which goes "ting" when a drip lands

the drips flow down into the bowl
spreading out as they go
from sharp spikes of mass (impulse train)
becoming overlapping humps (near-Gaussian)
and eventually flat

the bowl has a small hole in the middle

when enough liquid has accumulated
from the flow of the drips into the bowl
to overcome surface tension
the liquid drips through the hole

underneath the hole in the bowl
is another bowl with a hole
which goes "ting" when a drip lands
near its inside edge

this goes on for some time

each bowl larger than the last
with a deeper "ting"

the final bowl drips into a plant pot

it grows and flowers

Equations based on Dripping Faucet Dynamics Clarified by an Improved Mass-Spring Model by Ken Kiyono and Nobuko Fuchikami. Implemented in C++11 as part of dr1 on Gitorious dr1 on

]]> Dec 2013 23:48:26 GMTchaosdronemusic
Lyapunov Space of Coupled FM Oscillators

Lyapunov Space of Coupled FM Oscillators

I'm currently enjoying the Linux Audio Conference 2013 in Graz, Austria. On Saturday morning I'll present my paper Lyapunov Space of Coupled FM Oscillators:

I consider two coupled oscillators, each modulating the other's frequency. This system is governed by four parameters: the base frequency and modulation index for each oscillator. For some parameter values the system becomes unstable. I use the Lyapunov exponent to measure the instability. I generate images of the parameter space, implementing the number crunching on graphics hardware using OpenGL. I link the mouse position over the displayed image to realtime audio output, creating an audio-visual browser for the 4D parameter space.

I'll upload the slides and demos soon.

]]> May 2013 13:07:56 GMTchaoseventgraphicsmathsnoiseopenglpresentation
Soft Rock EP

I made this:

Soft Rock EP
Soft Rock EP

Most of the sounds were made using mutually-modulating oscillators on the edge of chaos, implemented in Pd, with CheeseTracker for bonus beats.

Devin Townsend - Ocean Machine - Biomech - 03 - Night


motherboard 1 audio

]]> Sep 2005 11:52:00 GMTchaosmedmusicnoisepd