Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
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
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);
-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
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 zn21 , z0 0 does not escape to in is [-2.0 0.25]
What is the region where zn c zn21 , 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
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
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
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
• 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
v(t)
M d 1
F(t) Newton: v(t ) v(t ) F (t )
r dt r
v(t)
- Limit cycles
- Bifurcations
- Synchronization
- etc.
Linear and non-linear systems
• Linear systems can be separated into parts,
solve each part independently, and
Reductionism
Mechanistic
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
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
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
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
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-
x0 x1 x2
x2 x1 x0
xn-1
xn xn = xn-1
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
xn xn1 1 xn1 , 0 xn 1
Let´s see….
0
• Fixed points x* 1
• 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 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
xn
Bifurcation Diagram
with 3.57 < < 3.829, there are periodic orbits with
every period of the form 2n… And also aperiodic orbits!
0.8
0.7
0.6
0.5
0.4
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 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 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 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 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 0 0
0 0.5 1 0 0.5 1 0 0.5 1
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
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
• 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
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
x0 x1 x2
f(x0) f(x1)
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
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 xn1 a xn2 byn
yn1 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 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
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.
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
x2
0
x1 -2
-2 - 0 2
-4
-6
d
x(t ) sin x(t ) , x(0) x0 through Euler
dt
d xn f ( xn )t
2
xn1 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
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
xn xn1 1 xn1 , 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(t) 0.5
0
0 500 1000 1500 2000 2500
3.8
(t) 3.79
3.78
0 500 1000 1500 2000 2500
0.6
0.4
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