🔥 emgr 4 COMBINED REDUCTION - Combined State and Parameter Reduction via Empirical System Gramians

emgr - Empirical Gramian Framework

Model Reduction Software

Name

- EMpirical GRamian framework for (nonlinear) input-output systems.

Description

(image) #emgr carton box

System gramians are matrices associated to linear input-output systems and quantify their controllability and observability. Empirical gramian matrices (empirical gramians) are computable for linear but also nonlinear (state-space) systems and have, among others, application in model order reduction (MOR) or uncertainty quantification (UQ). Model reduction using empirical gramians can be applied to the state-space, to the parameter-space or both through combined reduction. For state reduction, empirical balanced truncation by the empirical controllability gramian and the empirical observability gramian, or alternatively, direct truncation (approximate balancing) by the empirical cross gramian (or the empirical linear cross gramian for large-scale linear systems) is available. For parameter reduction, parameter identification and sensitivity analysis by the empirical sensitivity gramian (controllability of parameters) or the empirical identifiability gramian (observability of parameters) are provided. Combined state and parameter reduction is enabled by the empirical joint gramian, which computes controllability and observability of states (cross gramian) and observability of parameters (empirical cross-identifiability gramian) concurrently. The empirical gramian framework - emgr - is a compact open-source toolbox for (empirical) GRAMIAN-based model reduction and compatible with OCTAVE and MATLAB. This mathematical software provides a common interface for the computation of empirical gramians and empirical covariance matrices.

Scope

Download

Get emgr here: emgr.m (Version: 5.3)    [mirror]    [source]    [meta]    [emgr_oct.m]    [emgr_lgc.m]

(emgr is written in the Matlab programming language and requires Octave or Matlab. emgr has no dependencies on toolboxes or packages.)

License

All source code is licensed under the open source BSD-2-clause license:

Copyright (c) 2013--2018, Christian Himpe

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Disclaimer

This is research software!

Usage

(flowchart) gramian interrelations

General Usage: W = emgr(f,g,s,t,w,pr,nf,ut,us,xs,um,xm,dp);

Minimal Usage: W = emgr(f,g,s,t,w);

About Info Usage: v = emgr('version');

Mandatory Arguments

Optional Arguments

Empirical Gramian Types

(chart) #emgr application matrix The empirical non-symmetric cross gramian Wz can be selected by setting option flag nf(7) = 1 and is compatible with the empirical cross gramian Wx, the empirical linear cross gramian Wy and the empirical joint gramian Wj.

Option Flags

Return Values

Configuration

SSP32 Runge-Kutta schematic Custom solver (via handle in global variable: ODE)

Extra Utilities

Mini Code Example

A = -0.5*eye(4) % System matrix B = [0;1;0;1] % Input matrix C = [0,0,1,1] % Output matrix WX = emgr(@(x,u,p,t) A*x + B*u, @(x,u,p,t) C*x,[1,4,1],[0.5,10.0],'x') % Compute empirical cross Gramian % WX ≈ [0,0,0,0;0,1,0,1;0,0,0,0;0,1,0,1]

Tests

