(00)Limit Cycle

22
Lab Report On Control system simulation using MATLAB and SIMULINK (a) To plot closed loop frequency response of a unity feedback system from the open loop response using Nichol’s plot and Nichols chart:- We can draw closed loop frequency response of a unity feedback system from the open loop response using following method- By superimposing open loop response on constant M and constant N circle - In this method we can get different magnitude with corresponding frequencies for close Loop system and also can get different phase with corresponding frequencies for close Loop system. By these data we can plot close loop frequency response of unity feedback system. Using Nichol’s plot and Nichol’s chart- In this method initial we draw Nichol’s plot on Nichol’s chart. Nichols plot represent Open loop gain (in db) Vs open loop phase plot. Point on this plot represents open Loop behaviour while Nichols chart grid shows the magnitude and phase corresponding To close loop system with unity feedback. Using these two plots we can get different Magnitude with corresponding frequencies and also can get different phase with Corresponding frequencies for close Loop system. By these data we can plot close loop frequency response of unity feedback system.

Transcript of (00)Limit Cycle

Page 1: (00)Limit Cycle

Lab Report On

Control system simulation using MATLAB and SIMULINK

(a) To plot closed loop frequency response of a unity feedback system from the open loop response using Nichol’s plot and Nichols chart:-

We can draw closed loop frequency response of a unity feedback system from the open loop response using following method-

By superimposing open loop response on constant M and constant N circle - In this method we can get different magnitude with corresponding frequencies for close Loop system and also can get different phase with corresponding frequencies for close Loop system. By these data we can plot close loop frequency response of unity feedback system.

Using Nichol’s plot and Nichol’s chart- In this method initial we draw Nichol’s plot on Nichol’s chart. Nichols plot represent Open loop gain (in db) Vs open loop phase plot. Point on this plot represents open Loop behaviour while Nichols chart grid shows the magnitude and phase corresponding To close loop system with unity feedback. Using these two plots we can get different Magnitude with corresponding frequencies and also can get different phase with Corresponding frequencies for close Loop system. By these data we can plot close loop frequency response of unity feedback system.

Magnitude plot

Page 2: (00)Limit Cycle

Phase plot

Ex.:- Take a system with open loop transfer function G (s )H ( s )= 5s(s+1)(s+2)

NICHOLS CHART & NICHOLS PLOT :

-360 -315 -270 -225 -180 -135 -90 -45 0-120

-100

-80

-60

-40

-20

0

20

40

60

6 dB 3 dB

1 dB

0.5 dB 0.25 dB

0 dB

-1 dB

-3 dB

-6 dB

-12 dB

-20 dB

-40 dB

-60 dB

-80 dB

-100 dB

-120 dB

Nichols Chart

Open-Loop Phase (deg)

Open

-Loo

p Gain

(dB)

Page 3: (00)Limit Cycle

OBSERVATION TO DRAW CLOSE LOOP BODE PLOT :- - -

(A) For magnitude plot-

S.No. Close loop gain from plot(in db)

Close loop frequencyFrom plot (rad./sec.)

1. -100 79.7

2. -80 36.9

3. -60 16.8

4. -40 7.81

5. -20 3.5

6. -12 2.59

7. -6 2.13

8. -3 1.92

9. -1 1.83

10. 0 1.78

11. 1 1.74

12. 3 1.66

13. 6 1.57

(B) For phase plot—

S.No.Close loop Phase from

plot (deg.)Close loop frequencyFrom plot (rad./sec.)

1 0 0.044

2 -10 0.22

3 -20 0.441

4 -30 0.883

5 -180 1.4

6 -210 2.04

7 -240 5.26

Page 4: (00)Limit Cycle

MatLab Command to draw bode plot from above table—

Plots for close loop systemMagnitude plot—

0 10 20 30 40 50 60 70 80-100

-80

-60

-40

-20

0

20

frequency w(rad/sec)

clos

e lo

op

gain

(db)

Phase plot---

W= [79.7 36.9 16.8 7.81 3.5 2.59 2.13 1.92 1.83 1.78 1.74 1.66 1.57];

M= [-100 -80 -60 -40 -20 -12 -6 -3 -1 0 1 3 6] ;

Figure(1);

Plot(w,m);

W= [5.26 2.04 1.4 .883 .441 .22 .044];

Phi= [-240 -210 -180 -30 -20 -10 0];

