Q1
n1=1; d1=[1 3];
n2=1 ; d2=[1 3 5];
n3=1; d3=[1 7];
n4=1 ; d4=[1 0];
n5=7; d5=[1 5];
n6=1 ; d6=[1 3 5];
n7=5 ; d7=[1 6];
n8=1 ; d8=[1 8];
nblocks=8;
blkbuild
q=[ 1 -2 -5 0
2180
3180
4180
5 3 4 -6
6700
7346
8700
input=1,-5,-2;
output=7;
[aa,bb,cc,dd]=connect(a,b,c,d,q,input,output)
[num,den]=ss2tf(aa,bb,cc,dd)
printsys(num,den)
Q2
H1 = tf([12], [1 2 12]);
H2 = tf([7], [1 7]);
Gca= series(H1, H2);
Gca
Gpa= parallel(H1, H2);
Gpa
Gfeed = feedback(H1, H2);
Gfeed
Q3
G_1= tf([3], [1 7 6 0]);
G_2= tf([0.3]);
G_3= tf([6]);
G_4= tf([1], [1 0]);
GP_1 = feedback(G_1, G_2);
GP_2 = series(GP_1, G_2);
GP_3= series (GP_2 , G_3);
TF= feedback(GP_2, 1);
TF
Q4
G1 = tf([2], [1 0]);
G2 = tf([2], [1 0]);
GP_1 = parallel(G1,1);
GP_2 = series(GP_1, G2);
TF= feedback(GP_2, 1);
TF
Q5
G=tf([2 1],[1 2 3 0.8]);
subplot(2,1,1)
pzmap(G)
subplot(2,1,2)
impulse(G)
hold on
grid on
eigenvalues = eig(G);
if all(real(eigenvalues) < 0)
disp('The system is stable.');
else
disp('The system is not stable.');
end
Q6
G=tf([1 5 7],[1 9 31 75 85]);
subplot(2,1,1)
pzmap(G)
subplot(2,1,2)
step(G)
hold on
grid on
eigenvalues = eig(G);
if all(real(eigenvalues) < 0)
disp('The system is stable.');
else
disp('The system is not stable.');
end
Q7
G1=tf([2 5],[6 3 7]);
G2=tf([5 35],[7 2]);
G=parallel (G1, G2)
num=[30 239 179 255]
den=[42 33 55 14]
[z,p,k]=tf2zp(num,den)
subplot(2,1,1)
pzmap(G);
subplot(2,1,2)
step(G)
hold on
grid on
eigenvalues = eig(G);
if all(real(eigenvalues) < 0)
disp('The system is stable.');
else
disp('The system is not stable.');
end