%% simulateTimeDomain
% Evaluation of the auxiliary state equation exploiting block structuring of feedback matrices K_uni, K_lam and eigenvalues decomposition
%
% inputs:
% Az: Decomposed state matrix \Lambda_n
% fe, yi: Associated inputs fe_n, yi_n
% T: Time step
% U, Uinv: Matrices U and U^{-1} from decomposition
%
% outputs:
% ybar_n: System states ybar_n[k]
%
function [ybar_n] = simulateTimeDomain(Az,fe,yi,T, U, Uinv)
% number of eigenvalues Q_n and time duration t_dur
Mu = size(Az,1);
dur = size(fe,2);
% define auxiliary system states
uybar = zeros(Mu,size(fe,2));
% create a single input from fe and yi
yi_time = zeros(Mu, size(fe,2));
yi_time(:,1) = yi;
excite = fe + yi_time;
uexcite = Uinv*excite;
% evaluate individual lines of auxiliary state equation
for mu = 1:Mu
% evaluate individual lines by first-order filters
uybar(mu,:) = filter(1,[1, -Az(mu,mu)],T*uexcite(mu,:));
end
% convert auxiliary states to desired system states ybar_n
ybar_n = U*uybar;