%  Tab11_2.m
% MATLAB commands for model reduction of stable system sys

% Alt. 1.
sysd=strans(sys);            % order states in Jordan form according to speed 

syst=strunc(sysd,k);         % then: truncate leaving k states in syst. 
sysr=sresid(sysd,k);         % or: residualize leaving k states in sysr.

% Alt. 2.
[sysb,hsig]=sysbal(sys);     % obtain balanced realization. 

sysbt=strunc(sysb,k);        % then: balanced truncation leaving k states. 
sysbr=sresid(sysb,k);        % or: balanced residualization. 
sysh=hankmr(sysb,hsig,k,'d');% or: optimal Hankel norm approximation 

