Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 7

Problem 4

num = [0 0 10];
den = [1 1 10];
num1 = [0 0 10];
den1 = [1 3.16 10];

t = 0:0.02:10;
y = step(num,den,t);
y1= step(num1,den1,t);
plot(t,y,t,y1)
num = [0 1 1 0];
den = [1 1 10 0];
grid on
title('Unit-Step
num1 = [0 1 3.16Responses')
0];
xlabel('t(sec)')
den1 = [1 3.16 10 0];
ylabel('Output')
t = 0:0.02:10;

y = step(num,den,t);
y1= step(num1,den1,t);
plot(t,y,t,y1)

grid on
title('Error Curves for Ramp
Responses')
xlabel('t(sec)')
ylabel('Output')
Problem 5

num = [0 0 0 40];
den = [0.1 1 10 40];

t = 0:0.02:2.5;
y = step(num,den,t);
plot(t,y)

grid on
title('Unit-Step Response')
xlabel('t(sec)')
ylabel('Output')

num = [0 0 0 0 40];
den = [0.1 1 10 40 0];

t = 0:0.02:2.5;
y = step(num,den,t);
plot(t,y)

grid on
title('Unit-Ramp Response')
xlabel('t(sec)')
ylabel('Output')
num = [0 0 40 0];
den = [0.1 1 10 40];

t = 0:0.02:2.5;
y = step(num,den,t);
plot(t,y)

grid on
title('Unit-Step Response')
xlabel('t(sec)')
ylabel('X2')

num = [0 0 0 40 0];
den = [0.1 1 10 40 0];

t = 0:0.02:2.5;
y = step(num,den,t);
plot(t,y)

grid on
title('Unit-Ramp Response')
xlabel('t(sec)')
ylabel('X2')
num = [0 4 40 0];
den = [1 10 100 400];

t = 0:0.02:2.5;
y = step(num,den,t);
plot(t,y)

grid on
title('Unit-Step Response')
xlabel('t(sec)')
ylabel('X3')

num = [0 0 4 40 0];
den = [1 10 100 400 0];

t = 0:0.02:2.5;
y = step(num,den,t);
plot(t,y)

grid on
title('Unit-Ramp Response')
xlabel('t(sec)')
ylabel('X3')
num = [0.1 1 10 0];
den = [0.1 1 10 40];

t = 0:0.02:2.5;
y = step(num,den,t);
plot(t,y)

grid on
title('Unit-Step Response')
xlabel('t(sec)')
ylabel('E(s)')

num = [0 0.1 1 10 0];


den = [0.1 1 10 40 0];

t = 0:0.02:2.5;
y = step(num,den,t);
plot(t,y)

grid on
title('Unit-Ramp Response')
xlabel('t(sec)')
ylabel('E(s)')
Solutions found in Simulink match the results found with Matlab

You might also like