Professional Documents
Culture Documents
Lab2 Q1 Solution
Lab2 Q1 Solution
clc
clear all
G =
5
-----
s + 1
H =
s^2 + 6 s + 5
----------------------
s^3 + 6 s^2 + 11 s + 6
T =
% Question 1(a)
% Plot the Step Response on figure 25
figure(25);
step(T);
title('Step Response of T(s)');
1
% Question 1(b)
% The order of the system is he highest power of s in the denominator of
% the transfer fuction.
% Question 1(c)
poles_T = pole(T);
zeros_T = zero(T);
disp('Poles: ');
Poles:
disp(poles_T);
-3.9360 + 0.0000i
-1.0320 + 2.6098i
-1.0320 - 2.6098i
-1.0000 + 0.0000i
-1.0000 - 0.0000i
disp('Zeros: ');
2
Zeros:
disp(zeros_T);
-3.0000 + 0.0000i
-2.0000 + 0.0000i
-1.0000 + 0.0000i
-1.0000 - 0.0000i
% Question 1(e)
% Obtain the step response and time vector
[y, t] = step(T);
[ymax, tmax] = max(y)
ymax = 1.7022
tmax = 16
% Calculate overshoot
yss = y(end); % Assuming steady state is reached
OS = (ymax - yss) / yss * 100; % Overshoot fourmula
xlabel('Time (\it{t})');
ylabel('System Response');
title(['System Response with Overshoot:']);
legend('System Response', 'Overshoot Point');
grid on;
3
4