% ORC 15.3 :: H2 norm computation%% TUHH :: Institut for Control Systems :: Optimal and Robust Control% Last update: 20.05.2009loadorc15_design2CL2Gyr2T=Gyr2;%% Using the gramians% with observability gramianWo=gram(T,'o');h2gramo=sqrt(trace(T.B'*Wo*T.B))% with the controllability gramianWc=gram(T,'c');h2gramc=sqrt(trace(T.C*Wc*T.C'))%% Using the inpulse responseT_step=0.001;t=0:T_step:2;[g,t]=impulse(T,t);Sum=0;fori=1:length(t)X(:,:)=g(i,:,:);Sum=Sum+trace(X'*X);endh2imp=sqrt(Sum*T_step)%% with the norm functionh2norm=norm(T,2)hinfnorm=norm(T,inf)