CS II Lab Manual 5

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

1|Page

Lab # 05

Routh Hurwitz Method and Bode Plot


Objective:

 To investigate the stability of a system using Routh Hurwitz Method using MATLAB.

Apparatus:

 MATLAB Software

Theory:

Before discussing the Routh-Hurwitz Criterion, firstly we will study the stable, unstable and marginally
stable system.
 Stable System: If all the roots of the characteristic equation lie on the left half of the 'S' plane then
the system is said to be a stable system.
 Marginally Stable System: If all the roots of the system lie on the imaginary axis of the 'S' plane
then the system is said to be marginally stable.
 Unstable System: If all the roots of the system lie on the right half of the 'S' plane then the system is
said to be an unstable system.

Routh-Hurwitz Criterion:

Routh Hurwitz criterion states that any system can be stable if and only if all the roots of the first column
have the same sign and if it does not has the same sign or there is a sign change then the number of sign
changes in the first column is equal to the number of roots of the characteristic equation in the right half of
the s-plane i.e. equals to the number of roots with positive real parts.
Necessary but not sufficient conditions for Stability
We have to follow some conditions to make any system stable, or we can say that there are some necessary
conditions to make the system stable.
Consider a system with characteristic equation:

1. All the coefficients of the equation should have the same sign.
2. There should be no missing term.
If all the coefficients have the same sign and there are no missing terms, we have no guarantee that the
system will be stable. For this, we use Routh Hurwitz Criterion to check the stability of the system. If the
above-given conditions are not satisfied, then the system is said to be unstable. A. Hurwitz and E.J. Routh
give this criterion.
Advantages of Routh- Hurwitz Criterion
Saeed Anwar Control System II Lab UW-20-MTS-BSc-025
2|Page

1. We can find the stability of the system without solving the equation.
2. We can easily determine the relative stability of the system.
3. By this method, we can determine the range of K for stability.
4. By this method, we can also determine the point of intersection for root locus with an imaginary axis.
Limitations of Routh- Hurwitz Criterion
1. This criterion is applicable only for a linear system.
2. It does not provide the exact location of poles on the right and left half of the S plane.
3. In case of the characteristic equation, it is valid only for real coefficients.

Lab Tasks

Task 1: Routh Hurwitz method

Determine the stability of system by using Routh Hurwitz Method in MATLAB.


Program:
coff=[-1, 2, 3];
routh_table=[];
first_row=[];
for i=1:2:length(coff)
first_row=[first_row,coff(i)];
end
routh_table=[routh_table;first_row]
second_row=[]
for idx=2:2:length(coff)
second_row=[second_row,coff(idx)];
end
while length(second_row)<length(first_row)
second_row=[second_row,0];
end
routh_table=[routh_table;second_row]
%now create the second row
required_row_to_compute=length(coff)-2;
%check and see if this is first order smaller
if required_row_to_compute<0
disp('trivial solution')
end
%find unknown row that is equal to the length of coff minus 2
routh_table_width=length(coff)-1
for loop_row=1:required_row_to_compute
unknown_row=[];
disp(['compute row',num2str(loop_row+2)])
%nw find divisor for det
divisor=routh_table(loop_row+1,1)
for col=1:length(coff)-1
disp(['computing column',num2str(col)])
left_half_det=routh_table(loop_row:loop_row+1,col)
if col==routh_table_width
right_half_det=[0;0];
else
right_half_det=routh_table(loop_row:loop_row+1,col)

Saeed Anwar Control System II Lab UW-20-MTS-BSc-025


3|Page

end
%combine both row and columnn
both_det=[left_half_det,right_half_det]
%find unknown value of last row
value=-det(both_det)\divisor
unknown_row=[unknown_row,value]
end
routh_table=[routh_table;unknown_row]
end
%check for stability
first_column=routh_table(:,1)
s=sign(first_column(1))
unstable=0;
for xyz=2;length(first_column)
value=first_column(xyz)
if s~=sign(value)
fprintf('System is Unstable')
unstable=1;
break
end
if ~ unstable
fprintf('System is Stable')
end
end
Output:
routh_table =
-1 3
second_row =
[]
routh_table =
-1 3
2 0
routh_table_width =
2
compute row3
divisor =
2
computing column1
left_half_det =
-1
2
right_half_det =
-1
2
both_det =
-1 -1
2 2
value =
Inf
unknown_row =
Inf
computing column2
left_half_det =
3
0
both_det =

Saeed Anwar Control System II Lab UW-20-MTS-BSc-025


4|Page

3 0
0 0
value =
-Inf
unknown_row =
Inf -Inf
routh_table =
-1 3
2 0
Inf -Inf
first_column =
-1
2
Inf
s=
-1
ans =
3
value =
2
System is Unstable>>

Task 2: Bode Plot


num=[1];
denum=[8,17,33];
G=tf(num,denum)
bode(G)
bode(G,{1,90})
x=[1 0 10 20 30 50 70 100];
bode(G,x,'-')

Output
G=
1
-----------------
8 s^2 + 17 s + 33

Continuous-time transfer function.

Conclusion:
In this lab we have learned about Routh-Hurwitz models and we have executed the measures to check
for strength in MATLAB. We have performed task for the two tasks. Bode plot was also studied in the

Saeed Anwar Control System II Lab UW-20-MTS-BSc-025


5|Page

lab. We can find the stability of the system without solving the equation. We can easily determine the
relative stability of the system.

Saeed Anwar Control System II Lab UW-20-MTS-BSc-025

You might also like