The MOR Toolbox is aimed at simplifying and approximating (very large-scale and inifinite order) LTI dynamical models. The main approximation routine, called mor.lti
, is focussed on
This "getting started" page aims at providing users, a procedure to reduce your first LTI model from a complex LTI state-space model, following (i), and to construct a LTI model from frequency-domain data set, following (ii).
Note that additional examples for cases (i) and (ii) are given on the "Systems represented by linear ODE / DAE" and "Systems described by frequency-domain input-output data" pages, respectively.
The MOR Toolbox also provides tools to analyse LTI dynamical models. Among them, the mor.learn
performs a complete analysis of any finite dimensional LTI model, mor.norm
computes norms of LTI models and mor.stability
may be used to approximate the stability of a LTI (infinite dimensional) dynamical model. User is invited to refer to the "function reference" page for more details.
This short tutorial provides a procedure on the simplest way to start using the MOR Toolbox to reduce the dimensionality of a dynamical model and construct a model from data. In the following, some of the most usefull functions are used, introducing the philosophy of the toolbox.
The MOR Toolbox is tailored to LTI systems (both large-scale finite and infinite dimensional) and input-output data. In this first starting example, we consider the case where one has access to the LTI model and wants to reduce its complexity.
% Generate an unstable LTI model
rng(120882,'twister');
G = rss(100,2,3)+tf({1 [1 0] [1 1]; [1 1/10] 2 -10},[1 -1]);
Note that the above model consists of a MIMO (3 inputs, 2 outputs) model with 102 states. Indeed, 100 states a randomly generated and two others are added due to the non-minimal MIMO transfer including a real positive pole (in 1) and a direct feed-through. The complete model is of order 102, unstable and with direct feed-through term.
mor.learn
interface to analyse your system's properties.% Learn from LTI model
infoG = mor.learn(G);
Then, it provides the user a set of informations compiled in a text format suggesting some approximation order and detecting unstable modes and the direct feed-through term.
This routine suggests a set of tunning variables that can be directly used in the mor.lti
interface.mor.lti
interface to approximate the model, directly from the learned data.
% Reduce it using the learned informations
Gr = mor.lti(infoG);
When used as it, the computed reduced model includes the reduced stable part, plus the anti-stable, limit of stability and polynomial parts (if any). Note that the mor.lti
interface can be further parametrised. We encourage rearder to read the dedicated page mor.lti
.
mor.bode
, mor.sigma
and mor.sigmaDamp
interfaces to visualise the results.
% Plot results (Sigma plot, Bode plot and Sigma and eigenvalues)
W = logspace(-2,2,200);
figure, mor.sigma(G,'b-',Gr,'r--',W)
legend(['Original model n=' num2str(length(G.a))], ['Reduced model r=' num2str(length(Gr.a))])
figure, mor.bode(G,'b-',Gr,'r--',W)
legend(['Original model n=' num2str(length(G.a))], ['Reduced model r=' num2str(length(Gr.a))])
figure, mor.sigmaDamp(Gr,W)
These function are only aimed at extending the Bode and Sigma plots. See the function list page for more details.
mor.norm
to evaluate the mismatch errors.
% Mismatch error norms
mor.norm(G-Gr,2)
A mismatch error of inf
is obtained with the H2-norm (which is expected due to unstable model).
The MOR Toolbox is tailored to LTI systems (both large-scale finite and infinite dimensional) and input-output data. In this second starting example, we consider the case of a time-delayed model where one only has access to a set of frequency-domain input-output responses.
% Construct a delayed (both input and internal) LTI model, being an infinite dimensional model
DelayT(1) = struct('delay',1,'a',-1,'b',0,'c',0,'d',0);
G = delayss(0,1,1,0,DelayT);
G.InputDelay = 2;
% Collect the model frequency responses (as if it comes from a simulator or experiments)
W = logspace(-1,2,100);
Hi = freqresp(G,W);
figure,
subplot(211), mor.bode(G,'b-',{Hi},'k+',W), legend('Original model','Data')
subplot(212), step(G,'b-'), legend('Original model')
Note that the above model is a SISO (1 input, 1 output) model with 1 delayed internal state and 1 input delay. The complexity and particularity comes from the internal delay that renders the transfer function transendental, generating an infinite number of singularities. This model is thus an infinite dimensional one; this is also one reason why one talks about model approximation rather than model reduction.
mor.lti
to construct a rational LTI model on the basis of the data.% Construct an exact LTI model (while ensuring that the contructed model is stable)
opt.ensureStab = true;
Hr0 = mor.lti({W,Hi},[],opt);
minfo(Hr0)
figure,
subplot(211), mor.bode(G,'b-',{Hi},'k+',Hr0,'r-',W), legend('Original model','Data','Rational approximation')
subplot(212), step(G,'b-',Hr0,'r--'), legend('Original model','Rational approximation')
This leads to Hr0
, a rational LTI model matching the frequency-domain input-output data and reproducing the behaviour of the original system. Note that the complexity of Hr0
is automatically computed. Due to the stability enforcement, some mismtach can occur, but remain marginally visible on the time-domain response. Obviously, if te original model was unstable, this option should not be set.
mor.lti
to construct a reduced rational LTI model on the basis of the data. As the resulting model is now a finite order LTI one, similarly to the above example, one may now seek for a reduced model. This can be done as in the above case, or directly from the data as:% Construct an approximate stable LTI model
r = 10;
opt.ensureStab = true;
Hr1 = mor.lti({W,Hi},r,opt);
minfo(Hr1)
figure,
subplot(211), mor.bode(G,'b-',{Hi},'k+',Hr0,'r-',Hr1,'m-',W), legend('Original model','Data','Rational approximation','Reduced model')
subplot(212), step(G,'b-',Hr0,'r--',Hr1,'m-'), legend('Original model','Rational approximation','Reduced model')
This leads to Hr1
, a reduced rational LTI model "matching" the input-output data and reproducing the behaviour of the original system.
The following sections provide detailed examples to discover the main features and advanced one, embedded in the MOR Toolbox.
Reduce LTI state-space models dimension.
Build an LTI model from a set of frequency-domain input-ouput data.
Provide a detailed list of the functions and access to all tuning options.