%% Robustness as the motivation for introduction of feedback %% Uncertain system % We define the two uncertain parameters, that is, the parameters whose % values are only known to be in some given intervals. ze = ureal('zeta',0.2,'Range',[0.1,0.3]); wn = ureal('omega_n',1,'Range',[0.8,1.3]); %% % From now on we can work with these uncertain parameters as with any other % Matlab parameters/variables. Therefore we can define an uncertain % function in the following standard way G = tf(wn^2*[1 2 1],[1 2*ze*wn wn^2]); %% Design of feedforward controller % Ideal feedforward compensator is always as close to the inverse of the % system as possible. F0 = inv(G.NominalValue); %% Design of a feedback controller for the nominal system R0 = 2e9*tf([1 12],[1 0]); %% Simulating the response of the uncertain system subplot(3,1,1) step(G,'c:',G.NominalValue,'r',20) xlabel('t') ylabel('h_a(t)') title('Response of the nominal and uncertain models to a step input') subplot(3,1,2) step(G*F0,'c:',G.Nominal*F0,'r',20) title('Response with a feedforward compensator') xlabel('t') ylabel('h_b(t)') subplot(3,1,3) step(feedback(G*R0,1),'c:',feedback(G.Nominal*R0,1),'r',20) title('Response with a feedback compensator') xlabel('t') ylabel('y(t)') %print -depsc '../obrazky/robustnost_jako_motivace_pro_zpetnou_vazbu.eps'