empirical gramian framework - a tutorial

11
Empirical Gramian Framework - A Tutorial Christian Himpe ([email protected]) WWU Münster Institute for Computational and Applied Mathematics

Upload: gramian

Post on 19-Jun-2015

246 views

Category:

Technology


2 download

DESCRIPTION

A tutorial for emgr - EMpirical GRamian framework for model reduction and system identification.

TRANSCRIPT

Page 1: Empirical Gramian Framework - A Tutorial

Empirical Gramian Framework - A Tutorial

Christian Himpe ([email protected])

WWU MünsterInstitute for Computational and Applied Mathematics

Page 2: Empirical Gramian Framework - A Tutorial

Overview

AboutInterfaceOptionsExamplesSummary

Page 3: Empirical Gramian Framework - A Tutorial

About

emgr - Empirical Gramian FrameworkVersion: 2.2Download: http://gramian.de/emgr.mLicense: Open Source (BSD 2-Clause-License)Compatible with OCTAVE and MATLAB (and FREEMAT)Vectorized & ParallelizableUniform Interface

Capabilities:Empirical Controllability Gramian (WC)Empirical Observability Gramian (WO)Empirical Cross Gramian (WX)Empirical Linear Cross Gramian (WY)Empirical Sensitivity Gramian (WS)Empirical Identifiability Gramian (WI)Empirical Joint Gramian (WJ)

Page 4: Empirical Gramian Framework - A Tutorial

Interface

General Usage: W = emgr(f,g,q,t,w,pr,nf,ut,us,xs,um,xm,yd)Return Value:

Matrix (states x states) for:Empirical Controllability Gramian,Empirical Observability Gramian,Empirical Cross Gramian,Empirical Linear Cross Gramian.

Cell-Array of two matrices {(state x states),(parameters x parameters)} for:Empirical Sensitivity GramianWS = {Controllability Gramian, Sensitivity Gramian}Empirical Identifiability GramianWI = {Observability Gramian, Identifiability Gramian}Empirical Joint GramianWJ = {Cross Gramian, Cross-Identifiability Gramian}

Page 5: Empirical Gramian Framework - A Tutorial

Interface

Minimal Usage: W = emgr(f,g,q,t,w)Arguments:

f - Handle to a function with signature x = f(x,u,p) , the system function.

g - Handle to a function with signature y = g(x,u,p) , the output function.

q - Vector q = [J N O] holding number of inputs, states and outputs.

t - Vector t = [S h T] holding time start, step and stop.

w - Character selecting the gramian type:

’c’ - Empirical Controllability Gramian,’o’ - Empirical Observability Gramian,’x’ - Empirical Cross Gramian,’y’ - Empirical Linear Cross Gramian,’s’ - Empirical Sensitivity Gramian,’i’ - Empirical Identifiability Gramian,’j’ - Empirical Joint Gramian.

Page 6: Empirical Gramian Framework - A Tutorial

Interface

General Usage: W = emgr(f,g,q,t,w,pr,nf,ut,us,xs,um,xm,yd)Optional Arguments:

pr - Vector holding parameters, 0 if no parameters;default value: 0.

nf - Vector ([nf0 nf1 nf2 nf3 nf4 nf5 nf6 nf7 nf8 nf9 nf10 nf11])holding options; default value : 0 (becomes nf = zeros(1,12);).

ut - Matrix (inputs x steps), vector (becomes: ut=[ut zeros(steps - 1)];) orscalar (becomes: ut=[ut*ones(J,1) zeros(steps - 1)];) holding input;default value: 1 (becomes ut=[ones(J,1) zeros(steps - 1)];).

us - Vector or scalar (becomes: us=us*ones(J,1);) holding steady state input;default value: 0 (becomes: us = zeros(J,1);).

xs - Vector or scalar (becomes: xs=xs*ones(J,1);) holding steady state;default value: 0 (becomes: xs = zeros(N,1);).

um - Matrix (inputs x scales), vector or scalar (becomes: um=um*ones(J,1);)holding input scales;default value: 1 (becomes: um=ones(J,1);).

xm - Matrix (states x scales), vector or scalar (becomes: xm=xm*ones(N,1);)holding state scales;default value: 1 (becomes: xm=ones(N,1);).

yd - Cell-Array of matrices {(states x steps),(outputs x steps)}

Page 7: Empirical Gramian Framework - A Tutorial

Options

