function [ K ] = hinfmixed(Ge, wb)

num = Ge.num{1};
den = Ge.den{1};

b1 = num(2);
b0 = num(3);

a1 = -den(2);
a0 = den(3);

A = [a1 1 ; -a0 0];
B = [b1 b0]';
C = [1 0];
D = 0;
sys=ss(A,B,C,D);
set(sys,'inputname','Z','outputname','P1','statename',{'x1','x2'});


NMEAS = 1;
NCON = 1;

%recommended values:  0.1<wb<1.
%  wb=0.5  

% Weight with integral action
Ms=1; a=0.01;
W1 =  tf([1/Ms wb],[1 wb*a]);

W2 = 0.03;
W3 = 1/(tf([1/100 1],[1/(wb) 1]));
%W3 = W3*W3;

P = augw(sys,W1,W2,W3);
% set(P,'InputGroup', struct('U1', 1:3, 'U2', 4));
% set(P,'OutputGroup',struct('Y1', 1:9, 'Y2', 10:12));
[K,CL,GAM,INFO] = hinfsyn(P,NMEAS,NCON,'TOLGAM',1e-6,'METHOD','ric','DISPLAY','on');
%[KK,CL,GAM,INFO] = mixsyn(G,Wp,Wu,Wt);
K = minreal(K);
%K = balancmr(K,6);
disp(GAM)
disp(INFO)

disp('H-infinity controller')
K=tf(K)


end