Figure (2);

Plot(w,phi);

Page 5: (00)Limit Cycle

0 1 2 3 4 5 6-250

-200

-150

-100

-50

0

frequency(rad/sec)

clo

se loop

phase(d

eg)

(b) Study of nonlinear systems using MATLAB/SIMULINKAlmost all systems are nonlinear. Modern approach in system engineering, state space approach, can deal with nonlinear systems also. Nonlinear systems exhibit many phenomena which are not seen in linear systems.

1. Simulating effect of saturation on the closed loop performance of a control system

If we simulate the system given below then the closed loop system has two conjugate roots which lie on the right half of the plane hence the system has unstable response as shown in the diagram next to it.

Fig: Simulation block diagram and unstable output without saturation block

But when we add a saturation block which makes the system non linear since saturation is a non linear function the system different characteristic. It becomes marginally stable. The system remains

Page 6: (00)Limit Cycle

marginally stable even if we change the value of saturation levels. The output of the saturation block after attaining saturation levels oscillates between two values hence the output of complete system is also confined and oscillates between two levels.

Fig: Simulation block diagram and unstable output with saturation block

2. To draw the equilibrium points (singular points) of second order nonlinear system Linearization Of Non-Linear System (Equilibrium point)

Consider a system of n-state variable

[ X ]=[ x1

x2

.

.xn

]The system is modeled in non linear mathematical equation as follows –

X1=f (X1 ,X 2 , X3………X n)

X2=g (X1 , X2 , X3………Xn)

X n=Ф(X1 , X2 , X3………Xn)

In order to linearise the system, we need to find the equilibrium point. Equilibrium is a state of a system which does not change.

For example consider the system

Page 7: (00)Limit Cycle

x1=P(x1 , x2 , x3………xn)

x2=Q(x1 , x2 , x3………xn)

xn=Ф (x1 , x2 , x3………xn)

For this n-state system, equilibrium point occurs when

x1=x2=x3=…⋯=xn=0

Similarly,

X1=X2= X3=…⋯⋯=X n=0 …. (1)

Now the Jacobian Matrix is evaluated, Jacobian Matrix for Linearisation at equilibrium point

J=[dfd x1

dfd x2

dfd x3

⋯ dfd xn

⋮ ⋱ ⋮dФd x1

dФd x2

dФd x3

⋯ dФd xn

] …………….. (2)

The partial derivative are evaluated at equilibrium points found from solution of eq. (1). Now the system has been linearised in the vicinity of equilibrium point.

This Jacobian matrix found in eq. (2) gives the state transition matrix [A] corresponding to the linearised system

[J ]eq. point=[A ]

X=AX+BU

Now the eigen value of the state transition matrix [A] are calculated

det [ λI−A ]=0 . ……….. (3)

Solving (3) gives eigen values

There are six possible Types of equilibrium points of second order linear systems corresponding to Eigen values:--

Page 8: (00)Limit Cycle

1. If both value lies in left half plane at real axis:---

2. If both value lies in left half plane at real axis:--

3. If values are complex conjugate and lies in left half plane:--

4. If values are complex conjugate and lies in right half plane:--

Page 9: (00)Limit Cycle

5. If values are complex conjugate and lies on imaginary axis:--

6. If value lies on real axis one in right half and other in left half plane:-

Example of FOCUS & SADDLE POINT :--

Take a non linear system with following data

x1= x2

x2=−x1+x1

3

6−x2

This system have 3 equilibrium point at (0,0),(√ 6,0),(−√ 6,0)

For this system we get Jacobian

J=[ 0 1−1+x1

2/2 −1]For linearizing this system across (0,0) ,we will get state transition matrix

A=[ 0 1−1 −1]

Now find the eigen value of matrix A (eig(A)) we will get –12±j √32

.

Page 10: (00)Limit Cycle

So at (0,0) we will get Stable focus.

MATLAB COMMAND:

function z = node(t,x) z = zeros(2,1); z(1) = x(2);z(2) = -x(1)-x(2);

-0.4 -0.3 -0.2 -0.1 0 0.1 0.2 0.3-0.2

-0.15

-0.1

-0.05

0

0.05

0.1

0.15

For linearizing this system across (±√6,0) ,we will get same state transition matrix for both points

A=[0 12 −1]

