Skip to content
CHAOS HOUSE

Every chaos generator should have a house!

The story of Chaos House

In my dissertation, I tried to classify about 84 analog chaos generators. The dynamics of each can be described by a system of ordinary differential equations. I already knew there were many more. I included the generators whose descriptions I could find at the time.

To see how a generator behaved as its parameters changed, I linked the computers in several teaching labs and divided the parameter combinations among their processor cores. Even with all those cores working together, a map for one generator took weeks.

I wanted an atlas with room for the generators I had yet to find. Today, GPUs and servers make those maps much faster to compute. In Chaos House you can pick a point on a map, see the corresponding trajectory, then change a coefficient and follow what happens to the motion.

I want this atlas to include every known chaos generator and to bring together the people who study them. Perhaps you know a system that is missing here, or have found an interesting regime in a familiar one. Share the equations and parameters so someone else can try your experiment.

Submission instructions

Kuramoto Sivashinsky

Comments

Search and filters

Code
Appearance

Connecting to the archive…

Orbit parameters and sources

(∂u)/(∂t) = −u·(∂u)/(∂x)−(∂²u)/(∂x²)−ν·(∂⁴u)/(∂x⁴)
u(x+L,t) = u(x,t)
(∂u)/(∂t) = −u·(∂u)/(∂x)−(∂²u)/(∂x²)−ν·(∂⁴u)/(∂x⁴)
u(x+L,t) = u(x,t)

    Spectrum and distribution settings
    Code and downloads

    kuramoto-sivashinsky / fourier_etdrk4.c

    Periodic Kuramoto-Sivashinsky PDE, Fourier spectral discretization, two-thirds dealiasing and fourth-order exponential time differencing. Do not replace this with an unrestricted explicit Euler step.

    // Kuramoto Sivashinsky | Chaos House 2026.11.25-readable.6
    // Source: https://doi.org/10.1016/0094-5765(77)90096-0
    // Raw coordinates. See README.txt and the included source licenses.
    // Periodic Kuramoto-Sivashinsky PDE, Fourier spectral discretization, two-thirds dealiasing and fourth-order exponential time differencing. Do not replace this with an unrestricted explicit Euler step.
    #include <math.h>
    #include <stdio.h>
    #include <stdlib.h>
    static void fft(double *real, double *imag, int N, int inverse) {
        // Radix-2 FFT; the inverse includes division by N.
        for (int i=1, j=0; i<N; i++) {
            int bit=N>>1;
            for (; j&bit; bit>>=1) j^=bit;
            j^=bit;
            if (i<j) {
                double saved=real[i]; real[i]=real[j]; real[j]=saved;
                saved=imag[i]; imag[i]=imag[j]; imag[j]=saved;
            }
        }
        for (int length=2; length<=N; length<<=1) {
            double angle=(inverse?2.0:-2.0)*3.141592653589793/length;
            double base_real=cos(angle), base_imag=sin(angle);
            for (int start=0; start<N; start+=length) {
                double factor_real=1, factor_imag=0;
                for (int j=0; j<length/2; j++) {
                    int left=start+j, right=left+length/2;
                    double vr=factor_real*real[right]-factor_imag*imag[right];
                    double vi=factor_real*imag[right]+factor_imag*real[right];
                    double ar=real[left], ai=imag[left];
                    real[left]=ar+vr; imag[left]=ai+vi;
                    real[right]=ar-vr; imag[right]=ai-vi;
                    double next=factor_real*base_real-factor_imag*base_imag;
                    factor_imag=factor_real*base_imag+factor_imag*base_real;
                    factor_real=next;
                }
            }
        }
        if (inverse) for (int i=0; i<N; i++) { real[i]/=N; imag[i]/=N; }
    }
    static double real_div(double ar, double ai, double br, double bi) {
        // Real part of (ar+i*ai)/(br+i*bi).
        return (ar*br+ai*bi)/(br*br+bi*bi);
    }
    
    int main(void)
    {
    
        // 1. Parameters and initial field samples on the periodic grid.
        double L = 22.0;
        double nu = 1.0;
        double initial[] = {1.0, 1.0478040263699528, 1.0927298876802611, 1.1343188485920122, 1.1721269965857752, 1.2057296216075428, 1.23472545224201, 1.2587407072648436, 1.2774329231045602, 1.290494519804812, 1.2976560704996276, 1.2986892421744496, 1.2934093785581886, 1.2816776993467494, 1.2634030935643523, 1.2385434886910578, 1.2071067811865477, 1.1691513181831168, 1.1247859243652607, 1.0741694723585378, 1.0175099992752457, 0.9550633763673991, 0.8871315429772701, 0.8140603201116509, 0.7362368229583637, 0.6540864954740427, 0.5680697937642635, 0.47867854831626294, 0.3864320381986733, 0.29187281308259294, 0.19556230133762506, 0.09807624449219854, 5.66553889764798e-16, -0.0980762444921983, -0.19556230133762484, -0.29187281308259316, -0.38643203819867344, -0.4786785483162627, -0.5680697937642635, -0.654086495474043, -0.7362368229583638, -0.8140603201116509, -0.8871315429772704, -0.9550633763673989, -1.0175099992752457, -1.0741694723585378, -1.1247859243652607, -1.1691513181831168, -1.2071067811865475, -1.2385434886910576, -1.2634030935643523, -1.2816776993467494, -1.2934093785581888, -1.2986892421744496, -1.2976560704996278, -1.290494519804812, -1.2774329231045605, -1.2587407072648436, -1.2347254522420101, -1.205729621607543, -1.1721269965857757, -1.1343188485920126, -1.0927298876802611, -1.047804026369953, -1.0000000000000007, -0.9497868860403919, -0.8976395656641328, -0.8440341713375494, -0.7894435642206854, -0.7343328847815447, -0.6791552192224076, -0.624347423101198, -0.5703261419180127, -0.5174840664420747, -0.4661864581970824, -0.4167679778260943, -0.3695298460469018, -0.3247373636145406, -0.2826178131611216, -0.2433587620188606, -0.20710678118654735, -0.17396659151091987, -0.14400064396203002, -0.11722913662632878, -0.09363046676395884, -0.07314211201904425, -0.0556619306747251, -0.04104986674891348, -0.029130041771815954, -0.019693211310397286, -0.01249956074466127, -0.007281811490265077, -0.003748605833583415, -0.0015881358281305586, -0.00047197932149646316, -5.910416263771267e-05, -0.0, 5.910416263771223e-05, 0.00047197932149647655, 0.0015881358281305802, 0.0037486058335833863, 0.007281811490265066, 0.012499560744661221, 0.019693211310397227, 0.029130041771816075, 0.041049866748913616, 0.05566193067472501, 0.07314211201904411, 0.09363046676395866, 0.11722913662632907, 0.14400064396203036, 0.17396659151091992, 0.20710678118654735, 0.2433587620188604, 0.2826178131611212, 0.32473736361454064, 0.3695298460469019, 0.41676797782609437, 0.46618645819708204, 0.5174840664420743, 0.5703261419180122, 0.6243474231011971, 0.6791552192224066, 0.7343328847815439, 0.789443564220685, 0.8440341713375491, 0.8976395656641318, 0.9497868860403911};
    
        // 2. Time settings.
        double dt = 0.05;
        double duration = 100.0;
        if (!(dt > 0 && duration >= dt && duration / dt <= 5000)) { fputs("Require a positive step and between 1 and 5000 steps for this spatial demonstration.\n", stderr); return 1; }
        int steps = (int)round(duration / dt);
        int N = (int)(sizeof(initial) / sizeof(initial[0]));
        if (!(N >= 16 && N <= 512 && (N & (N - 1)) == 0)) { fputs("Use a power-of-two spatial grid from 16 to 512 samples.\n", stderr); return 1; }
        if (!(L > 0 && nu > 0 && dt > 0 && dt <= 1 && steps <= 5000)) { fputs("Require L > 0, nu > 0, 0 < dt <= 1 and at most 5000 steps.\n", stderr); return 1; }
        // 3. Fourier grid and ETDRK4 coefficients, with two-thirds dealiasing.
        double *wave = calloc((size_t)(N), sizeof(double));
        if (!wave) return 1;
        double *linear = calloc((size_t)(N), sizeof(double));
        if (!linear) return 1;
        double *keep = calloc((size_t)(N), sizeof(double));
        if (!keep) return 1;
        double *vr = calloc((size_t)(N), sizeof(double));
        if (!vr) return 1;
        double *vi = calloc((size_t)(N), sizeof(double));
        if (!vi) return 1;
        double *E = calloc((size_t)(N), sizeof(double));
        if (!E) return 1;
        double *E2 = calloc((size_t)(N), sizeof(double));
        if (!E2) return 1;
        double *Q = calloc((size_t)(N), sizeof(double));
        if (!Q) return 1;
        double *f1 = calloc((size_t)(N), sizeof(double));
        if (!f1) return 1;
        double *f2 = calloc((size_t)(N), sizeof(double));
        if (!f2) return 1;
        double *f3 = calloc((size_t)(N), sizeof(double));
        if (!f3) return 1;
        double *trial_r = calloc((size_t)(N), sizeof(double));
        if (!trial_r) return 1;
        double *trial_i = calloc((size_t)(N), sizeof(double));
        if (!trial_i) return 1;
        double *first_r = calloc((size_t)(N), sizeof(double));
        if (!first_r) return 1;
        double *first_i = calloc((size_t)(N), sizeof(double));
        if (!first_i) return 1;
        double *terms_r = calloc((size_t)(4*N), sizeof(double));
        if (!terms_r) return 1;
        double *terms_i = calloc((size_t)(4*N), sizeof(double));
        if (!terms_i) return 1;
        double *field = calloc((size_t)((steps + 1)*N), sizeof(double));
        if (!field) return 1;
        for (int grid_index = 0; grid_index < N; grid_index++) {
            int mode_number = grid_index < N/2 ? grid_index : grid_index-N;
            wave[grid_index] = 2.0 * 3.141592653589793 * mode_number / L;
            linear[grid_index] = wave[grid_index]*wave[grid_index] - nu*wave[grid_index]*wave[grid_index]*wave[grid_index]*wave[grid_index];
            keep[grid_index] = fabs(mode_number) < N / 3.0;
            vr[grid_index] = initial[grid_index];
            field[grid_index] = initial[grid_index];
        }
        fft(vr, vi, N, 0);
        double unresolved = 0.0;
        double total_energy = 0.0;
        for (int grid_index = 0; grid_index < N; grid_index++) {
            double energy = vr[grid_index]*vr[grid_index]+vi[grid_index]*vi[grid_index];
            total_energy = total_energy + energy;
            if (keep[grid_index] == 0) {
                unresolved = unresolved + energy;
                vr[grid_index] = 0;
                vi[grid_index] = 0;
            }
        }
        if (!(sqrt(unresolved) <= 1e-10 * fmax(1.0, sqrt(total_energy)))) { fputs("The initial field contains unresolved modes. Refine the spatial grid.\n", stderr); return 1; }
        for (int grid_index = 0; grid_index < N; grid_index++) {
            E[grid_index] = exp(dt * linear[grid_index]);
            E2[grid_index] = exp(dt * linear[grid_index] / 2.0);
            double sum_q = 0.0;
            double sum_f1 = 0.0;
            double sum_f2 = 0.0;
            double sum_f3 = 0.0;
            for (int contour_index = 0; contour_index < 32; contour_index++) {
                double angle = 3.141592653589793 * (contour_index + 0.5) / 32.0;
                double cr = dt * linear[grid_index] + cos(angle);
                double ci = sin(angle);
                double er = exp(cr) * cos(ci);
                double ei = exp(cr) * sin(ci);
                double square_r = cr * cr - ci * ci;
                double square_i = 2.0 * cr * ci;
                double cube_r = cr * square_r - ci * square_i;
                double cube_i = cr * square_i + ci * square_r;
                sum_q = sum_q + real_div(exp(cr / 2.0) * cos(ci / 2.0) - 1.0, exp(cr / 2.0) * sin(ci / 2.0), cr, ci);
                double pr = 4 - 3*cr + square_r;
                double pi_value = -3*ci + square_i;
                sum_f1 = sum_f1 + real_div(-4-cr+er*pr-ei*pi_value, -ci+er*pi_value+ei*pr, cube_r, cube_i);
                pr = -2 + cr;
                pi_value = ci;
                sum_f2 = sum_f2 + real_div(2+cr+er*pr-ei*pi_value, ci+er*pi_value+ei*pr, cube_r, cube_i);
                pr = 4 - cr;
                pi_value = -ci;
                sum_f3 = sum_f3 + real_div(-4-3*cr-square_r+er*pr-ei*pi_value, -3*ci-square_i+er*pi_value+ei*pr, cube_r, cube_i);
            }
            Q[grid_index] = dt*sum_q/32;
            f1[grid_index] = dt*sum_f1/32;
            f2[grid_index] = dt*sum_f2/32;
            f3[grid_index] = dt*sum_f3/32;
        }
        double *t = calloc((size_t)steps + 1, sizeof(double));
        if (!t) { fputs("Not enough memory.\n", stderr); return 1; }
        double *probe1 = calloc((size_t)steps + 1, sizeof(double));
        if (!probe1) { fputs("Not enough memory.\n", stderr); return 1; }
        double *probe2 = calloc((size_t)steps + 1, sizeof(double));
        if (!probe2) { fputs("Not enough memory.\n", stderr); return 1; }
        double *probe3 = calloc((size_t)steps + 1, sizeof(double));
        if (!probe3) { fputs("Not enough memory.\n", stderr); return 1; }
        probe1[0] = initial[0];
        probe2[0] = initial[N/3];
        probe3[0] = initial[2*N/3];
        int count = 1;
        for (int step_index = 0; step_index < steps; step_index++) {
            for (int grid_index = 0; grid_index < N; grid_index++) {
                trial_r[grid_index] = vr[grid_index];
                trial_i[grid_index] = vi[grid_index];
            }
            for (int stage = 0; stage < 4; stage++) {
                fft(trial_r, trial_i, N, 1);
                for (int grid_index = 0; grid_index < N; grid_index++) {
                    trial_r[grid_index] = trial_r[grid_index]*trial_r[grid_index];
                    trial_i[grid_index] = 0;
                }
                fft(trial_r, trial_i, N, 0);
                // Nonlinear term -0.5*d(u^2)/dx, evaluated explicitly at each stage.
                for (int grid_index = 0; grid_index < N; grid_index++) {
                    double nr = keep[grid_index] ? 0.5*wave[grid_index]*trial_i[grid_index] : 0;
                    double ni = keep[grid_index] ? -0.5*wave[grid_index]*trial_r[grid_index] : 0;
                    terms_r[stage*N + grid_index] = nr;
                    terms_i[stage*N + grid_index] = ni;
                    if (stage == 0) {
                        first_r[grid_index] = E2[grid_index]*vr[grid_index] + Q[grid_index]*nr;
                        trial_r[grid_index] = first_r[grid_index];
                        first_i[grid_index] = E2[grid_index]*vi[grid_index] + Q[grid_index]*ni;
                        trial_i[grid_index] = first_i[grid_index];
                    }
                    if (stage == 1) {
                        trial_r[grid_index] = E2[grid_index]*vr[grid_index] + Q[grid_index]*nr;
                        trial_i[grid_index] = E2[grid_index]*vi[grid_index] + Q[grid_index]*ni;
                    }
                    if (stage == 2) {
                        trial_r[grid_index] = E2[grid_index]*first_r[grid_index] + Q[grid_index]*(2*nr - terms_r[grid_index]);
                        trial_i[grid_index] = E2[grid_index]*first_i[grid_index] + Q[grid_index]*(2*ni - terms_i[grid_index]);
                    }
                }
            }
            for (int grid_index = 0; grid_index < N; grid_index++) {
                vr[grid_index] = keep[grid_index] ? E[grid_index]*vr[grid_index] + f1[grid_index]*terms_r[grid_index] + 2*f2[grid_index]*(terms_r[N+grid_index] + terms_r[2*N+grid_index]) + f3[grid_index]*terms_r[3*N+grid_index] : 0;
                trial_r[grid_index] = vr[grid_index];
                vi[grid_index] = keep[grid_index] ? E[grid_index]*vi[grid_index] + f1[grid_index]*terms_i[grid_index] + 2*f2[grid_index]*(terms_i[N+grid_index] + terms_i[2*N+grid_index]) + f3[grid_index]*terms_i[3*N+grid_index] : 0;
                trial_i[grid_index] = vi[grid_index];
            }
            fft(trial_r, trial_i, N, 1);
            for (int grid_index = 0; grid_index < N; grid_index++) {
                if (!(isfinite(trial_r[grid_index]) && fabs(trial_r[grid_index]) < 1e8)) { fputs("Unbounded field. Check dt and the spatial grid.\n", stderr); return 1; }
                field[(step_index+1)*N + grid_index] = trial_r[grid_index];
            }
            t[step_index+1] = (step_index+1)*dt;
            probe1[step_index+1] = trial_r[0];
            probe2[step_index+1] = trial_r[N/3];
            probe3[step_index+1] = trial_r[2*N/3];
            count = count + 1;
        }
        free(wave);
        free(linear);
        free(keep);
        free(vr);
        free(vi);
        free(E);
        free(E2);
        free(Q);
        free(f1);
        free(f2);
        free(f3);
        free(trial_r);
        free(trial_i);
        free(first_r);
        free(first_i);
        free(terms_r);
        free(terms_i);
        free(field);
    
        // 4. Plot the trajectory. Green is the start; red is the end.
        // Three field probes, not the full spatial state. field contains the complete time-space history.
        FILE *file = fopen("kuramoto-sivashinsky-trajectory.dat", "w");
        if (!file) { perror("trajectory file"); return 1; }
        for (int row = 0; row < count; row++) {
            fprintf(file, "%.17g %.17g %.17g\n", probe1[row], probe2[row], probe3[row]);
        }
        int write_failed = ferror(file);
        if (fclose(file) != 0) write_failed = 1;
        if (write_failed) return 1;
        // Requires gnuplot on PATH. Set GNUTERM=svg for a headless SVG output.
        int plot_status = system("gnuplot -persist -e 'set title \"Kuramoto Sivashinsky / Fourier ETDRK4\"; set xlabel \"u at grid 0\"; set ylabel \"u at grid N/3\"; set zlabel \"u at grid 2N/3\"; set grid; set view equal xyz; stats \"kuramoto-sivashinsky-trajectory.dat\" using 1 nooutput; last=STATS_records-1; splot \"kuramoto-sivashinsky-trajectory.dat\" using 1:2:3 with lines title \"Trajectory\", \"\" every ::0::0 using 1:2:3 with points pt 7 lc rgb \"green\" title \"Start\", \"\" every ::last::last using 1:2:3 with points pt 7 lc rgb \"red\" title \"End\"'");
        free(t);
        free(probe1);
        free(probe2);
        free(probe3);
        return plot_status == 0 ? 0 : 1;
    }
    

    Beyond the browser

    Choose a programming language and download the files you need from the downloads page. Choose a programming language

    Does your chaos have a name?

    We want to bring every chaos generator into one open catalogue and connect the people who study chaos and nonlinear dynamics. Developing your own system? Send its equations, parameters, initial state, recommended method and step, a reference and the code licence. After review we will add it with your name and link.

    Submission instructions · Write to the author

    Comments

    Kuramoto Sivashinsky

    Generator ranking

    Collections and index · 420 models