Sei sulla pagina 1di 100

Theory of Complex Systems

Marco Aurelio Alzate Monroy

Fractals from Dynamical


Systems

Doctoral Program in Engineering


Information and Knowledge Sciences
District University Francisco José de Caldas
Cognitive systems and
complex systems engineering

From self-organized systems

From non-linear systems

Fractals
Fractals
From random processes
Random process, Brownian motion,
fractional Brownian motion, Hurst parameter,
From iterative algorithms
midpoint displacement, variance-time plot,
stochastic self-similarity, second-order strict Fractals in nature, Affine transformations
self-similarity, second-order assymptotic self- and Iterated function systems, symmetry
similarity, long-range dependence, 1/f noise, and growth, Lindenmayer´s systems,
heavy tailed distributions, FARIMA, M/G/, formal grammars, computability,
wavelet analysis of fractal signals, MWM. decidibility, Gödel’s incompleteness
theorems, recursion, euclidean measures
of fractal objects, self-similar dimension,
From reductionsm, mechanicism, determinism, Hausdorff measure, Hausdorff dimension,
and predictability to self-organization, Introduction to box-counting dimension
emergence, evolution and adaptation. Complex Systems
Cognitive systems and
complex systems engineering

From self-organized systems

From non-linear systems

Fractals
Fractals
From random processes
Random process, Brownian motion,
fractional Brownian motion, Hurst parameter,
From iterative algorithms
midpoint displacement, variance-time plot,
stochastic self-similarity, second-order strict Fractals in nature, Affine transformations
self-similarity, second-order assymptotic self- and Iterated function systems, symmetry
similarity, long-range dependence, 1/f noise, and growth, Lindenmayer´s systems,
heavy tailed distributions, FARIMA, M/G/, formal grammars, computability,
wavelet analysis of fractal signals, MWM. decidibility, Gödel’s incompleteness
theorems, recursion, euclidean measures
of fractal objects, self-similar dimension,
From reductionsm, mechanicism, determinism, Hausdorff measure, Hausdorff dimension,
and predictability to self-organization, Introduction to box-counting dimension
emergence, evolution and adaptation. Complex Systems
So far: (1) Deterministic fractals built
through algorithms that capture exact
self-similarity at different scales, (2)
Random fractals built through
algorithms that capture stochastic self-
similarity at different scales
s = 0;
for k = 1:4
s = [s, s, s ;
s, ones(3^(k-1)), s ;
s, s, s];
end
imagesc(s);

This kind of fractals have found many interesting


application in modern technology and sciences.

(e.g. a fractal antenna maximizes its effective size


in a wide range of frequency scales, preserving the
radiation patterns: It is compact, useful for multiple
bands or ultra wide band, with applications in
cellular networks, RFID cards, etc.)
load DescargasNeuronales.mat
NP = length(x)-1;
for k=1:7
m = 64*(2^k);
Ns = floor(NP/m);
y = zeros(Ns,1);
for i=1:Ns
y(i) = sum(x(1+m*(i-1):m*i))/m;
end
v(k) = var(y);
end
m = 64*(2.^(1:7));
p=polyfit(log2(m),log2(v),1);
plot(log2(m),log2(v),'r-')
H = p(1)/2 + 1

-16.6
Random
-16.8
fractals are
-17 p = -0.21 pervasive in
H = 0.895
-17.2 nature and form
-17.4 useful models
-17.6
in physics,
biology,
-17.8
economy,
-18
engineering,
-18.2 psicology, etc.
-18.4
7 8 9 10 11 12 13
A Simple Game: Choose a point within a triangle and then double the distance from
the nearest corner along a straight line. Repeat while the point is within the triangle
A Simple Game: Choose a point within a triangle and then double the distance from
the nearest corner along a straight line. Repeat while the point is within the triangle
function juega(x,y) function JuegoSerpinsky
ok = test(x,y); while(1)
n = 1; clear all
juego = [x y]; close all
plot(x,y,'go') plot([0 1 0.5 0],[0 0 sqrt(3)/2 0],'r-')
hold on axis([-0.2 1.2 -0.2 1.2])
while ok hold on
d1 = sqrt((x-0)^2 + (y-0)^2); ok = 0;
d2 = sqrt((x-1)^2 + (y-0)^2); while(~ok)
d3 = sqrt((x-0.5)^2 + (y-sqrt(3)/2)^2); title('Seleccione su punto de partida')
[d,i] = min([d1; d2; d3]); [x,y] = ginput(1);
switch i ok = test(x,y);
case 1 end
x0 = 0; y0 = 0; juega(x,y)
case 2 pause
x0 = 1; y0 = 0; end function ok = test(x,y)
case 3
ym = sqrt(3)/2;
x0 = 1/2; y0 = sqrt(3)/2;
ok = 0;
end
if y<0,
x = 2*x - x0;
return
y = 2*y - y0;
n = n+1;
juego(n,:) = [x,y];
Let’s Play! elseif y>ym
return
elseif x < y/sqrt(3)
ok = test(x,y);
return
end
elseif x > 1 - y/sqrt(3)
plot([0 1 0.5 0],[0 0 sqrt(3)/2 0],'r-')
return
hold on
else
plot(juego(:,1),juego(:,2))
ok=1;
hold on
end
plot(x,y,'rx')
text(juego(1,1),juego(1,2),'1');
text(juego(n,1),juego(n,2),num2str(n));
title(['Alcanzó a dar ' num2str(n) ' pasos'])
axis([-0.2 1.2 -0.2 1.2])
How can we know which points to choose in order to win?
¡¡Choose any interior point and go backwards!!
(Halve the distance to … ¡a randomly chosen corner!
Then, repeat eternally)
The set of points you visit on the long run will be winning points
NI = 100000; % NI = 100000 puntos visitados,
P = [0 1 1/2; ... % P = Triángulo equilátero de lado 1
0 0 sqrt(3)/2];
x=[0.5; 0.5]; % Escoge un punto inicial
X=zeros(2,NI); % Espacio para los puntos visitados
for i=-200:NI % Los 200 primeros pasos son para transientes
r=randi(3); % Escoge un vértice destino
x=x + (P(:,r)-x)/2; % y se mueve a un punto intermedio
if i>0, X(:,i)=x; end % Almacena los pasos después del transiente
end % Grafica los puntos visitados
line(X(1,:),X(2,:),'linestyle','none','marker','.','markersize',1); axis square

