You are on page 1of 4

Thapar Institute of Engineering and Technology, Patiala

Department of Electrical & Instrumentation Engineering


Session: 2020-2021 Semester – IVth
Measurement Science and Techniques
(Lab-2 : Response of a first order system subjected to different inputs)

%Plot unit step response of the closed loop transfer function


Num=[1];
Den=[1 2];
g=tf(Num,Den)
step(g)
grid on;
title('Plot of unit step response of first order system')
xlabel('Time')
ylabel('Amplitude')

g =

1
-----
s + 2

Continuous-time transfer function.


% Unit ramp response of G(s)=(2s+1)/(s^2+0.2s+1)
%The unit ramp response is obtained as the unit step response of G(s)/s
num=[1];
den=[2 1 0];
t=0:0.1:10;
step(num,den)
grid
title('Unit ramp response')
%Plot unit step response of the closed loop transfer function
%Time should be upto 3 Seconds
Open loop transfer function of plant
Num=[1];
Den=[1 2];
g=tf(Num,Den)
sysy1=feedback(g,1)
step(sysy1)
grid on;
title('Plot of unit step response of first order system')
xlabel('Time')
ylabel('Amplitude')

g =

1
-----
s + 2

sysy1 =

1
-----
s + 3
% Unit impulse response of G(s)=1/s^2+0.2s+1
num=[1];
den=[1 0.2 1];

G=tf(num,den)
impulse(G)
grid
title('Unit impulse response')

s = tf('s');

G = 1/(s+1);

figure
subplot(311), impulse(G); % Impulse reponse
subplot(312), step(G); % Step Response
subplot(313), step(G / s); % Ramp response

You might also like