# Synchronizing Lorenz attractors II

Visualization, Math

For the last couple of weeks, I have been playing with Lorenz attractors and trying to synchronize them according to a description I read in the book “Sync: The Emerging Science of Spontaneous Order” (you can see a couple of demos I created and read about it here: Synchronizing Lorenz attractors I), but now I wanted to explore a couple of variations of that description.

# Base system

Here is what we need to synchronize two Lorenz attractors:

1. We have one “receiver” system, composed of $x$, $y$, and $z$: \begin{align} \frac{dx}{dt} &= \sigma(y - x)\\ \frac{dy}{dt} &= x(\rho - z) - y\\ \frac{dz}{dt} &= xy - \beta z \end{align}

2. We have one “driver” system, composed of $x'$, $y'$, and $z'$: \begin{align} \frac{dx’}{dt} &= \sigma(y’ - x’)\\ \frac{dy’}{dt} &= x’(\rho - z’) - y’\\ \frac{dz’}{dt} &= x’y’ - \beta z’ \end{align}

3. In the first system, we replace $x$ with $x'$. We forget about $x$ entirely: \begin{align} \frac{dy}{dt} &= x’(\rho - z) - y\\ \frac{dz}{dt} &= x’y - \beta z \end{align}

4. We keep updating $x'$, $y'$, and $z'$ according to the second system (the “driver”), and $y$, and $z$ according to the equations in point 3. The first system (the “receiver”) is now composed of $x'$, $y$, and $z$.

# Variations

I wanted to test three simple changes:

1. What if instead of replacing $x$ with $x'$ (point 3 from the list above), we replace $x$ with a linear combination between $x$ and $x'$? (We would first compute $x$ according to its system and then update it according to the linear combination.)
It would look something like this (this is not an extremely formal definition): \begin{align} x_{t+1} &= \alpha\times x_{t}’ + (1-\alpha)\times x_{t}\\ & \alpha \in \mathopen[0,1\mathclose] \end{align} The parameter $\alpha$ will act as a “sync strength” factor. The higher, the faster the attractors synchronize. In the extremes, when $\alpha=1$, we get the base case where we simply replaced $x$ with $x'$, and when $\alpha=0$, there is no synchronization.

2. What if we chained multiple attractors, each of them acting as the “driver” of the next one?
It would look something like this (again, this is not an extremely formal definition): \begin{align} \text{System 1: }& x^1, y^1, z^1\\ &\vdots\\ \text{System n: }& x^n, y^n, z^n\\ \end{align} \begin{align} x_{t+1}^{i+1} = x_{t}^{i}\\ \forall i \in \mathopen[1,n-1\mathclose]\\ \end{align}

3. What if we combined the last two variations?

# Demo

Here is a simple demo with 43 attractors that implements all the variations.
The first attractor acts as the “driver” in the “Follow chain” mode (variation 2) and as the only “driver” in the “Follow leading” mode (in this mode, all the “receivers” follow the same “driver”). With the slider, you can choose the “sync strength” (this is $\alpha$ in variation 1). You can click anywhere in the demo to start the synchronization and click again to stop it and reset the follower attractors. The followers will light up once they are synchronized.

You can find all the code here .
You can also play with the code directly on a web editor: Sync multiple attractors.