Now find the eigen value of matrix A (eig(A)) we will get 1 , – 2.

for i=1:10

t=[0 50];

x=[.01*i;.1];[t,x]=ode23('node',t,x);

plot(x(:,1),x(:,2));hold on;

t=[0 50];

x=[-.01*i;-.1];[t,x]=ode23('node',t,x);

plot(x(:,1),x(:,2));hold on;

end

Page 11: (00)Limit Cycle

So at (0,0) we will get Saddle point.

MATLAB COMMAND:

function z = node(t,x) z = zeros(2,1); z(1) = x(2);z(2) = 2*x(1)-x(2);

-3 -2 -1 0 1 2 3

-3

-2

-1

0

1

2

3

Example Of NODE:-

Take a linear 2nd order system

Eigen value of system:-

eig(A) -1

for i=1:50

t=[0 2];

x=[-2;.5*i];[t,x]=ode23('node',t,x);

plot(x(:,1),x(:,2));hold on;

end

hold on;

for i=1:50

t=[0 2];

x=[2;-.5*i];[t,x]=ode23('node',t,x);

plot(x(:,1),x(:,2));hold on;

end

x+3 x+2 x=0 . A=[0 1−2 −3 ]

Page 12: (00)Limit Cycle

-2

So we will get Stable node.

MATLAB COMMAND:

function z = node(t,x) z = zeros(2,1); z(1) = x(2);z(2) = -2*x(1)-3*x(2);

-0.1 -0.05 0 0.05 0.1

-0.3

-0.2

-0.1

0

0.1

0.2

Example Of CENTER POINT:-

Take a linear 2nd order system

Eigen value of system:-

eig(A) -1

-2

for i=1:50

t=[0 50];

x=[.01*i;.1*i];[t,x]=ode23('node',t,x);

plot(x(:,1),x(:,2));hold on;

t=[0 50];

x=[-.01*i;-.1*i];[t,x]=ode23('node',t,x);

plot(x(:,1),x(:,2));hold on;

end

θ+sinθ=0x1=x2 ;x2=−sin x1

Page 13: (00)Limit Cycle

So we will get CENTER POINT.

MATLAB COMMAND:

function z = node(t,x) z = zeros(2,1); z(1) = x(2);z(2) = -sin(x(1));

-0.2 -0.15 -0.1 -0.05 0 0.05 0.1 0.15-0.2

-0.15

-0.1

-0.05

0

0.05

0.1

0.15

3. Simulation of various phenomena (input dependent stability, limit cycles, chaos..) exhibited by nonlinear systems

Input Dependent Stability

Stability of a linear system is always dependent on the system itself not on the input. But for a nonlinear system, stability can be dependent on the input also.

Simulate the system as given in the diagram. It is a linear system. Its closed loop poles are -1.75, -0.1226+0.7449i and -0.1226-0.7449i so the system is stable and its stability is not dependent on the input. If we change the value of input as r=0.2, 1.5 and 5 we get outputs as-

for i=1:10

t=[0 50];

x=[.01*i;-.01*i];[t,x]=ode23('node',t,x);

plot(x(:,1),x(:,2));hold on;

end

Page 14: (00)Limit Cycle

r= 0.2 r=1.5

r=5

r=1.72

We always get stable output even if we change the input it is only function of system parameters.

But for the non linear system the stability is also a function of input, not only the system poles. If we introduce squaring function in between as shown in the figure given below then the system becomes non linear and as we change the input the stability is also changing.

r

r=0.2 r=1.5

Page 15: (00)Limit Cycle

r=1.72

The system is stable for small input but as the input value increases the stability is decreasing. For r=0.2 it is stable, r=1.5 it is critically stable and for r=1.72 it is unstable. For non linear system stability also dependent on input to the system but in non-linear system stability doesn’t depend on input.

Limit Cycle

The non linear systems are defined in terms of disturbed steady state coming back to its equilibrium position or at least lying within tolerable limits. Sometimes they may show strange behaviour, while in tolerance limits they follow a trajectory or limit cycle. So, the limit cycles decide the oscillations of non linear systems.

Since we know that linear system x=Ax can have closed periodic orbits, but not an isolated orbit. This happens when eigen values are on the imaginary axis. Linearity requires that if

