orc15_1_and_E_15_3_H2.m 653 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
% ORC 15.3  :: H2 norm computation
%
% TUHH :: Institut for Control Systems :: Optimal and Robust Control
% Last update: 20.05.2009

load orc15_design2 CL2 Gyr2
T = Gyr2;


%% Using the gramians
% with observability gramian
Wo = gram(T,'o');  
h2gramo = sqrt( trace(T.B'* Wo *T.B) )

% with the controllability gramian
Wc = gram(T,'c');
h2gramc = sqrt( trace(T.C* Wc *T.C') )


%% Using the inpulse response
T_step = 0.001;
t = 0:T_step:2;

[g,t] = impulse(T,t); 

Sum = 0; 
for i = 1:length(t)
    X(:,:) = g(i,:,:);
    Sum = Sum + trace(X'*X);
end
h2imp = sqrt ( Sum * T_step )


%% with the norm function
h2norm = norm(T, 2)
hinfnorm = norm(T, inf)