Processing math: 100%

mathr / blog / #

Coupled oscillator crisis

displacement

Simple harmonic motion is the solution to the differential equation:

2t2x=ω2x

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

2t2x=ey2x2t2y=ex2y

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).

crisis

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

energy

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.