CS LAB 2
CS LAB 2
Control Systems
Lab-02
Introduction to MATLAB and Simulink, Solution of
Differential Equations Using MATLAB and Simulink
and Transfer Function Based Modelling
1 | Page
Objectives:
To evaluate and analyse transfer functions in MATLAB and to implement control
systems in MATLAB using Simulink.
2 | Page
1
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
0 1 2 3 4 5 6 7 8 9 10
b.
3 | Page
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
0 1 2 3 4 5 6 7 8 9 10
c.
4 | Page
9
0
0 1 2 3 4 5 6 7 8 9 10
d.
5 | Page
0.8
0.6
0.4
0.2
-0.2
-0.4
-0.6
-0.8
0 1 2 3 4 5 6 7 8 9 10
IN LAB TASK:
a.tf2zp
Matlab code:
6 | Page
Output:
b. zp2tf
Matlab code:
7 | Page
Output:
Output:
8 | Page
a.
Matlab code:
9 | Page
Output:
b.
Matlab code:
Output:
10 | P a g e
3.
Simulink block:
11 | P a g e
Output:
0.6
0.4
0.2
-0.2
-0.4
-0.6
-0.8
0 5 10 15 20 25 30 35 40 45 50
12 | P a g e
POST LAB:
1.
SIMULINK BLOCK:
OUTPUT:
0.14
0.12
0.1
0.08
0.06
0.04
0.02
0
0 1 2 3 4 5 6 7 8 9 10
13 | P a g e
2.
MATLAB CODE:
OUTPUT:
14 | P a g e
15 | P a g e
Critical Analysis / Conclusion:
In this lab we learn about the transfer function that how
do we apply the transfer function in the matlab and we
also learn about the differential equation that how we
implement the differential equation in the simulink And
we also learned that how we draw the block diagram of
the differential equation in the Simulink by giving
different sources such as sinusoidal, impulse response,
step response and ramp response and showed the effect
that caused by the differential equation to this response.
16 | P a g e