Model Simplification Tools

The modelsimp Module

modelsimp.balred(sys, orders, method='truncate')

Balanced reduced order model of sys of a given order. States are eliminated based on Hankel singular value.

Parameters :

sys: StateSpace :

Original system to reduce

orders: integer or array of integer :

Desired order of reduced order model (if a vector, returns a vector of systems)

method: string :

Method of removing states, either 'truncate' or 'matchdc'.

Returns :

rsys: StateSpace :

A reduced order model

Raises :

ValueError :

  • if method is not 'truncate'
  • if eigenvalues of sys.A are not all in left half plane (sys must be stable)

ImportError :

if slycot routine ab09ad is not found

Examples

>>> rsys = balred(sys, order, method='truncate') 
modelsimp.era(YY, m, n, nin, nout, r)

Calculate an ERA model of order r based on the impulse-response data YY.

Note

This function is not implemented yet.

Parameters :

YY: array :

nout x nin dimensional impulse-response data

m: integer :

Number of rows in Hankel matrix

n: integer :

Number of columns in Hankel matrix

nin: integer :

Number of input variables

nout: integer :

Number of output variables

r: integer :

Order of model

Returns :

sys: StateSpace :

A reduced order model sys=ss(Ar,Br,Cr,Dr)

Examples

>>> rsys = era(YY, m, n, nin, nout, r)
modelsimp.hsvd(sys)

Calculate the Hankel singular values.

Parameters :

sys : StateSpace

A state space system

Returns :

H : Matrix

A list of Hankel singular values

See also

gram

Notes

The Hankel singular values are the singular values of the Hankel operator. In practice, we compute the square root of the eigenvalues of the matrix formed by taking the product of the observability and controllability gramians. There are other (more efficient) methods based on solving the Lyapunov equation in a particular way (more details soon).

Examples

>>> H = hsvd(sys)
modelsimp.markov(Y, U, M)

Calculate the first M Markov parameters [D CB CAB ...] from input U, output Y.

Parameters :

Y: array_like :

Output data

U: array_like :

Input data

M: integer :

Number of Markov parameters to output

Returns :

H: matrix :

First M Markov parameters

Notes

Currently only works for SISO

Examples

>>> H = markov(Y, U, M)
modelsimp.modred(sys, ELIM, method='matchdc')

Model reduction of sys by eliminating the states in ELIM using a given method.

Parameters :

sys: StateSpace :

Original system to reduce

ELIM: array :

Vector of states to eliminate

method: string :

Method of removing states in ELIM: either 'truncate' or 'matchdc'.

Returns :

rsys: StateSpace :

A reduced order model

Raises :

ValueError :

  • if method is not either 'matchdc' or 'truncate'
  • if eigenvalues of sys.A are not all in left half plane (sys must be stable)

Examples

>>> rsys = modred(sys, ELIM, method='truncate')

Table Of Contents

Previous topic

Python-Control Classes

Next topic

Matlab-like Routines

This Page