function Ex2_17 % Example 2.17 in Skogestad. s = tf('s'); G = 200 / (10*s + 1) / (0.05*s + 1)^2; % plant transfer function Gd = 100 / (10*s + 1); % disturbance transfer function M = 1.5; wb = 10; A = 1e-4; % weight parameters Wp = (s/M + wb) / (s + wb*A); % error sensitivity weight Wu = 1; % control sensitivity weight [K, Cl, gamma] = mixsyn(G, Wp, Wu, []); % H-infinity design % K and Cl are state space objects. % Compute the closed loop tranfer function from r to y. L = G * K; % loop transfer function T = (eye(size(L)) + L)^(-1) * L; % complementary sensitivity [yu1, tu1] = step(T, 3); % Response to a step in u. % Compute the closed loop transfer function from d to y. S = (eye(size(T)) - T) * Gd; % sensivitity [yd1, td1] = step(S, 3); % Response to a step in d. % Now repeat all of the above with a different sensitivity weight Wp = (s/M^(1/2) + wb)^2 / (s + wb*A^(1/2))^2; [K, Cl, gamma] = mixsyn(G, Wp, Wu, []); L = G * K; T = (eye(size(L)) + L)^(-1) * L; [yu2, tu2] = step(T, 3); S = (eye(size(T)) - T) * Gd; [yd2, td2] = step(S, 3); % Plot the results. close all; figure; subplot(2,1,1); plot(tu1, yu1, tu2, yu2, 'r--'); legend('y_1(t)', 'y_2(t)'); ylabel('reference step response'); subplot(2,1,2); plot(td1, yd1, td2, yd2, 'r--'); legend('y_1(t)', 'y_2(t)'); ylabel('disturbance step resopnse'); xlabel('time (s)');