Contents

MORLAB Demo: Matrix Equation Solvers

This demo script contains the application of the MORLAB matrix equation solver routines.

%
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU Affero General Public License as published
% by the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
% GNU Affero General Public License for more details.
%
% You should have received a copy of the GNU Affero General Public License
% along with this program.  If not, see <http://www.gnu.org/licenses/>.
%
% Copyright (C) 2006-2019 Peter Benner, Steffen W. R. Werner
%

General Handling

The MORLAB toolbox contains a bunch of iterative matrix equation solvers, which are used for the implemented model reduction methods. Due to the modolarity of the toolbox, the user can use each of the matrix equation solver routines by itself. MORLAB has implemented solvers for the following types of matrix equations:

In contrast to the system-based routines in MORLAB, the matrix equation solvers just need the coefficient matrices of the equation that has to be solved. For demonstration, we load a prepared data file containing state-space matrices for a stable passive system:

if exist('OCTAVE_VERSION', 'builtin')
    orig_warn = warning('off', 'Octave:data-file-in-path');
    load morlab_data_std_pr.mat;
    warning(orig_warn);
else
    load morlab_data_std_pr.mat;
end

Now we want to solve a Lyapunov equation with those coefficient matrices.

Q = B * B';
[X, info] = ml_lyap_sgn(A, Q);

The matrix X is the solution of the Lyapunov equation A*X + X*A' + Q = 0 as we will show by computing a normalized residual below. The structure info instead contains information about the underlying iteration like the number of iteration steps, the absolute and relative error of the method.

res = norm(A * X + X * A' + Q) / norm(X);
disp(res);
   5.3527e-14

Solver Types and Naming Scheme

There are different types of solvers implemented in MORLAB. The type of solver and the underlying method can be determined by the naming scheme of the MORLAB function:

As example, we will use the solver ml_lyapdl_sgn_fac. By the naming scheme above, we will solve the dual Lyapunov equations

A*X + X*A' + B*B' = 0,
A'*Y + Y*A + C'*C = 0,

where the solutions are factorized as X = R*R' and Y = L*L'.

[R, L] = ml_lyapdl_sgn_fac(A, B, C);

X = R*R';
Y = L*L';

resX = norm(A * X + X * A' + B * B') / norm(X);
resY = norm(A' * Y + Y * A + C' * C) / norm(Y);

disp(resX);
disp(resY);
   6.5863e-14

   6.1470e-14

Remarks

See Also

ml_cabe_sgn | ml_care_nwt_fac | ml_caredl_sgn | ml_caredl_sgn_fac | ml_dare_nwt_fac | ml_daredl_sda | ml_daredl_sda_fac | ml_dlyap_smith | ml_dlyap_smith_fac | ml_dlyap_smith_ldl | ml_dlyapdl_smith | ml_dlyapdl_smith_fac | ml_dlyapdl_smith_ldl | ml_dsylv_smith | ml_dsylv_smith_fac | ml_gdlyapdl_smith_fac | ml_icare_ric_fac | ml_lyap_sgn | ml_lyap_sgn_fac | ml_lyap_sgn_ldl | ml_lyapdl_sgn | ml_lyapdl_sgn_fac | ml_lyapdl_sgn_ldl | ml_pcare_nwt_fac | ml_sylv_sgn | ml_sylv_sgn_fac