x ( t ) is a solution, so is a x ( t ), a≠0 . Thus the amplitude of a periodic cycle in a linear system depends on the initial conditions. But in non linear systems we have isolated orbits and hence the amplitude and period of oscillations are independent of input. Since this is not a forced system, the oscillations are self-excited.

Let us consider Van der Pol equation x+( x2−1) x+x=0

The system finally enters limit cycle. If |x|<<1, then the damping factor is negative, the energy is put in the system, so amplitude increases till the system state enters the limit cycle as shown. And if |x|>>1, then the damping is factor is large positive factor, the energy is taken out of the system behaves like an over damped system with consequent decrease in amplitude of x. Here the limit cycles are stable oscillations.

Page 16: (00)Limit Cycle

Limitcycle.mfunction dx= limitcycle(t,x)dx=zeros(2,1);dx(1)=x(2);dx(2)=(1-x(1)^2)*x(2)-x(1);

main windowfor i=-30:30x0=([.1*i,.1*i]);ts=[0 100];[t,x]=ode23('limitcycle',ts,x0);plot(x(:,1),x(:,2));hold on;x0=([.1*(-i),.1*i]);ts=[0 100]; [t,x]=ode23('limitcycle',ts,x0);plot(x(:,1),x(:,2));hold on;end;

x vs x for different input values

Even if we change the input the system is entering into same oscillations. It has been shown with x vs t for two input values (2,2) and (-2,-2).

x0=([-2,-2]);ts=[0 40];[t,x]=ode23(‘limitcycle',ts,x0);plot(t,x(:,1),'color','red');x0=([2,2]);ts=[0 40];[t,x]=ode23('limitcycle',ts,x0);plot(t,x(:,1),'color','blue');

(x vs t) for two different inputs

Chaos

x1=10 x2−10 x1

x2=x1 (27−x3 )−x2

x3=x1 x2−83x3 x(0)= [0.1;0.1;0.1];

The late Edward Lorenz (1963) is justly famous for his “butterfly effect,” the most widely agreed upon characteristic of chaotically dynamic nonlinear system while studying computer simulations of a

Page 17: (00)Limit Cycle

three equation model of climatic fluid dynamics. The Lorenz System is a system of differential equations which offers explanation to unpredictable behaviour of the weather.

Lorenz had discovered that small changes in initial conditions produced large changes in the long-term outcome. This effect came to be known as the butterfly effect.

Instead of starting the whole run over, even if a small approximation of fourth digit after decimal is taken in giving the initial condition the output shows completely different waveform as shown above.

The practical consequence of the butterfly effect is that complex systems such as the weather (or stock market) are difficult to predict past a certain time range - approximately a week, in the case of weather. See in Fig, the behaviour of the system for shorter time is predictable, but not for longer time.

The system though tries to move around the Equilibrium points also called ‘fixed points’ or ‘attractors’.

Solution for shorter time (x1 vs x2) Lorentz attractor(x1 vs x3)

Chaos.m main window (Lorentz attractor)function dx= chaos(t,x) x0=[.1,.1,.1];dx=zeros(3,1); ts=[0 100];dx(1)=10*x(2)-10*x(1); [t,x]=ode23('chaos',ts,x0);dx(2)= x(1)*(27-x(3))-x(2); plot(x(:,1),x(:,3));dx(3)=x(1)*x(2)-x(3)*8/3;

0 5 10 15 20 25 300

2

4

6

8

10

12

14

16

18

-20 -15 -10 -5 0 5 10 15 200

5

10

15

20

25

30

35

40

45

50

Page 18: (00)Limit Cycle

short time predictabilityts=[0 .5];[t,x]=ode23('dif',ts,x0); plot(x(:,2),x(:,1));

Chaotic processes are often confused with random processes. A truly random process is characterized by a large number of unrelated events, events without any pattern or regularity. The so-called randomness of chaotic processes is just their appearance to an observer. Chaotic processes involve related events expressed by a deeply embedded regularity. Chaos, in this modern view, is not to be thought of as complete disorganization and irregularity. Furthermore, chaotic processes are still constrained by the laws of physics. Even though two, nearly identical leaves will diverge chaotically during their fall, neither will fall like a rock or fall at 100 miles an hour. The fine details of their descent will differ, but their overall dynamics will remain typical of leaves in general under the influence of gravity and under normal wind. In case of chaos for long time we can’t predict the behaviour of state and get a trajectory diagram as shown above this is also known as butterfly effect.