Control System Engineering: Lab Report 01
Control System Engineering: Lab Report 01
Control System Engineering: Lab Report 01
Lab Report 01
Introduction to MATLAB with control
system aspect
01: - (s+1)/(s^2+2s+1)
MATLAB Code with Results
clc , clear all , close all
%% Method 01 using "tf" command
num = [1 1];
den = [1 2 1];
sys=tf(num,den)
impulse (sys)
xlabel('Time','fontweight','bold','fontsize',9)
ylabel('Amplitude','fontweight','bold','fontsize',9)
title('Impulse Response for system
G(s)=(s+1)/(s^2+2s+1)','fontweight','bold','fontsize',10)
legend('Impulse Response')
grid on
figure
step(sys)
xlabel('Time','fontweight','bold','fontsize',9)
ylabel('Amplitude','fontweight','bold','fontsize',9)
title('Step Response for system
G(s)=(s+1)/(s^2+2s+1))','fontweight','bold','fontsize',10)
legend('Step Response')
grid on;
%% Method 02 using "zpk" command
sys=zpk([-1],[-1 -1],1)
impulse (sys)% Impulse response
xlabel('Time','fontweight','bold','fontsize',9)
ylabel('Amplitude','fontweight','bold','fontsize',9)
title('Impulse Response for system
G(s)=1/(s+1)','fontweight','bold','fontsize',10)
legend('Impulse Response')
grid on
figure
step(sys) % step response
xlabel('Time','fontweight','bold','fontsize',9)
ylabel('Amplitude','fontweight','bold','fontsize',9)
title('Step Response for system
G(s)=1/(s+1)','fontweight','bold','fontsize',10)
legend('Step Response')
grid on;
Simulink Model
Using transfer function block
Block Diagram
Command window
plot(time,output)
grid on
xlabel('Time','fontweight','bold','fontsize',9)
ylabel('Amplitude','fontweight','bold','fontsize',9)
title('Step Response for system G(s)=(s+1)/(s^2+2*s+1)','fontweight','bold','fontsize',10)
legend('Step Response')
Result
Result
Analysis
In this task, we have given a signal “G(s)= (s+1)/(s^2+2s+1)”. We must plot the step and impulse
response of it. Using coding in MATLAB there are three different method i.e.,
1) Using “tf” command
2) Using “zpk” command
3) Using “s=tf(‘s’)” command
I have used all these commands to plot step & impulse response of above given function. In this
way, me must have same results in all. Above figures show there is no difference in results.
Next, we use Simulink to do same procedure (to plot step & impulse response). In this model we
use two different blocks i.e.,
1) Transfer function block
2) Zero/pole block
Command window
plot(time, output)
grid on
xlabel('Time','fontweight','bold','fontsize',9)
ylabel('Amplitude','fontweight','bold','fontsize',9)
title('Step Response for system G(s)=10/(s+1)(s+3)(s+5)','fontweight','bold','fontsize',10)
legend('Step Response')
Result
Command window
plot(time,output)
grid on
xlabel('Time','fontweight','bold','fontsize',9)
ylabel('Amplitude','fontweight','bold','fontsize',9)
title('Step Response for system G(s)=10/(s+1)(s+3)(s+5)','fontweight','bold','fontsize',10)
legend('Step Response')
Result
Analysis
In this task, we have given a signal “G(s)= 10/(s+1)(s+3)(s+5)”. We must plot the step and
impulse response of it. Using coding in MATLAB there are three different method i.e.,
4) Using “tf” command
5) Using “zpk” command
6) Using “s=tf(‘s’)” command
I have used all these commands to plot step & impulse response of above given function. In this
way, me must have same results in all. Above figures show there is no difference in results.
Next, we use Simulink to do same procedure (to plot step & impulse response). In this model we
use two different blocks i.e.,
3) Transfer function block
4) Zero/pole block