0.9

0.8

0.7

0.6

0.5

0.4

0.3

0.2

0.1

0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Knowing we should begin in a serpinsky point, we can do (a little) better in the game 
000 020 100 120 200 220 300 320
0
001 021 101 121 201 221 301 321
3
1 2 002 022 102 122 202 222 302 322
003 023 103 123 203 223 303 323
010 030 110 130 210 230 310 330
011 031 111 131 211 231 311 331
012 032 112 132 212 232 312 332
013 033 113 133 213 233 313 333

P[1 pasos] = 1/4


P[2 pasos] = 3/16
P[3 pasos] = 9/64
P[n pasos] = (3/4)n-1/4
Game of Chaos
NP = 3; NI = 100000; alpha = 1/2;

P=zeros(2,NP); % Espacio para los vértices de referencia


for i=1:NP % Entra interactivamente cada punto
t=text(.01,.97,['Seleccione el punto ' int2str(i) '.']);
p=ginput(1); P(:,i)=p(:); % Almacena el i-ésimo punto
delete(t); text(p(1),p(2),int2str(i)); % y lo señala en el tablero
end
t=text(.01,.97,'Calculando...'); drawnow
x=[0.5; 0.5]; % Escoge un punto inicial
X=zeros(2,NI); % Espacio para los puntos visitados
for i=-200:NI % Los 200 primeros pasos son para transientes
r=ceil(NP*rand); % Escoge un vértice destino
x=x+alpha*(P(:,r)-x); % y se mueve a un punto intermedio
if i>0, X(:,i)=x; end % Almacena los pasos después del transiente
end % Grafica los puntos visitados
delete(t); line(X(1,:),X(2,:),'linestyle','none','marker','.','markersize',1); axis square
% Otro ejemplo:
% NP = 5; NI = 100000; alpha = 3/5
Game of Chaos
1 1
xn   Pxi  xn 1  , yn   Pyi  yn 1 
2 2

1
x
0.8 y

0.6

0.4

0.2

0
0 10 20 30 40 50 60 70 80 90 100
A dynamical system in which the state
((x,y) coordinates) evolve with time (index n)

The trajectories are chaotic, but the attractor (the set of visited points as times go to infinity) forms a beautiful fractal.
z n  c  z , z0  0
2
n 1
1
10

c=0.250001
c=0.25001
c=0.2501
0

zn 10

c=0.25

c=0.2

-1
c=0.1
10
1 2 3 4
10 10 10 10
n
z n  c  z , z0  0 2
n 1
4

c = -2 – 10-12
c = -2 – 10-7
c=-0.8
c=-1.2
3
c=-1.92

2
c = -2.0

1
zn
0

-1

-2

5 10 15 20 25 30 35 40 45 50
n
 
The region where zn  c  zn21 , z0  0 does not escape to  in is [-2.0 0.25]

 
What is the region where zn  c  zn21 , z0  0 does not escape to  in ?
Let us repeat the previous process: choose 1’440.000 values for c in
the complex plane and let us color c with color 1 if |Z256|=0, with color
0 if |Z256|= and other colors in (0,1) for intermediate values of |Z256|.

x = linspace(-1.5,0.5,1200);
y = linspace(-1,1,1200);
[X,Y] = meshgrid(x,y);
Z = zeros(1200);
C = X+i*Y;
for k = 1:256
Z = Z.^2+C;
end
colormap winter(256);
pcolor(x,y,exp(-abs(Z)));
shading flat;
axis('square','equal','off');
Pathological monsters! Sweeping all our fears away
Cried the terrified mathematician You can change the world in a tiny way
Every one of them is a splinter in my eye Mandelbrot's in heaven, at least he will be when he's dead
I hate the Peano Space and the Koch Curve Right now he's still alive and teaching math at Yale
I fear the Cantor Ternary Set He gave us order out of chaos
And the Sierpinski Gasket makes me want to cry He gave us hope where there was none
And a million miles away a butterfly flapped its wings And his geometry succeeds where others fail
On a cold November day If you ever lose your way, a butterfly will flap its wings
A man named Benoit Mandelbrot was born From a million miles away, a little miracle will come
His disdain for pure mathematics To take you home
And his unique geometrical insights
Left him well equipped to face those demons down Just take a point called Z in the complex plane
He saw that infinite complexity Let Z1 be Z squared plus C
Could be described by simple rules And Z2 is Z1 squared plus C
He used his giant brain to turn the game around And Z3 is Z2 squared plus C and so on
And he looked below the storm If the series of Z's should always stay close to Z
And saw a vision in his head, A bulbous pointy form And never trend away
He picked his pencil up and he wrote his secret down That point is in the Mandelbrot Set
Just take a point called Z in the complex plane Mandelbrot Set you're a Rorschach Test on fire
Let Z1 be Z squared plus C You're a day-glo pterodactyl
And Z2 is Z1 squared plus C You're a heart-shaped box of springs and wire
And Z3 is Z2 squared plus C and so on You're one badass fucking fractal
If the series of Z's should always stay close to Z And you're just in time to save the day
And never trend away Sweeping all our fears away
That point is in the Mandelbrot Set You can change the world in a tiny way
And you're just in time to save the day
Mandelbrot Set you're a Rorschach Test on fire Sweeping all our fears away
You're a day-glo pterodactyl You can change the world in a tiny way
You're a heart-shaped box of springs and wire Go on change the world in a tiny way
You're one badass fucking fractal Come on change the world in a tiny way
And you're just in time to save the day

