Control Systems Lab 2
Control Systems Lab 2
CPE325
Lab 02
Registration
CIIT/FA19-BCE-022/ISB
Number
Class BCE-6A
1.
2. Find Response of the system for following Inputs;
a. Unit Step
b. Unit Impulse
c. Ramp
d. Sinusoidal
In- Lab Task:
Task 1:
s+ 0.25
G(s)=
s ( s +1 ) ( s+ 2 ) (s +3)
Considering G(s), prove that tf2zp() and zp2tf() are inverse of each other. Also, prove that
laplace() and illaplace() exhibits the same property.
Code:
clc;
close all;
clear all;
z = 0.25;
p = [0 1 2 3];
k = 1;
G1 = zpk(z,p,k)
[num ,den] = zp2tf(z,p,k)
[zeros,poles,k] = tf2zp(num,den)
syms s;
x = ilaplace(fun);
pretty(x)
y = laplace(x);
pretty(y)
Task 2:
Find inverse Laplace transform f(t) & hence find inverse from partial fraction form(use
MATLAB to compute the residues). Where
5 4 3 2
s + 8 s +23 s +35 s +28 s +3
F (s )= 3 2
s +6 s +8 s
Code:
clc;
close all;
clear all;
syms s;
y = ilaplace(fun)
pretty(y);
Solution:
Task 02:
Use the mathematical model, computed in In-lab task 02, and find its state space
representation using MATLAB.
Code:
clc;
close all;
clear all;
In this lab, We learnt about the Solution differential equation and Transfer
function-based modelling by using MATLAB and Simulink. We learnt the use
of different function Such as Transfer Function ( tf ) , Zero/pole/gain(z,p,k) ,
State-space ( ss ) and Frequency response data ( frd). We can find the laplace
and inverse laplace of differential equation by using different functions.
Simulink provides graphical environment for modelling , simulating, and
analysing of dynamic systems. A MATLAB code can be generated from a
Simulink model.
Performance Viva
Total/15
(10 Marks) (5 Marks )
Performance /6
Results /3
Critical Analysis /1