Académique Documents
Professionnel Documents
Culture Documents
2017-10-0088
Feedback and Control System Lab
27/01/2016
LAB 1
EXERCISE 1:
clc;clear all;close all
% Part 1
subplot(4,2,1);
num1 = [1 5 6];
den1 = [1 9 12];
y1 = tf(num1,den1);
step(y1);
% Part 2
subplot(4,2,2);
num2 = [0 2 0];
den2 = [1 8 15];
y2 = tf(num2,den2);
step(y2);
% Part 3
subplot(4,2,3);
num3 = poly([-2 -5 -5]);
den3 = poly([-1 2 -2]);
y3 = tf(2*num3,den3);
step(y3);
% Part 4
subplot(4,2,4);
num4 = [1 1 1];
den4 = poly([0 -1 -1]);
y4 = tf(2*num,den4);
step(y4);
% Part 5
subplot(4,2,5);
s = tf('s');
num5 = [3 9 12];
den51 = [1 2];
den52 = [1 5 11];
den5 = conv(den51,den52);
y5 = (3*(s^2) + 9*s + 12)/((s+2)*(s^2 + 5*s + 11));
step(y5);
% Part 6
subplot(4,2,6);
s = tf('s');
y6 = exp(-s)/(s^2);
step(y6);
% Part 7
subplot(4,2,7);
num7 = [];
den7 = [0 -2 16];
y7 = zpk(num7,den7,5);
step(y7);
% Part 8
subplot(4,2,8);
num8 = [0];
den8 = [-5-2j -5+2j -3];
y8 = zpk(num8,den8,6);
step(y8);
Figure Orders
PART
PART
PART
PART
1
3
5
7
PART
PART
PART
PART
2
4
6
8
EXERCISE 3:
clc; clear all;close all
num = {[1 6] ; 1};
den = {[1 4 4] ; [1 0 0]};
y = tf(num,den);
step(y);
EXERCISE 4:
clc; clear all;close all
num = {[0 6],[1 3] ; [1 0],[0 1]};
den = {[1 5],[1 5] ; [1 5],[1 5]};
y = tf(num,den);
step(y);
EXERCISE 5:
% Part 5
s = tf('s');
num5 = [3 9 12];
den51 = [1 2];
den52 = [1 5 11];
den5 = conv(den51,den52);
y5 = (3*(s^2) + 9*s + 12)/((s+2)*(s^2 + 5*s + 11));
subplot(4,2,5);
pzmap(y5);
% Part 6
s = tf('s');
y6 = exp(-s)/(s^2);
subplot(4,2,6);
pzmap(y6);
% Part 7
num7 = [];
den7 = [0 -2 16];
y7 = zpk(num7,den7,5);
subplot(4,2,7);
pzmap(y7);
% Part 8
j = sqrt(-1);
num8 = [0];
den8 = [-5-2j -5+2j -3];
y8 = zpk(num8,den8,6);
subplot(4,2,8);
pzmap(y8);
Figure Orders
PART
PART
PART
PART
1
3
5
7
PART
PART
PART
PART
2
4
6
8
EXERCISE 6:
EXERCISE 7:
EXERCISE 8:
den4 = [1 -5 8 -4];
[r4,p4,k4] = residue(num4,den4);
() = 2 2 + 13 2 + 4
% Part e
num5 = [0 2 3 -1];
den5 = [1 -3 4 -2];
[r5,p5,k5] = residue(num5,den5);
() = (1 3.5) (1+) + (1 + 3.5) (1) + 4
% Part f
num6 = [0 0 1];
den6 = [1 0 4];
[r6,p6,k6] = residue(num6,den6);
() = 0.25 2 + 0.25 2
% Part g
num7 = [0 0 2 0 -1];
den7 = [1 0 2 0 1];
[r7,p7,k7] = residue(num7,den7);
() = 0.25 + 0.75 + 0.25 + 0.75
EXERCISE 9:
EXERCISE 11:
PART
PART
PART
PART
PART
A
C
E
G
I
EXERCISE 12:
=
=
=
=
=
=
=
=
=
(1/s);
(1/(s-5));
(1/(s-20));
(1/(s+5));
(1/(s+20));
(1/(s^2 + 25));
(1/(s^2 + 400));
(1/(s^2 + 10*s + 50));
(1/(s^2 - 10*s + 50));
PART
PART
PART
PART
B
D
F
H
hold on;
pzmap(y1);
pzmap(y2);
pzmap(y3);
pzmap(y4);
pzmap(y5);
pzmap(y6);
pzmap(y7);
pzmap(y8);
pzmap(y9);
EXERCISE 13:
Explanation:
Yes the shapes of the natural responses are indeed determined by the location
of poles and zeros and the response of the system changes abruptly at location
of poles and zeros it either becomes zero or it becomes unbounded.
EXERCISE 14:
numT = [0 1 2];
denT = [1 1 0];
sysT = tf(numT,denT);
t=0:0.01:5;
u=[zeros(1,200) 10*ones(1,10) zeros(1,100) -10*ones(1,10) zeros(1,181)];
y = lsim(sysT,u,t);
subplot(2,1,1);
plot(t,u);
subplot(2,1,2);
plot(t,y);
Explanation:
This code firstly creates a transfer function using numT and denT (numerator and denominator coefficients), then
time period is defined, and then input signal u is defined as a sort of small square pulses of magnitude 10 and 10 at two different points.
Next, the obtained system sysT is live simulated using the lsim command with input signals t and u and then
both the result and input signal u are plotted against t.
This code helps us to determine the live simulation results shown by a system when simulated under controlled
input signals.
The following plots are obtained of input signal u and results y against time, respectively;