% determination of weighting function for multiplicative uncertainty model WT(s)

load data/nominal.mat;

s = tf('s');

w0 = 0.3;
w1 = 2*pi*5;
w2 = 2*pi*15;
WT = w0*((w2/(s+w2))^2*((s+w1)/w1)^2);
WT_g = frd(WT, w);

delta_g = (P_g - P0_g)/P0_g;

figure(2);
bodemag(delta_g, 'b.', WT_g, 'r-');
legend('multiplicative uncertainty', 'WT', 'Location', 'SouthWest');
title('');

save data/weight.mat WT;

print -depsc data/weight.ps;
