LAB01 Control System
LAB01 Control System
Section : EPE-6C
Task:
Following are the two transfer functions. Plot the step and impulse response and label
properly in script as well as in Simulink.
1. (s+1)/(s2+2s+1)
Matlab Code:
clear all;
close all;
clc
NUMERATOR = [1 1]; % (s+1)
DENOMINATOR = [1 2 1]; % (s^2+2s+1)
sys=tf(NUMERATOR,DENOMINATOR) % Transfer Function
impulse (sys) % Impulse Response
hold on;
step(sys) % Step Response
grid on;
xlabel('Time','fontweight','bold')
ylabel('Amplitude','fontweight','bold')
title('Impulse and Step Response for system G(s)=(s+1)/(s^2+2s+1)')
legend('Impulse Response','Step Response')
Figure:
Impulse and Step Response for system G(s)=(s+1)/(s2 +2s+1)
1
Impulse Response
0.9
Step Response
0.8
0.7
0.6
Amplitude
0.5
0.4
0.3
0.2
0.1
0
0 1 2 3 4 5 6 7
Time (seconds)
Simulink Model
Code:
plot(tout,simout)
hold on;
plot(tout,simout1)
grid on
xlabel('Time')
ylabel('Amplitude')
title('Impulse and Step Response for system G(s)=(s+1)/(s^2+2s+1)')
legend('Impulse Response','Step Response');
Figure:
Impulse and Step Response for system G(s)=(s+1)/(s2 +2s+1)
1
Impulse Response
0.9 Step Response
0.8
0.7
0.6
Amplitude
0.5
0.4
0.3
0.2
0.1
0
0 1 2 3 4 5 6 7 8 9 10
Time
2. 10/(s+1)(s+3)(s+5)
Or 10/s^3+9s^2+23s+15
Matlab Code:
clear all;
close all;
clc
NUMERATOR = [10]; % 10
DENOMINATOR = [1 9 23 15]; % s^3+9s^2+23s+15
sys=tf(NUMERATOR,DENOMINATOR) % Transfer Function
impulse (sys) % Impulse Response
hold on;
step(sys) % Step Response
grid on;
xlabel('Time','fontweight','bold')
ylabel('Amplitude','fontweight','bold')
title('Impulse and Step Response for system G(s)=10/s^3+9s^2+23s+15')
legend('Impulse Response','Step Response')
Figure:
0.5
Amplitude
0.4
0.3
0.2
0.1
0
0 1 2 3 4 5 6 7 8 9
Time (seconds)
Simulink Model
Code:
plot(tout,simout)
hold on;
plot(tout,simout1)
grid on
xlabel('Time')
ylabel('Amplitude')
title('Impulse and Step Response for system G(s)=(10)/s^3+9s^2+23s+15')
legend('Impulse Response','Step Response');
Figure:
Impulse and Step Response for system G(s)=(10)/s3 +9s 2 +23s+15
0.7
Impulse Response
Step Response
0.6
0.5
Amplitude
0.4
0.3
0.2
0.1
0
0 1 2 3 4 5 6 7 8 9 10
Time