A minimal example code can be found in RUNME.m. A basic sanity test is conducted in emgrtest.m. Further tests are performed on a time-invariant, linear, state-space symmetric MIMO system, with a negative Lehmer matrix A as a system matrix and optional linear parametrization: ẋ = A*x + B*u + p y = C*x
(plot) test_wx reduction #emgr
Wx: State-space reduction by the empirical cross gramian (test_wx.m).
(plot) test_wy reduction #emgr
Wy: State-space reduction by the empirical linear cross gramian (test_wy.m).
(plot) test_wz reduction #emgr
Wz: State-space reduction by the empirical non-symmetric cross gramian (test_wz.m).
(plot) test_bt reduction #emgr
Wc+Wo: State-space reduction by empirical balanced truncation (test_bt.m).
(plot) test_dwx reduction #emgr
dWx: State-space reduction by the distributed empirical cross gramian (test_dwx.m).
(plot) test_dwz reduction #emgr
dWz: State-space reduction by the distributed empirical non-symmetric cross gramian (test_dwz.m).
(plot) test_wz2 reduction #emgr
Wz2: State-space reduction by the empirical non-symmetric linear cross gramian (test_wz2.m).
(plot) test_bt2 reduction #emgr
Wc+Wc*: State-space reduction by empirical linear balanced truncation (test_bt2.m).
(plot) test_pwx reduction #emgr
pWX: Parametric state-space reduction by the empirical cross gramian (test_pwx.m).
(plot) test_pwy reduction #emgr
pWy: Parametric state-space reduction by the empirical linear cross gramian (test_pwy.m).
(plot) test_pwz reduction #emgr
pWz: Parametric state-space reduction by the empirical non-symmetric cross gramian (test_pwz.m).
(plot) test_pbt reduction #emgr
pBT: Parametric state-space reduction by empirical balanced truncation (test_pbt.m).
(plot) test_ws reduction #emgr
Ws: Parameter-space reduction by the empirical sensitivity gramian (test_ws.m).
(plot) test_wi reduction #emgr
Wi: Parameter-space reduction by the empirical identifiability gramian (test_wi.m).
(plot) test_wj reduction #emgr
Wj: Parameter-space reduction by the empirical cross-identifiability gramian (test_wj.m).
(plot) test_wjz reduction #emgr
Wjz: Parameter-space reduction by the empirical non-symmetric cross-identifiability gramian (test_wjz.m).
(plot) test_wi2 reduction #emgr
Wi2: Parameter-space reduction by the detailed empirical identifiability gramian (test_wi2.m).
(plot) test_wj2 reduction #emgr
Wj2: Parameter-space reduction by the detailed empirical cross-identifiability gramian (test_wj2.m).
(plot) test_cwi reduction #emgr
cWi: Combined state and parameter reduction by the empirical identifiability gramian (test_cwi.m).
(plot) test_cwj reduction #emgr
cWj: Combined state and parameter reduction by the empirical joint gramian (test_cwj.m).
(plot) test_dwj reduction #emgr
dWj: Parameter-space reduction by the distributed empirical cross-identifiability gramian (test_dwj.m).
(plot) test_kwx reduction #emgr
kWx: State-space reduction by the kernel empirical cross gramian (test_kwx.m).
(plot) test_kwy reduction #emgr
kWy: State-space reduction by the kernel empirical cross gramian (test_kwy.m).
(plot) test_kpwz reduction #emgr
kpWz: State-space reduction by the kernel parametric empirical non-symmetric cross gramian (test_kpwz.m).
(plot) test_swx reduction #emgr
sWx: State-space reduction by the scaled empirical cross gramian (test_swx.m).
(plot) test_swx2 reduction #emgr
sWx2: State-space reduction by the scaled empirical cross gramian (test_swx2.m).
(plot) test_ewo reduction #emgr
eWo: State-space reduction by the extra input empirical observability gramian (test_ewo.m).
(plot) test_ewx reduction #emgr
eWx: State-space reduction by the extra input empirical cross gramian (test_ewx.m).

Demos

Combined Reduction: Nonlinear System (Wj)

Here a parametrized nonlinear control system is reduced in states and parameters using the empirical joint gramian. The nonlinearity is given by a hyperbolic tangent with parametrized argument. This is a parametrized hyperbolic network model from "Modeling and control based on a new neural network model" by Y. Quan et al (2001). ẋ = A*tanh(p.*x) + B*u y = C*x Get the source code here: combined_wj.m

(plot) combined_wj reduction #emgr
Relative L2 output error for varying state and parameter dimension.

State Reduction: Balanced Gains (Wx)

Cross-gramian-based state-space reduction using balanced gains from "Balanced systems and model reduction" by A.M. Davidson (1986) for a state-space symmetric system. ẋ = A*x + B*u y = C*x Get the source code here: gains_wx.m

(plot) combined_wj reduction #emgr
Relative L1, L2, L∞ output error for varying state dimension.

Benchmark: Inverse Lyapunov Procedure (Wc + Wo)