Mandelbrot Set
by Jonathan Coulton
The error is obvious:
Just take a point called Z in the complex plane
Let Z1 be Z squared plus C
And Z2 is Z1 squared plus C
And Z3 is Z2 squared plus C and so on
If the series of Z's should always stay close to Z
And never trend away
That point is in the Mandelbrot Set

x = linspace(-1.5,0.5,1200);
y = linspace(-1,1,1200);
What he should say:
[X,Y] = meshgrid(x,y); Just take a point called C in the complex plane
Z = zeros(1200); Let Z1 be Zero squared plus C
C = X+i*Y; And Z2 is Z1 squared plus C
for k = 1:256 And Z3 is Z2 squared plus C and so on
Z = Z.^2+C; If the series of Z's should always stay close to Zero
end And never trend away
colormap winter(256); The point C is in the Mandelbrot Set
pcolor(x,y,exp(-abs(Z)));
shading flat;
axis('square','equal','off');
Jonathan described a filled-in Julia set:
Given a complex number C
Just take a point called Z0 in the complex plane
Let Z1 be Z0 squared plus C
And Z2 is Z1 squared plus C
And Z3 is Z2 squared plus C and so on
If the series of Z's should always stay close to Z0
And never trend away
Then the point Z0 is in the filled-in Julia Set for C

c = 0.27334-0.00742*i;
x=linspace(-1.5,1.5,800);
y=linspace(-1.5,1.5,800);
[X,Y]=meshgrid(x,y);
Z=X+i*Y;
for k=1:60
Z=Z.^2+c;
end
colormap copper(256)
pcolor(x,y,exp(-abs(Z)));
shading flat;
axis('square','equal','off');
c=0 c=0.15 c=0.25 c=0.26 c=0.3 c=0.5 c=1

c=-0.5 c=-0.75 c=-1 c=0.5i c=-0.125+0.65i c=-1.25 c=-1.4012


Indeed, the formal definition for the Mandelbrot set is:

Set of parameters c for which the


corresponding Julia set is connected
Formally:
Let f :  be a polynomial function of degree n  2
Let f k ( w) be the k th iterated composition of f , f k ( w)  f ( f (...( f ( w))...))
Julia sets are defined in terms of the behavior of the iterations f k ( z )
for big values of k

Let us first define the "filled-in" Julia set of the polynomial f


K ( f )  z  : lim f k ( z )  
k 

Now we can define the Julia set for f as the border of K ( f ) :


J ( f )  K ( f )  z  :     w,v  
s.t. z  w   , z  v   , lim f k ( w)   and lim f k (v)  
k  k 

Tipically: f ( z)  c  z 2
 0 z0  1

For example, c=0: f ( z )  z  f k ( z )  z 2  in the circle z  1 z0  1
k
2

  z0  1

!This is not a fractal! 

If we increase c a little bit, c=0.3 + 0.3j, it is still true that f k(z)w  0 for
small z, and f k(z) for big z. The Julia set for this value of c is the border
between these two behaviors. c = 0.3+0.3i

!Now this is a fractal! 


A fast method for drawing the border

J (c) is invariant, forward and backwards, with respect to f ( z )  z 2  c

J (c)  f  J (c)   f 1  J (c) 

Si z  J (c),  z  c  J (c)

c = 0; n = 0;
while(c>-2)
x = zeros(50000,1);
r = 2*ceil(2*rand(50000,1))-3;
for i=2:50000
x(i) = r(i)*sqrt(x(i-1)-c);
end
plot(x(50:end),'r.','MarkerSize',2)
n = n+1; F(n) = getframe;
c = c – 0.05;
end
movie2avi(F,'JuliaMovieRealC','compression','Cinepak')
A faster way to plot the Mandelbrot set:
Color each pixel according to the number of iterations for escaping to 

x = linspace(-1.5,0.6,1000);
y = linspace(-1,1,1000);
[X,Y] = meshgrid(x,y);
Z = zeros(1000);
C = X+i*Y;
for i = 1:1000
for j=1:1000
z = 0;
for t=1:256
z = z.^2+C(i,j);
if abs(z)>2, break; end
end
Z(i,j)=t-1;
end
end
pcolor(x,y,Z);

