Sie sind auf Seite 1von 16

Two dimensional

systems
Nonlinear systems, chaos and control in
Engineering
Nonlinear systems, chaos and control in Engineering
29/12/2014

David San Romn Torrubia


Miquel Pou

In this paper it is analyzed different two dimensional systems cases and their resolution
using computer programs. The document contains didactic exercises and more complex
exercises to see and understand the systems response.

Index
Exercise 1 ............................................................................................................................ 3
Introduction .................................................................................................................... 3
Model .............................................................................................................................. 3
Results ............................................................................................................................. 4
Conclusions ..................................................................................................................... 4
Exercise 2 ............................................................................................................................ 5
Introduction .................................................................................................................... 5
Model .............................................................................................................................. 5
Results ............................................................................................................................. 5
Conclusions ..................................................................................................................... 7
Exercise 3 ............................................................................................................................ 7
Introduction .................................................................................................................... 7
Model .............................................................................................................................. 7
Results ............................................................................................................................. 8
Conclusions ..................................................................................................................... 9
Exercise 4 ............................................................................................................................ 9
Introduction .................................................................................................................... 9
Model ............................................................................................................................ 10
Results ........................................................................................................................... 10
Conclusions ................................................................................................................... 13
Exercise 5 .......................................................................................................................... 13
Introduction .................................................................................................................. 13
Model ............................................................................................................................ 13
Results ........................................................................................................................... 13
Conclusions ................................................................................................................... 16

Exercise 1
Introduction
In this exercise it will be calculated the response of a two dimensional system using
Euler method. It is a didactic exercise, where two Jacobian matrix are given.

Model
In this exercise, there have been defined two different Jacobian Matrix, which are the
following ones:

1=
2=

1 2
3 1
1
3

2
1

To approximate the response by applying Euler method, first of all the expression
has to be linearized around the fixed points (x0 and y0).
After applying Taylor expansion and underestimate 2nd order terms, the
equation obtained is:
=
Where:
=
=
=
=

Computing the following code it can be obtained the approximated values of the
system response.
clear all
A1=[1 2; 3 1];
A2=[1 -2; 3 1];
U=[1;2];
t=0;
dt=0.1;
Us=U;
ts=t;
for i=1:50
U=U+A1*U*dt;
t=t+dt;
ts=[ts t];
Us=[Us U];
end
plot(ts,Us(1,:),ts,Us(2,:))

Results
Once it has been executed, there are obtained 2 different results, one for each case (A1
and A2)
For A1:

And for A2:

Conclusions
The results obtained are quite different, but they are obtained with only a little change
in the Jacobian matrix. In the first case, for A1 the response of the 2 variables increases
through time, reaching the infinite after 5 seconds. On the other hand, for A2, the result
maintains almost constant through time until the second 3, where it is initiated a small
oscillation.

Exercise 2
Introduction
Calculate the response of a two-dimensional system following the next scheme:

Fixed points
Linearize and classify them
Phase portrait

Model
The equations given are
= +
= 2

Results
To find the fixed points of the system, it is needed to equalize both derivatives to 0.

=0

=0

There are obtained three fixed points, (0,0), (1,0)and (-1,0).


= 1 + 3
0

The Jacobian matrix of the model is

0
2

Evaluating the Jacobian matrix in the point (0,0), the Jacobian gets the following form:
=
With the respective eigenvalues

1=-1

and

1 0
0 2
2=

-2, being a stable point.

The respective eigenvectors of this eigenvalues are:


0
1

1
0

On the other hand, for the points (1,0) or (-1,0) the Jacobian matrix gets the same
values.
=
The eigenvalues obtained are

1=2

and

2=

2 0
0 2
-2, obtaining a saddle point.

The respective eigenvectors of this eigenvalues are the same than in the previous case:
0
1

1
0

Plotting some trajectories, the following figure is obtained:

Matlab code:
clear all
[x,y]=meshgrid(-3:0.4:3, -3:0.4:3);
x1=-x+x^3;
y1=-2*y;
scale_factor = 0.07;
quiver(x,y,x1*scale_factor,y1*scale_factor,'AutoScale','off')
hold on
A1=[-1 0; 0 -2];
A2=[2 0; 0 -2];
U=[-0.5;-3];
t=0;
dt=0.0001;
Us=U;
ts=t;
for i=1:30000
U=U+A1*U*dt;
t=t+dt;
ts=[ts t];
Us=[Us U];
end
plot(Us(1,:),Us(2,:));

hold on
[V,D] = eig(A1)
[V,D] = eig(A2)
%axis plot
t=-3:0.01:3;
plot(t,0,'k')
t=-3:0.01:3;
plot(0,t,'k')
%fixed points
scatter(0,0)
scatter(-1,0)
scatter(1,0)
% eigenvectors
t=-3:0.01:3;
plot(t,0,'r')
plot(0,t,'r')
plot(t-1,100000*t,'r')
plot(t+1,100000*t,'r')
axis([-3,3,-3,3])

Conclusions
This system is composed by 3 fixed points, having a stable point in the center and two
saddle points. The phase portrait is symmetric respect the y axis. The system, as it is
seen in the phase portrait, tends to be quite stable.

Exercise 3
Introduction
Calculate the response of a two-dimensional system following the next scheme:

Fixed points
Linearize and classify them
Phase portrait

I did this exercise before having the mail with the statements so I haven't implemented
Runge Kutta. I tried it but I had some problems with the result.

Model
The equations given are
=

Results
To find the fixed points of the system, it is needed to equalize both derivatives to 0.

=0

=0

There is only one fixed point, the (-1,0).


=

The Jacobian matrix of the model is

1
0

Evaluating the Jacobian matrix in the point (0,0), the Jacobian gets the following form:
=
With the respective eigenvalues
are:

