function [Er, Ar, Br, Cr] = IRKA_FDM(n0, r, istest)
if nargin < 1
n0 = 100;
end
E = speye(n0^2);
A = fdm_2d_matrix(n0, '10*x', '100*y', '0');
B = fdm_2d_vector(n0, '.1<x<=.3');
C = fdm_2d_vector(n0, '.7<x<=.9')';
if nargin < 2
opts.irka.r = 10;
else
opts.irka.r = r;
end
if nargin < 3
istest = false;
end
opts.irka.maxiter = 20;
opts.irka.shift_tol = 1e-2;
opts.irka.h2_tol = 1e-6;
if istest
opts.irka.info = 1;
else
opts.irka.info = 2;
end
opts.irka.init = 'logspace';
[Er, Ar, Br, Cr, ~, outinfo] = mess_tangential_irka(E, A, B, C, [], opts);
if istest && isequal(outinfo.term_flag, 'maxiter')
mess_err(opts, 'convergence', 'IRKA converged unexpectedly slow');
end
IRKA step 1, rel. chg. shifts = 1.040827e+00 , rel. H2-norm chg. ROM = 1.000000e+00
IRKA step 2, rel. chg. shifts = 1.032308e+00 , rel. H2-norm chg. ROM = 7.597568e-03
Warning: IRKA step 3 : 1 non-stable reduced eigenvalues detected.
↳ In <a href="matlab:opentoline('/builds/mess/mmess/_release/package/package.m',13)">package (line 13)</a>
↳ In <a href="matlab:opentoline('/builds/mess/mmess/_release/publish_demos.m',18)">publish_demos (line 18)</a>
↳ In <a href="matlab:opentoline('/matlab/R2020b/toolbox/matlab/codetools/publish.p',0)">publish (line 0)</a>
↳ In <a href="matlab:opentoline('',21)">evalmxdom (line 21)</a>
↳ In <a href="matlab:opentoline('',109)">instrumentAndRun (line 109)</a>
↳ In <a href="matlab:opentoline('/builds/mess/mmess/DEMOS/FDM/IRKA_FDM.m',74)">IRKA_FDM (line 74)</a>
↳ In <a href="matlab:opentoline('/builds/mess/mmess/mor/mess_tangential_irka.m',369)">mess_tangential_irka (line 369)</a>
IRKA step 3, rel. chg. shifts = 1.025345e+00 , rel. H2-norm chg. ROM = Inf
IRKA step 4, rel. chg. shifts = 1.033312e+00 , rel. H2-norm chg. ROM = 5.653919e-05
IRKA step 5, rel. chg. shifts = 7.845267e-01 , rel. H2-norm chg. ROM = 3.217670e-05
IRKA step 6, rel. chg. shifts = 1.365375e-01 , rel. H2-norm chg. ROM = 3.800489e-06
IRKA step 7, rel. chg. shifts = 4.538349e-02 , rel. H2-norm chg. ROM = 8.673892e-07
IRKA terminated due to relative change of ROMs criterion.
Computing TFMs of original and reduced order systems and MOR errors
Step 10 / 100 Step 20 / 100 Step 30 / 100 Step 40 / 100 Step 50 / 100 Step 60 / 100 Step 70 / 100 Step 80 / 100 Step 90 / 100 Step 100 / 100
ans =
1 0 0 0 0 0 0 0 0 0
0 1 0 0 0 0 0 0 0 0
0 0 1 0 0 0 0 0 0 0
0 0 0 1 0 0 0 0 0 0
0 0 0 0 1 0 0 0 0 0
0 0 0 0 0 1 0 0 0 0
0 0 0 0 0 0 1 0 0 0
0 0 0 0 0 0 0 1 0 0
0 0 0 0 0 0 0 0 1 0
0 0 0 0 0 0 0 0 0 1