The inverse lyapunov procedure can be used to generate random linear systems. Here, the required solution of the lyapunov equation is accomplished by the empirical gramians after factoring -1. The generated random system is then renduced by using balanced truncation. The ilp.m control system generator is available from the MORwiki. 0 = A*WC + WC*A' - B'*B = (-1*a)*WC + WC*(-1*a') - B'*B = a*(-1*WC) + (-1*WC)*a' - B'*B Get the source code here: benchmark_ilp.m

(plot) benchmark_ilp reduction #emgr
Relative L1, L2, L∞ output error for varying state dimension.

Benchmark: Flexible Space Structures (Wx)

A procedural benchmark modelling modal structural dynamics for applications such as truss masts for space environments (i.e.: COFS-1) based on "Model Reduction for Flexible Space Structures" by W. Gawronski and T. Williams. This is a linear second order model, also listed at the MORwiki, which is reduced by approximate balancing via the empirical cross gramian.

Get the source code here: benchmark_fss.m

(plot) benchmark_fss #emgr
Relative L1, L2, L∞ output error for varying state dimension.

Benchmark: Linear Model Reduction (Wx)

A sample implementation of a model reduction benchmark from NICONET. Exemplary here the International Space Station 1r-component model is tested. The empirical cross gramian is utilized to reduce this second order system. ẋ = [0,1;-M⁻¹K,-M⁻¹D]*x + [0;-M⁻¹B]*u y = [0,C]*x Get the source code here: benchmark_lin.m

(plot) benchmark_lin #emgr
Relative L1, L2, L∞ output error for varying state dimension.

Benchmark: Nonlinear Model Reduction (Wx)

An implementation of a model reduction benchmark from the MORwiki. Here the nonlinear RC-ladder benchmark, a resistor-capacitor cascade with nonlinear resistors (diodes), is tested. The empirical cross gramian is utilized to reduce this nonlinear system. Get the source code here: benchmark_non.m

(plot) benchmark_non #emgr
Relative L1, L2, L∞ output error for varying state dimension.

State Reduction: Non-Square and Nonlinear (Wz)

In this example the non-symmetric cross gramian is used to reduce a non-square nonlinear MISO system. The nonlinear output functional is given by the dot-product of the state and the system is of the form: ẋ = A*x + B*u y = x'*x Get the source code here: energy_wz.m

(plot) energy_wz reduction #emgr
Relative L1, L2, L∞ output error for varying state dimension.

Nonlinearity Quantification (Wc,Wo,Wx)

In this example the nonlinearity of a systems input-to-state, state-to-output and input-to-output map is quantified. The nonlinearity is given by the inverse hyperbolic sine (arsinh). A (scalar) parameter scales the argument of the arsinh, to fan out the image from the linear system around the fixed point zero. I = A*x + B*asinh(p*u) yI = C*x; ẋS = A*asinh(p*x) + B*u yS = C*x; ẋO = A*x + B*u yO = C*asinh(p*x); Get the source code here: measure.m

(plot) nonlinearity measure #emgr
Nonlinearity measure for varying parameter.

Decentralized Control (Wx)

Input-output pairing is demonstrated here based on "Covariance and Gramian Matrices in Control and Systems Theory" by K.V. Fernando (1983) with the aim of decentralized control. The participation matrix is assembled from the squared trace of the empirical cross gramian for each SISO subsystem.

Get the source code here: decentral.m

(plot) decentralized control #emgr
Participation matrix.

PDE Reduction: Advection Equation (Wy)

Discretized with a first order upwind finite difference scheme, the transport equation is a hyperbolic partial differential equation which is reduced by the empirical linear cross gramian and direct truncation. du/dt = -a du/dx x(0,t) = v(t) y(t) = x(1,t) Get the source code here: advection.m

(plot) reduced advection #emgr
Reduced order advection output over time.

Nonlinear Second Order Reduction: 5-body Choreography (Wo)

A 5-body choreography, based on the gravitational N-body problem, resembling the figure eight is reduced in states; based on "New Families of Solutions in N-Body Problems" by C. Simo (2001).

Get the source code here: nbody.m

(plot) reduced nbody #emgr
Reduced order 5-body orbits.

Parameter Identification: Stable Orbits Inside Black Holes (Ws)

This is an implementation of: "Is there life inside black holes?" by V. Dokuchaev (2011), describing stable orbits of photons and particles inside the event horizon of a black hole. The underlying system is nonlinear and the output function is a coordinate transformation from Boyer-Lindquist to Cartesian coordinates. In the computation of particle and photon orbits the associated parameters are identified by the empirical sensitivity gramian.

Get the source code here: blackhole.m

(plot) blackhole orbit #emgr
Stable particle and photon orbits inside the event horizon of a black hole.

System Indices: Cross Gramian (Wx)

The (empirical) cross Gramian encodes many system invariants and system indices. Here we demonstrate the following indices for a hyperbolic system in the context of model reduction:

  • Hankel norm lower error bound,
  • L1 upper error bound,
  • Approximate H2 error indicator,
  • H∞ upper error bound,
  • Energy fraction error,
  • Robustness index,
  • System gain error,
  • Nyquist plot area error.

Other possible indices are the Cauchy index, information entropy or symmetry.

Get the source code here: indices.m

(plot) indices #emgr
Error indicators, error bounds and system indices for varying state dimension.

About

A gramian matrix W is the result of all inner products of a set of vectors V = (v1 ... vn), in other words: W = VT V. Properties of (linear) control systems can be assessed by the system gramians, which are based on the controllability and observability operators. Classically, the controllability gramian and observability gramian are utilized in balancing model reduction methods. The cross gramian encodes controllability and observability information into a single matrix and thus does not require explicit balancing.

Empirical gramians extend this approach to nonlinear control systems and thus enable nonlinear model reduction. For linear systems, the empirical gramians are equal to the classic gramians. Yet, empirical gramians contain more information about the underlying system; and the empirical cross gramian conveys even additional information. Also, the Koopman controllability gramian and Koopman observability gramian are equivalent to their empirical gramian counterparts. This makes empirical gramians a versatile tool for mathematical engineering.

The (discrete) empirical cross gramian encloses information on the input-output behavior of the associated control system as well as approximate Hankel Singular Values and can be computed very efficiently. For extreme-scale systems, the linear empirical cross gramian, related to Balanced POD, can be utilized. And for parametrized systems, the (empirical) joint gramian, derived from the cross gramian, is available for combined reduction. In case of custom input, an empirical covariance matrix can also be computed.

Model reduction or model order reduction is a research field in applied mathematics, which investigates the algorithmic construction of low-order surrogate models for high-dimensional differential equation models. The resulting reduced order models allow a substantially more economical evaluation in terms of computational or memory resources compared to the original large-scale full order model. Model reduction is essential as developments in computing technology are constantly outpaced by the requirements for model simulation in dimensionality or complexity.

References

Contact

Send feedback to: ch@gramian.de

Cite

gramian.de quick response code

Notes

Troubleshooting

See Also

Category

(plot) cross gramian surface #emgr
Λ