1=1

and
1
0

1 1
0 1
2=

-1, being a saddle point, the eigenvectors

0.4472
0.8944

Plotting some trajectories, the following figure is obtained:

Matlab code:
clear all
[x,y]=meshgrid(-3:0.4:3, -3:0.4:3);
x1=x+exp(-y);
y1=-y;
scale_factor = 0.07;

quiver(x,y,x1*scale_factor,y1*scale_factor,'AutoScale','off')
hold on
A1=[1 -1; 0 -1]
U=[-1;2];
t=0;
dt=0.001;
Us=U;
ts=t;
for i=1:6000;
U=U+A1*U*dt;
t=t+dt;
ts=[ts t];
Us=[Us U];
end
plot(Us(1,:),Us(2,:));
hold on
[V,D] = eig(A1)
%axis plot
t=-3:0.01:3;
plot(t,0,'k')
t=-3:0.01:3;
plot(0,t,'k')
% eigenvectors
scatter(-1,0)%fixed point
t=-3:0.01:3;
plot(t,0,'r')
t=-4:0.01:4;
plot(0.4472*t-1,0.8944*t,'r')
axis([-3,3,-3,3])

Conclusions
This system is composed by only one fixed point, which represents a saddle point. This
system is quite unstable because the solution tends to find de + and -. For negative
values of y, the system goes really fast to the + in the x axis. On the other hand, for
positive values of y the response tends to the infinite but with less velocity.

Exercise 4
Introduction
Calculate the response of the Van der Pol equation for two different initial conditions
and plot the results. The Van der Pol oscillator is a non-conservative oscillator with non-

linear damping. Energy is dissipated at high amplitudes and generated at low


amplitudes. As a result, there exists oscillations around a state at which energy
generation and dissipation balance.

Model
The equation given is:
+

=0

Where:
=1.5

Results
To find the solution of the problem, the equation has been divided in two components:
=
=$ 1

Considering different initial conditions ( x0,y0)=(0.5,0) and ( x0,y0)=(1.5,0) and using


matlab, it has been calculated the equation solution, which has the following aspect.
For ( x0,y0)=(0.5,0)

For ( x0,y0)=(1.5,0)

For ( x0,y0)=(0,4)

If it is plotted the solutions vs the derivative, it is obtained:


For ( x0,y0)=(0.5,0)

For ( x0,y0)=(1.5,0)

For ( x0,y0)=(0,4)

Matlab code:
function dydt=funct(t,y)
dydt=[y(2);1.5*(1 - y(1)^2)*y(2) - y(1)];

clear all
tint=[0 20];
y1=1.5;
y2=0;
[t,y]=ode45(@funct,tint,[y1 y2]);
plot(y(:,2),y(:,1))
hold on
%axis plot
t=-5:0.01:3;
plot(t,0,'k')
t=-3:0.01:3;
plot(0,t,'k')

Conclusions
After computing the results, it can be concluded that Van der Pol equation only has one
limit cycle. From the figures obtained, it can be seen that the oscillations converge in the
limit cycle.
As it is known, energy is dissipated at high amplitudes and generated at low amplitudes,
it can be interesting to test what happens with higher values of . It will be also
interesting to introduce a driving force to the system to see the effects and analyse the
results.

Exercise 5
Introduction
The forced duffing oscillator presents various nonlinear dynamic behaviors ranging from
limit cycles to chaos. When the periodic force driving the system is large, we get chaotic
behavior and a strange attractor. The system behavior is sensitive to the initial
condition.
Consider the forced duffing oscillator and do the following calculations:
-Show the phase plane for F = 0, = 0.
-Show the trajectories in the phase plane and the evolution in time of x for two or
three different initial conditions when = 0.25, F = 0.
-Do the same for = 0.25, F = 0.25 for the initial conditions (x, x ) = (0.2, 0.1) and
(x, x ) = (0.195, 0.1).
-Do the same for = 0.25, F = 0.4 for the initial conditions (x, x ) = (0.2, 0.1) and
(x, x ) = (0.195, 0.1).

Model
The equation given is:
% +&

= ' cos ,

Results
In the following figures it can be seen the different results for the different conditions
asked for:

- F = 0, = 0

- = 0.25, F = 0

- = 0.25, F = 0.25 for the initial conditions (x, x ) = (0.2, 0.1) and
(x, x ) = (0.195, 0.1)

- = 0.25, F = 0.4 for the initial conditions (x, x ) = (0.2, 0.1) and
(x, x ) = (0.195, 0.1).

Matlab code:
function dz=duffing(t,z)
dz=[z(2);(0.4*cos(t)-0.25*z(2)+z(1)-z(1)^3)];

clear all
[t,z]=ode45('duffing',[0,100],[0.2,0.1]);
figure(1)
hold on
plot(t,z(:,1))
hold on
[t,z]=ode45('duffing',[0,100],[0.195,0.1]);
plot(t,z(:,1),'r')
figure(2)
[t,z]=ode45('duffing',[0,100],[0.2,0.1]);
plot(z(:,1),z(:,2))
hold on
[t,z]=ode45('duffing',[0,100],[0.195,0.1]);
plot(z(:,1),z(:,2),'r')

Conclusions
After computing the results, it can be concluded that the forced duffing oscillator
response varies a lot depending on the initial condition and the external force. As it is
seen on the results, for lower values of F, the response is more predictable. On the other
hand, when increasing the values, the final response changes a lot, arriving to chaos.
Referring to the initial conditions, in all the cases it has been plotted the results with two
different initial conditions, with quite closer values. Finally, the responses obtained from
the two cases are really different.
So, it has been demonstrated that with small changes in the system, the response can
vary a lot.

Das könnte Ihnen auch gefallen