Lab Report#4 - CS
Lab Report#4 - CS
16 | P a g e
Lab#04
State Space Representation & Pole Zero Mapping
Lab Tasks
Task#1: Use MATLAB to generate the LTI state-space representation
derived in Prelab 1.
Hand Calculations:
𝑥 ′′ −1 −1 1 0 0 0 ⎡𝑥 ′ ⎤ 𝑥
⎡ ⎤ ⎡𝑥 ′⎤
⎡1 0 0 0⎤ ⎢ 𝑥 ⎥
⎢𝑥 ′⎥ 0 0 ⎢𝑥 ⎥
⎢𝑥 ′′⎥ ⎢⎢ 1 0 −1
⎥
1 0 1⎥ ⎢𝑥 ′⎥ + [1
⎢𝑥 ′⎥ = ⎢ 0 0 0 0 0 0 0] , 𝑦 = 𝑥 = [0 0 0 0 0 1] ⎢𝑥 ′⎥
0 1 0 0 0 ⎥⎢𝑥 ⎥ ⎢ ⎥
⎢ ⎥ ⎢0
⎢𝑥 ′′⎥ ⎣ 0 01 −1 −1 ⎥ ⎢𝑥 ′⎥ ⎢𝑥 ⎥
⎣𝑥 ′⎦ 0 0 0 0 1 0 ⎦⎣𝑥 ⎦ ⎣𝑥 ′⎦
Code Output
%Task 1
clear all
close all
clc
A=[-1 -1 1 0 0 0;1 0 0 0 0
0;1 0 -1 1 0 1;0 0 1 0 0 0;
0 0 0 1 -1 -1;0 0 0 0 1 0];
B=[10;0;0;0;0;0];
C=[0 0 0 0 0 1];
D=[];
statespace=ss(A,B,C,D)
17 | P a g e
Task#2: Use MATLAB to generate the LTI state-space representation
derived in Prelab 1.
Code Output
%Task 1
clear all
close all
clc
A=[-1 -1 1 0 0 0;1 0 0 0 0
0;1 0 -1 1 0 1;0 0 1 0 0 0;
0 0 0 1 -1 -1;0 0 0 0 1 0];
B=[10;0;0;0;0;0];
C=[0 0 0 0 0 1];
D=[];
statespace=ss(A,B,C,D)
x=tf(statespace)
Task#3: Run the programs composed in Prelab 3 and Prelab 4 and obtain the
symbolic transfer functions by the two methods.
Code Output
%Task 3
clear all
close all
clc
syms s
A=[-1 -1 1 0 0 0;1 0 0 0 0
0;1 0 -1 1 0 1;0 0 1 0 0
0;0 0 0 1 -1 -1;0 0 0 0 1
0];
B=[10;0;0;0;0;0];
C=[0 0 0 0 0 1];
D=[];
statespace=ss(A,B,C,D);
x=tf(statespace);
I=eye(6)
a=s*I-A
b=inv(a);
T=C*b*B;
pretty(T)
________________________
18 | P a g e