Professional Documents
Culture Documents
20-22, 2009
• Plot contains functions to compute and plot used to further reduce the matrix to a real Schur
poles and zeros, frequency responses, step re- form (RSF) from which the eigenvalues are easily
sponses etc. computed.
Beside the eigenvalues, also the invariant zeros
• Conversion contains functions to convert play an important role for linear dynamic systems.
from one data structure to another descrip- They identify those exponential input signals that
tion form, e.g., from StateSpace to Transfer- are completely blocked by the system. A complex
Function. number s = zk is an invariant zero of a state space
system
• Transformation contains functions to per-
form a similarity transformation, e.g., to ẋ = Ax + Bu
transform to controllability form. y = Cx + Du
• Import contains functions to import the if the Rosenbrock matrix
data structure from a model (by linearization) !
or from a file. sI − A B
P (s) =
−C D
All functions of the library are Modelica functions.
For basic linear algebra computations, like solu- is rank deficient for s = zk , i.e.
tions of linear systems of equations, or eigenvalue
rank (P (zk )) < max (rank (P (s))) (1)
computations, the standard numerical library LA- s
PACK [6] is used. Besides LAPACK, no other ex- (note, that the modification of the signs in the
ternal functions are utilized. matrix do not change the rank). If the system
In the following sections, some of the above has the same number of inputs and outputs, the
quoted sublibraries are described in more detail invariant zeros are the generalized eigenvalues of
for StateSpace systems. the pair of square matrices (L, M) with
! !
2.1 StateSpace.Analysis A B I 0
L= , M= .
C D 0 0
The Analysis package
of StateSpace contains In this case the generalized eigenvalues, i.e., the
functions to compute invariant zeros, could be computed with a stan-
eigenvalues, invariant dard QZ-algorithm, e.g., with LAPACK function
zeros, and various dggev. However, this algorithm fails if the system
system properties. has not the same number of inputs and outputs or
The eigenvalues of if one of the matrices B or C does not have full
a state space sys- column or full row rank respectively. For this rea-
tem, which are the son, in the LinearSystems library the algorithm
eigenvalues of the from [5] is used to calculate the invariant zeros
system matrix A, are of arbitrary StateSpace systems, i.e., with arbi-
calculated with the trary numbers of inputs and outputs and rank de-
LAPACK function ficient matrices. The approach is to compress the
dggevx, i.e., using matrices (A, B, C, D) with QR-decompositions to
the basic eigenvalue (Ar , Br , Cr , Dr ) such that a reduced order system
computation with an matrix !
additional balancing sI − Ar Br
Pr (s) =
transformation to im- −Cr Dr
prove the conditioning with invertible matrix Dr have the same zeros
of the eigenvalues. as P (s). After another transformation that com-
The principle of the Figure 4: Package presses the columns of [Cr , Dr ] to [0, Df ] such that
algorithm is to reduce StateSpace.Analysis ! !
matrix A to an upper Af ∗ Ar Br
= V
Hessenberg form first. The QR algorithm is then 0 Df Cr Dr
i frequency[Hz] damping
3/4 1.7877 -0.1492
The relation of the system states to the modal
states, i.e., the composition of the system states
is shown in the next table:
and to transform it into an ordered real Schur form discrete representation is automatically derived
! from the continuous form.
T11 T12 T Besides standard input/output blocks, espe-
T= = U HU
0 T22 cially for the data structures of the LinearSys-
tems library, a “Template” sublibrary is present
where T11 contains the n eigenvalues of H with
which provides standard controller structures with
negative real parts [2]. Considering an appropriate
replaceable components. As an example, a state
partitioning of matrix U
feedback control is shown in Figure 11, and state
!
U11 U12 feedback control based on estimated states using
U= , an observer is shown in Figure 12.
U21 U22
XU11 = U21 .
to utilize non-linear inverse (Modelica) models in Figure 16: Screenshot of animated simulation
controllers is described in [10]. The templates are
provided to support quick implementations of con-
trollers by simple redeclarations of the replaceable track the cart to a given (time varying) position
components. without dropping the pendulum.
5 Conclusions
linear systems analysis and synthesis and a li-
This paper has sketched the Modelica libraries brary to model continuous and discrete linear con-
LinearSystems and Controller, i.e. a library for troller blocks. Compared with the former version
References
[1] Benner P. and Byers, R. (1998): An Exact
Line Search Method for Solving Generalized
Continuous-Time Algebraic Riccati Equations.
IEEE Transactions on Automatic Control, vol 43,
pp. 101-107
[2] Datta B. N. (2004): Numerical Methods for Lin-
ear Control Systems. Elsevier Academic Press.
[3] Dymola (2009): Dymola Version 7.3. Das-
sault Systèmes, Lund, Sweden (Dynasim).
http://www.dymola.com.
[4] Elmqvist H., Otter M., Henriksson D., Thiele B.,
and Mattsson S. E. (2009): Modelica for Em-
bedded Systems. In: Proc. of the 7th Mod-
elica Conference 2009, Como, Italy, Sept. 20-22.
http://www.modelica.org/events/modelica2009.
[5] Emami-Naeini, A. and Van Dooren, P. (1982): Com-
putations of zeros of linear multivariable sys-
tems, Automatica 26, pp. 415-430
[6] LAPACK (2009): http://www.netlib.org/lapack/.
[7] Laub A. J. (1979): A Schur Method for Solving
Algebraic Riccati equations. IEEE Trans. Auto.
Figure 21: Angle ϕ2 (upper joint) and estimated Contr., vol 24, pp. 913-921.
value (red line) for undisturbed (above) and dis- [8] Olsson H., Otter M., Elmqvist H., and Brück D.
turbed (below) system (2009): Operator Overloading in Modelica 3.1.
In: Proc. of the 7th Modelica Conference 2009, Como,
Italy, Sept. 20-22.
of the LinearSystems library, the current version [9] Otter M. (2006): The LinearSystems li-
has been extensively restructured and new func- brary for continuous and discrete con-
tions have been added. The most important func- trol systems. In: Proc. of the 5th Model-
tions of this library have been described for the ica Conference 2006, Wien, Austria, Sept. 4-5.
http://www.modelica.org/events/modelica2006/-
case of state space systems and the mathematical Proceedings/sessions/Session5c1.pdf
approaches have been outlined.
[10] Thümmel M., Looye G., Kurze M., Otter M.,
Concerning the Controller library, the new fea- and Bals J. (2005): Nonlinear Inverse Mod-
ture to use templates for common control system els for Control. In: Proc. of the 4th Int.
structures have been introduced. An example of Modelica Conference 2005, Hamburg, March 7-
the design of a controller for a inverse double pen- 8. http://www.modelica.org/events/Conference2005/-
online_proceedings/Session3/Session3c3.pdf
dulum demonstrates the usage of the libraries. It
is planned to include the libraries in the Model- [11] Varga A. (1981): A Schur method for pole as-
signment. IEEE Trans. Autom. Control, Vol. AC-26,
ica Standard library. Currently, they are available pp. 517-519.
from http://www.Modelica.org/libraries.
Acknowledgements
Partial financial support of DLR by BMBF
(BMBF Förderkennzeichen: 01IS07022F) for this
work within the ITEA project EUROSYSLIB
(http://www.itea2.org/public/project_leaflets/
EUROSYSLIB_profile_oct-07.pdf) is highly
appreciated.
We would also like to thank Hilding Elmqvist
and Hans Olsson from Dassault Systèmes (Dy-
nasim) for their support and for discussions es-
pecially related to operator overloading.