Systems that are Sensitive to Initial Conditions

Your browser does not support the canvas tag.

Systems that are sensitive to initial conditions are those that whose trajectories diverge in ways that are not predictable. One of those systems is the chaotic Lorenz attractor, but even simpler systems can show dependence on the initial conditions.

In this example the diverging behaviour is obtained by the totally deterministic algorithm 2 times modulo 1 or (2x%1) that you can even try out in your calculator.

  1. take a random number between 0 and 1 (e.g. 0.823)
  2. multiply that number by 2 (e.g. 2*0.823=1.646)
  3. calculate the modulo 1 (%) of this value (e.g. 1.646 % 1=0.646). modulo 1 corresponds in this case to make the integer part of the number 0.
  4. use the result obtained in 3. and repeat from 2.

Now start with a second number very similar to the first (e.g. 0.825) and repeat the process (in the animation the initial difference is just 0.01% between the two values).

You’ll see that for the first iterations the calculations (the trajectory) are similar but suddenly they jump all around. After some iterations you can’t predict the behavior of the second trajectory, even if you know the first trajectory. This clearly shows that the system is sensitive to initial conditions. A very simple and strange system indeed.

Lorenz Attractor in R.

Lorenz Attractor

The Lorenz System is one of the most famous system of equations in the realm of chaotic systems first studied by Edward Lorenz. The double lob remembering a butterfly wing is on the imagination of any complex systems enthusiast.

Lorenz Attractor Equations

The three equations that govern its behavior are:

where usually

So let's define the parameters, the initial state of the system and the equations in the form of a function called Lorenz

parameters <- c(s = 10, r = 28, b = 8/3)
state <- c(X = 0, Y = 1, Z = 1)
 
Lorenz <- function(t, state, parameters) {
    with(as.list(c(state, parameters)), {
        dX <- s * (Y - X)
        dY <- X * (r - Z) - Y
        dZ <- X * Y - b * Z
        list(c(dX, dY, dZ))
    })
}

We can now start processing this and plotting it.

times <- seq(0, 50, by = 0.01)
library(deSolve)
out <- ode(y = state, times = times, func = Lorenz, parms = parameters)
 
par(oma = c(0, 0, 3, 0))
plot(out, xlab = "time", ylab = "-")
plot(out[, "Y"], out[, "Z"], pch = ".", type = "l")
mtext(outer = TRUE, side = 3, "Lorenz model", cex = 1.5)

The above example is mainly copied from the the deSolve package documentation that uses the same example. What I'd like to point out in this is how simple it is to solve and plot a system of differential equations in R. The language is simple and clear and it is much more practical than implementing everything from scratch.

If you want to play with a couple of Lorenz attractors synchronizing please visit this Java implementation.

Up next: Animating the Lorenz Attractor in R.

Synchronization of Chaotic Lorenz Attractors

You’ll need Java! Alternate version of Synchronization of Chaotic Lorenz Attractors

Imagine that at each time step you magically connect the X component of two systems of Lorenz equations, meaning that the value of X used in the equation for attractor 1 is copied over to attractor 2. Then you compute the X,Y and Z at t+1 for both attractors as usual.

<p>In the above applet you see this effect. The continuous line is attractor 1 (the reference) and the dashed lines are from the attractor 2 (the coupled attractor), meaning that at each time step the X value from 1 is copied over to 2.</p>
<p>The white line measures the distance between two trajectories as time passes. In this case we can quickly see it dropping down to zero and synchronization occurs.</p>
<p>This changes the behaviour of the system completely. Instead of being two systems with divergent trajectories they get closer and closer until finally they overlap perfectly, travelling in sync through space.</p>

more details at the Lorenz Sync Page (with extra applets)

Duffing Map: Brincando com Sistemas Caóticos

Precisa de Java! Se tiver problemas (ou quiser ver o código) pode tentar esta versão

O estudo de sistemas dinâmicos, atractores e afins é recorrente aqui por estas bandas (de Hénon, de Lorenz). Infelizmente não tenho como lhe dedicar o tempo que gostava.

Hoje depois de uma aula de Sistemas Dinâmicos Discretos da Professora Diana Mendes no ISCTE voltei a lembrar-me de brincar um pouco com estes sistemas que são efectivamente muito interessantes em termos visuais (e não só).

O Applet acima, basicamente mostra o Sistema Dinâmico em tempo discreto (a versão de tempo contínuo do atractor de Duffing é talvez mais conhecida) regido pelas equações seguintes e conhecido como atractor de Duffing:

Duffing map

Os botões no topo permitem seleccionar valores para para os parámetros a e b.

1º botão:

a=2.75
b=0.2

2º botão:

a=-0.24
b=1.002

3º botão – escolha aleatória