okey for problem 1 i wrote this MATLAB code :
clear all;
clc;
% Defining TF
s=tf('s');
G=4/((s-1)*(0.02*s+1)^2);
Gd=100/(10*s+1);
% Weight Selection
M=1.8; wb=20; A=1e-4;
Wp=tf([1/M wb], [1 wb*A]);
Wu=1;
% Hinf Controller Design
[K,CL,gamma]=mixsyn(G,Wp,Wu,[]);
[K_num, K_den] = ss2tf(K.a,K.b,K.c,K.d);
Ks = tf(K_num, K_den);
% Analysis
Gcl = minreal(feedback(G*Ks,1));
figure(1)
step(Gcl)
grid on
L = G*Ks;
S = minreal(1 / (1 + L));
KS = Ks*S;
figure(2)
bodemag(S,'b',KS,'g',gamma/Wp,'b--',ss(gamma/Wu),'g--')
legend('S','KS','gamma/Wp','gamma/Wu','Location','SE')
grid on
%figure(2)
%sigma(S,'b',KS,'g',gamma/Ws,'b--',ss(gamma/Wu),'g--')
%legend('S','KS','gamma/Ws','gamma/Wu','Location','SE')
%grid on
% Second Controller Weights
M2=1.5; wb2=10; A2=1e-4; n = 2;
Wp2 = (s/M2^(1/n) + wb2)^n / (s + wb2*A2^(1/n))^n;
Wu2=1;
% Second Hinf Controller Design
[K2,CL2,gamma2]=mixsyn(G,Wp2,Wu,[]);
[K2_num, K2_den] = ss2tf(K2.a,K2.b,K2.c,K2.d);
K2s = tf(K2_num, K2_den);
% Analysis
G2cl = minreal(feedback(G*K2s,1));
figure(3)
step(Gcl, G2cl)
legend('Design 1', 'Design 2')
grid on
L2 = G*K2s;
S2 = minreal(1 / (1 + L2));
KS2 = K2s*S2;
figure(4)
bodemag(S2,'b',KS2,'g',gamma2/Wp2,'b--',ss(gamma2/Wu2),'g--')
legend('S2','KS2','gamma2/Wp2','gamma2/Wu2','Location','SE')
grid on
figure(5)
bodemag(S,'b',S2,'m',gamma/Wp,'b--',gamma2/Wp2,'m--')
legend('S','S2','gamma/Wp','gamma2/Wp2','Location','SE')
grid on
figure(6)
step(S*Gd, S2*Gd, 2)
legend('Design 1', 'Design 2')
grid on