0% found this document useful (0 votes)
32 views

LAB01 Control System

The document discusses plotting the step and impulse response of two transfer functions. For the first transfer function G(s)=(s+1)/(s^2+2s+1), the impulse and step response are plotted using MATLAB code and Simulink. For the second transfer function G(s)=10/(s+1)(s+3)(s+5), the impulse and step response are similarly plotted.

Uploaded by

Muhammad Daniyal
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views

LAB01 Control System

The document discusses plotting the step and impulse response of two transfer functions. For the first transfer function G(s)=(s+1)/(s^2+2s+1), the impulse and step response are plotted using MATLAB code and Simulink. For the second transfer function G(s)=10/(s+1)(s+3)(s+5), the impulse and step response are similarly plotted.

Uploaded by

Muhammad Daniyal
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

LAB 01

Subject : CONTROL SYSTEM


Submited To : ENGR MASROOR AHMAD
Date:- 09-03-2022

Submitted By Registration No.

SYED ARBAZ KHAN FA19-EPE-110

Section : EPE-6C

ELECTRICAL Engineering Department


CIIT,ABBOTTABAD

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:

Impulse and Step Response for system G(s)=10/s 3 +9s 2 +23s+15


0.7
Impulse Response
0.6 Step Response

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

You might also like