Control Systems Lab
P2
Submitted By:
Syed Muhammed Baqir Naqvi (170984)
Muhammed Inam Anwar (170966)
Qazi Ahasan Nawaz (171008)
Class/Sec: BEEP 5A
Submitted To: Engr. Hussain Asif
Instructor’s Remarks:
Submission Time: In Late in Working Days
Time 0 1 2 3 4 5
Marks: Total Marks Obtained Marks
Additional Remarks: _______________________________________
________________________________________________________
Instructor’s Signature: _____________
Lab No 4
STATE-SPACE REPRESENTATION &
POLE-ZERO MAPPING
1. Objectives:
To construct systems using State Space Representation equations.
To make conversions between different types of representations.
2. Procedures:
Using Matlab approach to determine the State space modeling of a system.
The system we need to model via state modeling is as follows.
Relative equations obtained in s domain are
( s2 + s+1 ) X 1 ( s )−( s ) X 2 ( s )=F ( s ) … … … … … .. ( i )
−( s ) X 1 ( s )−( s2 + s+1 ) X 2 ( s )− X 3 ( s ) =0 … … …(ii)
−X 2 ( s ) + ( s2 + s+1 ) X 3 ( s )=0 … … … … … … … …(iii)
As we know general form of state space representation would be
So its implementation on this particular system would become
¿
x1
x1 '
y=x 3= [ 0 0 0 0 0 0 ] x 2
x2 '
x3
x3 '
[]
Here we can conclude the values of A,B,C and D
0 1 00 0 0
A=
[
−1 −1 0 1 0 0
0 0 01 0 0
0 1 −1 −1 −1 0
0 0 0 0 0
0 0 1 0 −1 −1
C=[ 0 0 0 0 0 0 ]
1 ]
, B=[ 0 1 0 0 0 0 ]
Now that we need to implement it on the Matlab to declare our state space model.
We would simply do.
Code:
A=[0 1 0 0 0 0;-1 -1 0 1 0 0;0 0 0 1 0 0;0 1 -1 -1 -1 0;0 0 0 0 0 1;0 0 1 0 -1
-1];
B=[0;1;0;0;0;0];
C=[0 0 0 0 1 0];
D=[];
x=ss(A,B,C,D)
y=tf(x)
Results:
X =
A =
x1 x2 x3 x4 x5 x6
x1 0 1 0 0 0 0
x2 -1 -1 0 1 0 0
x3 0 0 0 1 0 0
x4 0 1 -1 -1 -1 0
x5 0 0 0 0 0 1
x6 0 0 1 0 -1 -1
B =
u1
x1 0
x2 1
x3 0
x4 0
x5 0
x6 0
C =
x1 x2 x3 x4 x5 x6
y1 0 0 0 0 1 0
D =
u1
y1 0
Continuous-time state-space model.
Use MATLAB to convert the LTI state-space representation to the LTI transfer function.
Code:
syms s
A=[0 1 0 0 0 0;-1 -1 0 1 0 0;0 0 0 1 0 0;0 1 -1 -1 -1 0;0 0 0 0 0 1;0 0 1 0 -1
-1];
B=[0;1;0;0;0;0];
C=[0 0 0 0 1 0];
D=[];
x=ss(A,B,C,D)
y=tf(x)
t=eye(6)
q=s*t-A
p=inv(q);
u=C*p*B;
pretty(u)
Result:
x =
A =
x1 x2 x3 x4 x5 x6
x1 0 1 0 0 0 0
x2 -1 -1 0 1 0 0
x3 0 0 0 1 0 0
x4 0 1 -1 -1 -1 0
x5 0 0 0 0 0 1
x6 0 0 1 0 -1 -1
B =
u1
x1 0
x2 1
x3 0
x4 0
x5 0
x6 0
C =
x1 x2 x3 x4 x5 x6
y1 0 0 0 0 1 0
D =
u1
y1 0
Continuous-time state-space model.
y =
s - 4.441e-16
---------------------------------------------
s^6 + 3 s^5 + 5 s^4 + 6 s^3 + 6 s^2 + 4 s + 2
Continuous-time transfer function.
t =
1 0 0 0 0 0
0 1 0 0 0 0
0 0 1 0 0 0
0 0 0 1 0 0
0 0 0 0 1 0
0 0 0 0 0 1
q =
[ s, -1, 0, 0, 0, 0]
[ 1, s + 1, 0, -1, 0, 0]
[ 0, 0, s, -1, 0, 0]
[ 0, -1, 1, s + 1, 1, 0]
[ 0, 0, 0, 0, s, -1]
[ 0, 0, -1, 0, 1, s + 1]
s
----------------------------------------
6 5 4 3 2
s + 3 s + 5 s + 6 s + 6 s + 4 s + 2
3. Learning outcomes:
This lab enables us to make our grip stronger towards the state space model and how to generate it using
transfer function. We calculated equations from the translational Mechanical system and then using
procedure of conversions conclude the matrices. Moreover, it teaches us to plot zeros and poles of a
system using MATLAB.