Options: nf = [nf0 nf1 nf2 nf3 nf4 nf5 nf6 nf7 nf8 nf9 nf10 nf11]

nf0 - Residual around which the time series are centered

0 - Steady state (xs)1 - Arithmetic Average of states over time2 - Median of states over time3 - Last state of the time series4 - Principal component of the time series5 - Zero

nf1 - Subdivision of input scales

0 - Linear: um = um * [0.25 0.50 0.75 1.00];1 - Logarithmic: um = um * [0.0001 0.001 0.1 1.0];2 - Geometric: um = um * [0.125 0.25 0.50 1.00];3 - Single: um = um;

nf2 - Subdivision of state scales

0 - Linear: xm = xm * [0.25 0.50 0.75 1.00];1 - Logarithmic: xm = xm * [0.0001 0.001 0.1 1.0];2 - Geometric: xm = xm * [0.125 0.25 0.50 1.00];3 - Single: xm = xm;

Page 8: Empirical Gramian Framework - A Tutorial

Options

Options: nf = [nf0 nf1 nf2 nf3 nf4 nf5 nf6 nf7 nf8 nf9 nf10 nf11]

nf3 - Transformation of input scales

0 - Unit: um = [-um um];1 - Inverse: um = [1.0./um um];2 - Dyadic: um = um*um’;3 - Single: um = um;

nf4 - Transformation of state scales

0 - Unit: um = [-xm xm];1 - Inverse: xm = [1.0./xm xm];2 - Dyadic: xm = xm*xm’;3 - Single: xm = xm;

nf5 - Run twice to reduce numerical error? 0 = No, 1 = Yes, 2 = Scaled

nf6 - Use provided data yd instead of generating simulation? 0 = No, 1 = Yes

nf7 - Robust parameter handling? 0 = No, 1 = Active, 2 = Passive

nf8 - Adjust parameter scaling? 0 = No, 2 = Yes

nf9 - Use Mean (WS) / Schur-complement (WI) for parameter extraction?0 = No, 2 = Yes

nf10 - Enforce symmetry of gramians? 0 = No, 2 = Yes

Page 9: Empirical Gramian Framework - A Tutorial

Options

Options: nf = [nf0 nf1 nf2 nf3 nf4 nf5 nf6 nf7 nf8 nf9 nf10 nf11]

nf11 - Solver to be used for simulation

0 - 1st order explicit Euler’s method1 - 2nd order explicit Adams-Bashforth method2 - 2nd order symplectic Leapfrog method3 - 2nd order explicit Ralston’s method4 - 3rd order accelerated Runge-Kutta-1 - Custom Solver with signature x = CUSTOM_ODE(f,h,T,z,u,p)

Page 10: Empirical Gramian Framework - A Tutorial

Example (Parametrized Linear Control System)

Setup:Number of Inputs: J = 4;Number of States: N = 16;Number of Outputs: O = 4;Time start: S = 0;Time step: h = 0.01;Time stop: T = 1;System matrix: A = rand(N,N); A(1:N+1:end) = -N; A = 0.5*(A+A’);Input matrix: B = rand(J,N);Output matrix: C = B’;Parameters: P = A(:);System function handle: f = @(x,u,p) reshape(p,[N N])*x + B*u;Output function handle: g = @(x,u,p) C*x;

Gramians:Empirical Controllability Gramian: WC = emgr(f,g,[J N O],[S h T],’c’,P);Empirical Observability Gramian: WO = emgr(f,g,[J N O],[S h T],’o’,P);Empirical Cross Gramian: WX = emgr(f,g,[J N O],[S h T],’x’,P);Empirical Linear Cross Gramian: WY = emgr(f,g,[J N O],[S h T],’y’,P);Empirical Sensitivity Gramian: WS = emgr(f,g,[J N O],[S h T],’s’,P);Empirical Identifiability Gramian: WI = emgr(f,g,[J N O],[S h T],’i’,P);Empirical Joint Gramian: WJ = emgr(f,g,[J N O],[S h T],’j’,P);

Page 11: Empirical Gramian Framework - A Tutorial

Summary

Use emgr

for:Model Order Reduction

State ReductionParameter ReductionCombined Reduction

System IdentificationParameter IdentificationSensitivity AnalysisDecentralized Control

with:First & Second OrderLinear & NonlinearParametrized & Parametric

Systems

Download, Documentation, Demos:http://gramian.de