[For coloring : shading flat; axis('square','equal','off');cm = zeros(256,3); cm(1:40,1) = (0:39)'/39; colormap(cm); brighten(0.5)]
How many iterations to reach |z|>2? David Ball, 1991

16

33

33
16

1
How many iterations to reach |z|>2? David Ball, 1991

im = 1;
epsilon = zeros(7,1);
iteraciones = zeros(7,1);
Epsilon Iteraciones Epsilon * Iteraciones
for k = 1:7 0.1000000 33 3.3
im = im/10;
c = -0.75 + im*1j; 0.0100000 315 3.15
z = 0; 0.0010000 3143 3.143
for t=1:100000000 0.0001000 31417 3.1417
z = z.^2+c;
if abs(z)>2, break; end 0.0000100 314160 3.14160
end 0.0000010 3141593 3.141593
epsilon(k) = im;
iteraciones(k) = t;
0.0000001 31415927 3.1415927
end
The Feigenbaum constant
4.669202…
As fundamental as
e, , i, 0 or 1.
Dynamical Systems
A dynamical system changes with time:
• Normally, what changes is the position
• Or the velocity
• Or acceleration… Movement!
Dynamical Systems

Sometimes, other states change:


• Reactant rate
• Temperature
• Presssure
• Viscosity
• mass
• Friendship
• Social tension
• Commercial flows
• mood

• peace
Dynamical Systems
• Along with what changes, it is important to know how does it
change
• Changing rules
– Mathematical models
x0

. x(t)
x(t)

u(t)
ft gt y(t)

x (t )  f  x (t ), u(t ), t ,
d
x (0)  x0
dt
y (t )  g  x (t ), u(t ), t 
What a dynamical system can do?

• Maybe reaches an
equillibrium point

• Maybe repeats a cycle


periodically

• Maybe more strange


things…
Linear dynamical systems
F(t) r v(t)

v(t)
M d 1
F(t) Newton: v(t )  v(t )  F (t )
r dt r

v(t)

There is only one equilibrium


point (the origin F(t) – rv(t) = 0)
and, from where ever it is, tends
to the origin exponentially
Linear dynamical systems
d
x (t )  Ax(t )  Bu(t ), x (0)  x0
dt
y(t )  Cx(t )  Du(t )

Positive Real Eigenvalues

Negative Real Eigenvalues

Purely Imaginary Eigenvalues

Complex Eigenvalues with positive real part

Complex Eigenvalues with negative real part


Non-linear dynamical systems
d2
h 2 z (t )  u (t )  r sin( z (t ))
dt

- More than one equilibrium point

- Limit cycles

- Bifurcations

- Synchronization

- Sensitivity to initial conditions

- etc.
Linear and non-linear systems
• Linear systems can be separated into parts,
solve each part independently, and
Reductionism
Mechanistic

recombine the partial solutions to obtain


the whole response: Superposition
principle… A linear system is exactly equal
to the sum of its parts.

• In nature, many dynamical systems are not


posibility of complexity)
Complexity (at least,

like that: The parts of the system interfere


among them (cooperate or compete), so the
superposition principle fails dramatically… In
non-linear systems, the whole is bigger than
the sum of its parts.
The logic of linearity
Some basic concepts
x (t )  f  x (t ), u(t ), t ,
d
x (0)  x0
dt
y(t )  g  x (t ), u(t ), t 

d
The simplest system: x(t )  f  x(t )  , x(0)  x0
dt
• Analytic treatment 
• Geometric treatment 
d One of the few non-linear systems
e.g. x(t )  sin  x(t )  , x(0)  x0 that can be easily solved analytically
dt

dx
dt   t   csc( x)dx   ln csc( x)  cot( x)  C
sin( x)
Exact analytic solutión, but…
csc( x0 )  cot( x0 )
And, since x(0)=x0, t  ln What does this mean? Who can
csc( x)  cot( x) understand this?

What will happen to x(t), t if x0=/4? What will happen to x(t), t for any x0?
Better use graphic methods
t is the time, x1 = x(t) is the position of a particle and x2 = dx(t)/dt is its velocity
x2

-2 - 0  2 x1

Vector field

If there is a particle moving on the x axis with a velocity dx/dt = sin(x), the movement
will be to the left or to the right depending on whether dx/dt is lower or greater than
zero. Those points with dx/dt = 0 are fixed points, some of them stable (attractors) and
some of them unstable (repellers).
Better use graphic
2
methods
x2 6

4
x1
-2 - 0  2

¿What happen to x(t), t when x0=/4?

/4 : velocity is positive and increasing, so x(t) 00


increases convexly up to /2.
/2 : velocity is still positive, but decreasing, so
x(t) increases concavely towards .
 : As x(t) gets closer to  , velocity approaches
-2

zero, so x(t) tends to  assymptotically.


-
¿What happen to x(t), t for any x0? -4

Although it won´t be easy to put numbers in


the time axis, we can answer every question
-6
qualitatively. -2
0 0.5 1 1.5 2 2.5 3 3.5
dx
Example: Analize the system  x 2  c , with c = -1
dt
8

6 Fixed points satisfy x2 = 1


5 x* = 1
4

3
Stability of fixed points is
determied from the vector field:
2

1
-1 is stable, +1 is unstable
0

-1

-2
-3 -2 -1 0 1 2 3
dx
Example: Analize the system  x 2  c , con c = -1/2
dt
8

6 Fixed points satisfy x2 = 1/2


5 x* = (1/2)
4

3
-(1/2) is stable, +(1/2) is unstable
2

-1

-2
-3 -2 -1 0 1 2 3
dx
Example: Analize the system  x 2  c , con c = 0
dt
8

6 The fixed point satisfies x2 = 0


5

3
0 is stable from the left
0 is unstable from the right
2

-1

-2
-3 -2 -1 0 1 2 3
dx
Example: Analize the system  x 2  c , con c = 1
dt
8

6 Fixed points satisfy x2 = -1


5

3
There are no fixed points in the
real axis
2

-1

-2
-3 -2 -1 0 1 2 3
Bifurcation
8
4
7 Equilibrio estable
3 Equilibrio inestable
6
2
5

Puntos Fijos
4

3 0
2
-1
1
-2
0

-1
-3

-2 -4
-3 -2 -1 0 1 2 3 -10 -8 -6 -4 -2 0 2 4
parámetro c
In discrete time
d
x(t )  f  x(t ), u (t ), t  , x(0)  x0 xn  f  xn 1 , un , n  , x0 dado
dt
yn  g  xn , un , n 
y (t )  g  x(t ), u (t ), t 

Equilibrium points

f  x *  0 x*  f  x *

for example

xn   xn 1 It is a linear system, the only equilibrium point is the origin (of course!)
- Unless =1, in which case any initial point is an equilibrium point-

How do we know whether it is stable?


xn xn = xn-1

xn = xn-1, 0 <  < 1  The origin is stable

x0 x1 x2
x2 x1 x0
xn-1

xn xn = xn-1

xn = xn-1,  > 1  The origin is unstable

xn-1
xn
xn = xn-1
xn = xn-1, -1 <  < 0

x2 x0
x1
xn-1

xn
xn = xn-1

xn = xn-1,  < -1

xn-1
xn
xn = xn-1
xn = xn-1,  = 1

xn-1

xn
xn = xn-1

xn = xn-1,  = -1

xn-1
As we mentioned, linear systems have very few possible behaviors…
Of course, we knew this:
x1   x0
x2   x1   2 x0 xn xn = f(xn-1)
x3   x2   3 x0

xn   n x0

But it suggests analysis


techniques!
x* (xn - x*) = m(xn-1 - x*)
… for example, linearize in an
infinitesimal interval around an
equilibrium point and see the
slope of the tangent:
xn-1
Find equilibrium x*  f  x * x*
points
d
For each one, compute m  f  x *
dx
Determine the local stability of
each point:
m  1, m  1,  1  m  0
m  0, 0  m  1, m  1, m  1
The Logistic map
• Model for population growing
• The greater the number of individuals in a generation, the greater
the reproduction rate
N n  R  N n1
• The greater the number of individuals in a generation, the smaller
the reproduction rate due to resource scarcity
Rn  R  N n 1  , p.ej. Rn    bN n 1
N n  N n 1    bN n 1 
b
• Let us define xn  N n as a “normalized population”

xn   xn1 1  xn1  , 0  xn  1
Let´s see….
 0

• Fixed points x*     1
 

• Derivative of the function at the fixed points


d
m   x 1  x    1  2 x   1  2
dx x

• Local stability
m  1 m  1 1  m  0 m  0 0  m  1 m  1 m  1
 3  3 2 3   2 1   2  1  1
A non-linear dynamical system
xn+1 =  xn (1 - xn) : If  4 and x0  [0, 1], then the trajectory will remain in the interval [0, 1].
0.3 1 1

0.15 0.5 0.5

0 0 0
0 0.5 1 0 0.5 1 0 0.5 1

With <1, the trajectory goes to zero with 1    3, the trajectory goes to 1-1/ with 3 <   1+6, the trajectory goes
to a period-2 cycle
1 1

Doubling period bifurcation


3 1
0.5 0.5 3.449 2
3.544 4
3.564 8
3.568 16
0 0
3.569 32
0 0.5 1 0 0.5 1 …
with 3.449 <   3.544, the trajectory with 3.544 <   3.564, the trajectory 3.570 
goes to a period-4 cycle goes to a period-8 cycle
xn+1

xn
Bifurcation Diagram

Orbits of the logistic map


with 3.57 <  < 3.829, there are periodic orbits with
every period of the form 2n… And also aperiodic orbits!

With =3.829 apears for the


first time a period-3 orbit,
which bifurcates to periods 6,
12, 24,… From 3.829 to 4.0
there are periodic orbits of
every possible period and
aperiodic orbits.

Aperiodic orbits : Chaos!


Bifurcation Diagram

3.45 3.65 3.84 3.85 3.91 3.91

0.2 0.009 0.0004

If the scale is hidden, we could not


distinguish the three portions of the
diagram… The bifurcation diagram is a
fractal object.
As always, a very simple program
x = zeros(10000,1); % Calcula 10000 puntos
for L = 0.001:0.001:3.999 % Para distintos parámetros
x(1) = rand(1); % iniciando en un punto al azar
for i=2:10000
x(i) = L*x(i-1)*(1-x(i-1));
end % Pero sólo grafica los últimos 9000
y = unique(x(1001:10000));
plot(L*ones(size(y)),y,'b.','MarkerSize',1)
hold on
end
Bifurcation and fundamental
laws of nature
• Bifurcation to a periodic orbit of period 2: 1 = 3
• Bifurcation to a periodic orbit of period 4: 2 = 1 + 6
• …
• Let n be the parameter that produces a bifurcation to a limit
cycle of period 2n.
• The distance between two successive bifurcation points is
n - n-1 k  k 1
d 
• Consider the sequence k k 1  k , k2, which represents
how fast to the next bifurcation
• dk 4.669202 for the logistic map… And for every map
with a single maximum! A universal constant!
4  3
2  1 3  2
0.9

0.8

0.7

0.6

0.5

0.4

2.9 3 3.1 3.2 3.3 3.4 3.5

1 2 3 4
xn 1  λ xn (1  xn ) λ  1, 4 Bifurcation points λk  λk 
 c  1  
zn 1  zn2  c c   2, 0.25 New circular-shaped bulb k
2  2 
f ( x)   x 1  x  , f m ( x)  f  f  f ( x)   m times
1 pasos, Lambda = 0.8 2 pasos, Lambda = 0.8 3 pasos, Lambda = 0.8 1 pasos, Lambda = 2.5 2 pasos, Lambda = 2.5 3 pasos, Lambda = 2.5
1 1 1 1 1 1

0.5 0.5 0.5 0.5 0.5 0.5

0 0 0 0 0 0
0 0.5 1 0 0.5 1 0 0.5 1 0 0.5 1 0 0.5 1 0 0.5 1

4 pasos, Lambda = 0.8 5 pasos, Lambda = 0.8 6 pasos, Lambda = 0.8 4 pasos, Lambda = 2.5 5 pasos, Lambda = 2.5 6 pasos, Lambda = 2.5
1 1 1 1 1 1

0.5 0.5 0.5 0.5 0.5 0.5

0 0 0 0 0 0
0 0.5 1 0 0.5 1 0 0.5 1 0 0.5 1 0 0.5 1 0 0.5 1

101 pasos, Lambda = 3.54 102 pasos, Lambda = 3.54 103 pasos, Lambda = 3.54
101 pasos, Lambda = 3.1 102 pasos, Lambda = 3.1 103 pasos, Lambda = 3.1
1 1 1
1 1 1

0.5 0.5 0.5


0.5 0.5 0.5

0 0 0 0 0 0
0 0.5 1 0 0.5 1 0 0.5 1 0 0.5 1 0 0.5 1 0 0.5 1

104 pasos, Lambda = 3.1 105 pasos, Lambda = 3.1 106 pasos, Lambda = 3.1 104 pasos, Lambda = 3.54 105 pasos, Lambda = 3.54 106 pasos, Lambda = 3.54
1 1 1 1 1 1

0.5 0.5 0.5 0.5 0.5 0.5

0 0 0 0 0 0
0 0.5 1 0 0.5 1 0 0.5 1 0 0.5 1 0 0.5 1 0 0.5 1
1 pasos, Lambda = 4 2 pasos, Lambda = 4 3 pasos, Lambda = 4
1 1 1

0.5 0.5 0.5

0 0 0
0 0.5 1 0 0.5 1 0 0.5 1

4 pasos, Lambda = 4 5 pasos, Lambda = 4 6 pasos, Lambda = 4


1 1 1

0.5 0.5 0.5

0 0 0
0 0.5 1 0 0.5 1 0 0.5 1
Chaos Predictability
• Given xt, we only want to know whether, after m steps, the value xt+m 1
1 pasos, Lambda = 4
1
2 pasos, Lamb

exceeds or not ½. The answer is “yes” (1) or “no” (0), so we must


provide only one bit of information.
0.5 0.5

• For m = 1, it is enough to know whether xt falls in one of three regions 0 0


0 0.5 1 0 0.5
1 pasos, Lambda = 4 2 pasos, Lambda = 4 3 pasos, Lambda = 4
1 pasos, Lambda = 4 2 pasos, Lambda = 4
1 1 1
1 1 =4
4 pasos, Lambda 5 pasos, Lamb
1 1

• For m = 2, it is enough to know whether x0.5t falls in one of five


0.5 regions
0.5
0.5
0.5 0.
0.5 0.5

0 0 0
0 0.5 1 0 0.5 0 1 0 0.5 0 1
0 0.5
0 1 0 0.5
0 1

• For m = 6, we need to tell 26+1 = 65 possible


1
sections
4 pasos, Lambda =where
4 x can fall.
1
5 pasos, Lambda = 4
t
0 0.5
6 pasos, Lambda = 4
4 pasos, Lambda = 4
1
1 0 0.5
5 pasos, Lambda = 4
1 1

• To predict whether xt+m will exceed ½ we must jnow xt with, at least, m+1
precision bits 0.5 0.5
0.5
0.5
0.5 0.

0 0 0
A 64 bit computer will tell
0 us if
0.5 x
t+m will
1 0 0.5 0
0
1 0
0.5
0.5
1
0
0
1
0.5 1

exceed ½ only upto 63 steps in the future!


Only two additional problems
• Let us put all computer memory to represent xt
with high precision
– Ok. We can predict farther in time. But having still
a finite memory, there will always be a value of m
from which we cannot say anything.
– Even worse… ¿can we measure xt with such
precision? Any infinitesimal error will become
definitive at some time.
Chaos predictability

The predictability of a coin tossing sequence is null: Most we can


say is that we expect that, in a long sequence, almost half of the
outcomes will be 0 and half of them will be 1: A purely statistical
description (randomness).
x0 = 0.002
1
x0 = 0.002000001

0.8
xn
  
0.6

+
- z-1 0.4
xn-1
+ 0.2

1 0

0 10 20 30 40 50 60 70 80 90 100

The predictability of a chaotic system is high in short periods of


time, but not in the long run.
Is there any point in coducting computer simulations?
• Yes! The shadowing lemma

• A sequence {xi, i=1,2,…,N} is a pseudo-orbit() of a map f() if


d  x
i 1 , f ( xi )    , i  1, 2,..., N  1

x0 x1 x2
  
f(x0) f(x1)

• A point y is a shadow() of the sequence {xi, i=1,2,…,N} if

d  x , f
i
i 
( y )    , i  1, 2,..., N 
  
x0 x1 x2
y f(y) f<2>(y)
Is there any point in coducting computer simulations?
• Yes! The shadowing lemma

The shadowing lemma


In any region , for each >0 there
exists an >0 such that every pseudo-
orbit() {xi, i=a,a+1,…,b} of f in 
has a shadow() y in .

1. If your weather forecast was a shame, do not worry: It could happen as you said
2. Computer simulations cannot predict anything, but they can characterize a
chaotic system behavior
Chaos Characteristics
• Deterministic
– Future is completely determined from the history of
the system, although we cannot compute it
• Sensitive
– Any perturbation, no matter how small, will change
the evolution of the system for ever
• Ergodic
– A chaotic system will always return to a local region
close to its initial state.
• Embedded
– Chaotic attractors are embedded with an inifnite
number of unstable periodic orbits.
More than one dimension (e.g., 2)
• Hénon Map xn1  a  xn2  byn
yn1  xn a  1.29
b  0.3
for example

x*  a  x*2  bx*  x* 
1
2
 
b  1  (b  1)2  4a  0.838486
Hénon Map
2
x = zeros(100000,1); 1.5
a = 1.29; b = 0.3;
1
x(1:2) = (2*rand(2,1)-1)/1.1;
for i=3:100000 0.5

n
x(i) = a - x(i-1)^2 + b*x(i-2);

y
0
end
subplot(211); plot(x(100:200)); subplot(212); -0.5

plot(x(10:99999),x(11:100000),'.','MarkerSize',0.5) -1

-1.5
-1.5 -1 -0.5 0 0.5 1 1.5 2
xn

Strange attractor:

We can zoom on it
indefinitely and will never
stop the appearance of
more and more details
b=0.3, a [1.0, 1.42]
 x  a  x 2  by 
Again, IFS for fractals generation:  
 y
   x 
xt+1 xt+2 xt+3

xt xt xt

xt+10 xt+20 xt+100

xt xt xt
¿Is network traffic
the product of a chaotic
dynamical system?
-3
x 10
4

3.5

2.5

1.5

0.5

0
0 0.5 1 1.5 2 2.5 3 3.5 4
-3
x 10

Real traffic over an ethernet LAN Poisson Traffic


Convection
currents
Convection currents on earth mantle produce tectonic displacement
Foundation of chaos theory
Lorenz did not has a title for a lecture to be
given in 1972 at the 139th congress of the
The butterfly effect
American Association for the Advancement of Foundation of the
Science. Philip Merilees, the chairperson, Popular Fascination
presented it as: “Does the flap of a butterfly’s
wings in Brazil set off a tornado in Texas?”.
produced by chaos
Theory
Lorenz Equations
dx
 ay  ax
dt
dy
 bx  y  zx
dt
dz
 xy  cz
dt

t : time
x(t) : position

¿ ?
y(t) : temperature
z(t) : “distortion of T”
a, b, c : Parameters
Computer solutions to differential equations

x  f ( x), x(0)  x0
We ride on the phase point, flowing according to the
vector field.

If we begin at t=0 in x(0)=x0 with a velocity f(x0), after a


very small period of time t we would advance a
distance f(x0)t so now we will be at x(t)=x1

x1 = x0 + f(x0)t
And, after several iterations,
xn+1 = xn + f(xn)t

Euler Method
d
x(t )  sin  x(t )  , x(0)  x0 through Euler
dt
6

x0 = pi*[-2 -1.9 -3/2 -1 -1/2 -0.1 0 0.1


1/4 1/2 1 3/2 1.9 2];
for i=1:14
x(1) = x0(i); 4
for j=2:10000
x(j) = x(j-1) + 0.0004*sin(x(j-1));
end
plot(0.0004*(0:9999),x)
hold on
end 2

x2
0

x1 -2
-2 - 0  2

-4

-6
d
x(t )  sin  x(t )  , x(0)  x0 through Euler
dt

x(1) = 0.01; y(1) = 0.01;


for j=2:20000
if j==200*floor(j/200)
• Just estimate the
y(1+j/200) = y(j/200) + 0.08*sin(y(j/200)); derivative at the left
end
x(j) = x(j-1) + 0.0004*sin(x(j-1)); end of the interval
end
plot(0.0004*(0:19999),x,'b-',0.08*(0:100),y,'r--')
(tn,tn+1)
• Better to use the
4 average of the
20000 pasos derivative within the
100 pasos interval
3
estado, x(t)

d  xn  f ( xn )t
2
xn1  xn  12  f ( xn )  f (d )  t

0
0 2 4 6 8
tiempo, t
d
x(t )  sin  x(t )  , x(0)  x0 Through 2nd order Euler
dt
x(1) = 0.01; y(1) = 0.01;
for j=2:20000
if j==200*floor(j/200)
d = y(j/200) + 0.08*sin(y(j/200));
y(1+j/200) = y(j/200) + 0.04*(sin(y(j/200)) + sin(d));
end
x(j) = x(j-1) + 0.0004*sin(x(j-1));
end
plot(0.0004*(0:19999),x,'b-',0.08*(0:100),y,'r--')
legend('20000 pasos','100 pasos')
xlabel('tiempo, t')
ylabel('estado, x(t)')
First order Euler
3.5 Second order Euler
20000 pasos
3
100 pasos
2.5
estado, x(t)

1.5

0.5

0
0 1 2 3 4 5 6 7 8
tiempo, t
4th order Runge-Kutta method
k1  f ( xn )t
k2  f  xn  k1 / 2  t
k3  f  xn  k2 / 2  t
k4  f  xn  k3  t
xn 1  xn  16  k1  2k2  2k3  k4 
4
20000 pasos
20 pasos
3
estado, x(t)

0
0 2 4 6 8
tiempo, t
Multidimensional 4th order Runge-Kutta method
k1  f ( xn )t

k2  f xn  k1 / 2 t 
k3  f x n k / 2  t
2

k4  f x n k  t
3

xn 1  xn   k  2k  2k
1
6 1 2 3  k4 
function x = AtractorDeLorenz
x(:,1) = [1 2 3]';
for j=2:10000
dx k1 = 0.01*ecuacion(x(:,j-1));
 ay  ax k2 = 0.01*ecuacion(x(:,j-1) + k1/2);
k3 = 0.01*ecuacion(x(:,j-1) + k2/2);
dt k4 = 0.01*ecuacion(x(:,j-1) + k3);
x(:,j) = x(:,j-1) + (k1 + 2*k2 + 2*k3 + k4)/6;
dy
 bx  y  zx end
x = x';
dt plot3(x(:,1),x(:,2),x(:,3));

dz function x = ecuacion(x)
 xy  cz x = [10*(x(2)-x(1)); 28*x(1)-x(2)-x(1)*x(3); x(1)*x(2)-(8/3)*x(3)];

dt
Time evolution: ¡Chaos!

20

10

x(t) 0

-10

-20
0 10 20 30 40 50 60 70 80 90 100

30

20

10

y(t) 0

-10

-20

-30
0 10 20 30 40 50 60 70 80 90 100

50

40

30
z(t)
20

10

0
0 10 20 30 40 50 60 70 80 90 100

Something more interesting?


50

45
Phase Space
40

35

30

25

20

15

10

0
-30
-20
-10
0
10
20 10 15 20
30 -5 0 5
-20 -15 -10

Note : Matlab already has Runge-Kutta: 


g = inline(‘[10*(x(2)-x(1)); 28*x(1)-x(2)-x(1)*x(3); x(1)*x(2)-(8/3)*x(3)]‘,'t','x');
[t,x] = ode45(g,[0:0.01:100],[1;2;3]);
plot3(x(:,1),x(:,2),x(:,3));
A (very) brief introduction to chaos control
OGY : Ott E., Grebogi C., Yorke J. "Controlling Chaos" Physics Review Letters, 1990

xn   xn1 1  xn1  , 0  xn  1
• In its natural state,  corresponds to a chaotic regime, e.g.  = 3.78
• For some reason, we cannot move  to an stable regime
• We can only produce very small perturbations at particular instants
of time, where the system remains in a chaotic regime
• We take advantage of the existence of a fixed point (unstable, of
course) at x* = ( - 1)/ 
• When x(t) gets close to x*, we adjust 

x(1) = 0.5; % Punto inicial


ro = 3.78; % Parámetro en régimen caótico
r = ro; % Nuestro parámetro
for i=2:2500
x(i) = r*x(i-1)*(1-x(i-1)); % Evalúa el siguiente estado
rp = 1/(1-x(i)); % Y, si está muy cerca del punto fijo
if abs(rp-ro)<0.01 % hace un ligerísimo ajuste al parámetro
r = rp;
end
end
plot(x)
1

x(t) 0.5

0
0 500 1000 1500 2000 2500

3.8

(t) 3.79

3.78
0 500 1000 1500 2000 2500

In the computer, the system will remain at


the equilibrium point but, in reality, noise or 1

Imprecision will take it out of control. 0.8

0.6

0.4

x(1) = 0.5; % Punto inicial 0.2


ro = 3.78; % Parámetro en régimen caótico
0
r(1) = ro; % Nuestro parámetro 0 500 1000 1500 2000 2500
for i=2:2500
x(i) = r(i-1)*x(i-1)*(1-x(i-1)) + 0.0001*randn(1); % Evalúa el siguiente estado 3.795
rp = 1/(1-x(i)); % Y, si está muy cerca del punto fijo
if abs(rp-ro)<0.01 % hace un ligerísimo ajuste al parámetro 3.79
r(i) = rp;
3.785
else
r(i) = r(i-1); 3.78
end
end 3.775
0 500 1000 1500 2000 2500
subplot(211); plot(x)
subplot(212); plot(r,'r')
1

0.8

0.6

0.4

0.2

0
0 500 1000 1500 2000 2500 3000 3500 4000 4500 5000

3.795

3.79

3.785

3.78

3.775

3.77
0 500 1000 1500 2000 2500 3000 3500 4000 4500 5000

If noise is too high, the system can get out of control every now and then
Period-2 periodic orbit
1

0.8

0.6

0.4

0.2

0
0 50 100 150

3.784

3.783

3.782

3.781

3.78

3.779
0 50 100 150

x(1) = 0.5;
ro = 3.78;
r(1) = ro;
x(2) = r(1)*x(1)*(1-x(1));
r(2) = ro • Chaos control in ventricular fibrillation
for i=3:5000 • Chaos control in brain activity
rp = x(i-2)/(x(i-1)*(1-x(i-1)));
if abs(rp-ro)<0.01 associated with epileptic attack
r(i) = rp;
else
r(i) = r(i-1);
end
x(i) = r(i)*x(i-1)*(1-x(i-1));
end
subplot(211); plot(x)
subplot(212); plot(r,'r')
Homework #6, part I
• Plot the set of values of c in the complex plane for which the orbit of z0=0 under iteration of the
complex function zn+1=znd + c remains bounded, for different values of d  ℝ
Homework #6, part II

• Consider the tent map:


  xn xn  1/ 2
xn1  
 1  xn  xn  1/ 2
• Draw a bifurcation diagram for 12.
• Write a program to draw the cobweb of the tent map for any given value of  and x0.
• For  > 2 the bifurcation diagram gets empty: almost all orbits seem to diverge. However, still there
could be some bounded unstable orbits. Consider the case =3 and find all the bounded orbits, i.e., find
all the initial conditions x0[0,1] from which the system remains bounded (xn[0,1] nℕ); this is the
Julia set of the tent map for =3. Do you recognize some interesting pattern?
Homework #6, part III

• Consider the following 3-dimensional differential equation (Rossler equation):


d
x  ( y  z )
dt
d
y  x  0.2 y
dt
d
z  0.2  z ( x  5.7)
dt
• Use the Runge-Kutta numerical integration method to plot x(t) vs t, y(t) vs t and z(t) vs t for two slightly
different initial conditions.
• Use the Runge-Kutta numerical integration method to draw a 3-dimensional plot of the trajectory (a
strange attractor)
• Discuss the results

Potrebbero piacerti anche