% 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)