Polycon
- Computer Algebra Software for Polynomial Control Systems
Krister Forsman
Dept. of Electrical Engineering, Linkoping University S-581 83 Linkoping, Sweden
email:
krister@isy.liu.se1993-02-15
REGLERTEKNIK
AUTOMATIC CONTROL LINKÖPING
Technical reports from the automatic control group in Linkoping are available by anonymous ftp at the address
130.236.24.1 (joakim.isy.liu.se)This report is contained in the compressed ps-le named
/pub/reports/LiTH-ISY-R-1447.ps.ZPolycon
- Computer Algebra Software for Polynomial Control Systems
Krister Forsman
Dept. of Electrical Engineering
Linkoping University, S-581 83 Linkoping, Sweden email:
krister@isy.liu.se1993-02-15
Abstract.
This paper describes the features and implementation of the Maple package
Polyconwhich is intended to assist the control theorist in the analysis of nonlinear dynamical systems, in continuous and discrete time.
Polyconhandles systems where all nonlinearities are polynomial or rational functions. It implements functions that are not available at a \usable" level in other programs, to the author's knowledge. It is supposed to be accessible to non-experts and those that are not familiar with computer algebra, commutative algebra or dierential algebra.
Polyconis included in the Maple Share Library and thus available by anonymous ftp.
Keywords:
computer algebra, symbolic manipulation, CACSD, polynomial control systems, state space analysis, external behavior, Gr obner bases, commutative algebra, dierential algebra
1 Introduction
When discussing how constructive or how algorithmic a theory is, the following levels provide a rough classication:
abstract meaning that e.g. existence of some objects is proved, but it is not clear how to construct those objects or if this is even possible.
eective algorithms for constructing the objects discussed are given,
even though these algorithms may be of small value for practical purposes, due to high complexity
ecient ecient algorithms for constructing the objects involved are given
there is a computer program that somebody knows how to run that computes the desired entities
usable there is a computer program for computing the desired objects that is not machine dependent and that other people
than its author(s) are able to run.
The dierence between ecient and eective is of course depending on many circumstances, such as available hardware etc, so it is often very dicult to tell which case is at hand.
If we look at the development of commutative, dierential and dierence algebra in the
theory of nonlinear control systems we may discern approximately the following features:
abstract Much of the work by M. Fliess 9, 10, 8]
some work by E.D. Sontag 31], T. Glad and others
eective/ecient Most of the work by Glad 22, 23, 26] and S. Diop 5, 6], some of the work by Fliess.
The word abstract does denitely not have a negative meaning in this context. A large part (maybe the majority) of nonlinear control systems research today would probably be classied as abstract with the denitions above.
The
Polyconpackage, described in this paper, is intended to be one step in the direction from ecient to usable. Its theoretical basis is commutative algebra rather than dierential algebra, the reason being that the constructive aspects of commutative algebra are better understood than those of dierential algebra. There is a large amount of research going on in the area of constructive commutative algebra both from a mathematical and a computer science point of view, whereas only a limited number of persons are developing the algorithmic aspects of dierential algebra, unfortunately.
Maple 3] is probably the most widespread symbolic algebra program today, along with Mathematica. It has been available for more than ten years and its engineering applica- tions abound. Some examples of Maple software for dealing with nonlinear control sys- tems are 4, 32, 34]. The package
Polyconis included in the Maple Share Library and is thus available by anonymous ftp at the addresses
129.132.101.33 (neptune.inf.ethz.ch)and
129.97.140.58 (daisy.waterloo.edu). It is also possible to get it anonymously from Linkoping at the address
130.236.24.1 (joakim.isy.liu.se), under the directory
/pub/src/maple/polycon
. The size of the le containing all the Maple source code for
Polycon
, including help texts, is 85 kbytes.
Polycon
is a collection of Maple procedures for the analysis of polynomial and rational dynamical systems written either in state space form, i.e. in the form
_
x
(
t) =
f(
x(
t)
u(
t))
y=
h(
xu) (1) or
x
(
t+ 1) =
f(
x(
t)
u(
t))
y=
h(
xu) (2) where
hand all components of
fare rational functions in
xand
u, or in input-output form, i.e.
p
(
y0:::ynu0:::ur) = 0 (3) where subindices denote either time-derivatives or time-shifts and
pis a polynomial. Most functions are available in a continuous time and a discrete time version the convention is that the names of continuous time functions end in
cand those of discrete time functions end in
d. Most functions handle systems with several inputs.
The package is aimed at questions related to state space realizations, such as
retrieving external behavior from a state space description, i.e. \conversion" from a state space description ((1) or (2)) to an input-output description (3):
ss2ioc, ss2iodrealization of input-output equations:
par2ssc, io2ssc, io2ssd(algebraic) observability, as dened in e.g. 19, 23]:
obsvc, obsvdstate transformations of systems:
newsysc, newsysdnding the transformation between two i/o-equivalent systems:
sstrac, sstradThere is also a procedure
loclyapfor analysis of local Lyapunov functions.
Note that there are many topics in control theory that are not represented at all in
Polycon
, such as controllability, optimal control and feedback. The reasons for this is that there are basically no algorithms general enough for solving these problems in the algebraic framework, to the author's knowledge. One can say that the emphasis is on analysis rather than design, mainly because analysis is simpler
:::This paper is organized as follows:
In section 2 we give a user-level description of the most important
Polyconfunctions.
Section 3 very briey discusses some of the mathematical background and the algo- rithms used, mainly by referring to earlier work.
In section 4 we show how
Polyconworks on a simple example.
Section 5 contains an outline of the possible extensions of the procedures and the functionality of
Polycon.
2 The Main Functions
The functions available in
Polyconare, in alphabetical order:
auxlieder io2ssc io2ssd lieder liederlist liehom liehomlist loclyap newsysc newsysd obsvc obsvd par2ssc ss2ioc ss2iod sstrac sstrad uyder uyhom xss2ioc xss2iod
All functions have detailed help texts. For more information about a particular function, use the help command
?after having loaded
Polycon, e.g.
?sstracYou can also type
?polyconto obtain general information on
Polycon.
In
Polycontime derivatives and time shifts of dependent variables are represented by subindices, as done by e.g. Ritt 30]. This means that e.g. in continuous time
y
0
=
y(
t)
y1= _
y(
t)
y2=
y(
t)
etc
:(4) while in discrete time
y
0
=
y(
t)
y1=
y(
t+ 1)
y2=
y(
t+ 2)
etc
:(5) This rule holds for input and output variables. Higher derivatives or shifts of state variables do not occur, so state variables are still called
x1:::xnby default. If two state descriptions are involved the second one has state variables
z1:::znby default. In functions where the
rst derivative or shift of the state variables may occur, e.g.
io2ssand
newsys, they are
denoted by
dx1:::dxn. In Maple, subscript is represented by concatenation so that e.g.
y2is written
y2.
'
i
(
xiuy) = 0
-
io2ssc
obsvc x
_ =
f(
xu)
y
=
h(
xu)
-
ss2ioc
io2ssc, par2ssc p
(
uy) = 0
_
z
=
g(
zu)
y
=
j(
zu)
? 6
sstrac, newsysc
Figure 1: Diagram describing continuous time functions.
'
i
(
xiuy) = 0
-
io2ssd obsvd
x
+
=
f(
xu)
y
=
h(
xu)
-
ss2iod
io2ssd p
(
uy) = 0
z
+
=
g(
zu)
y
=
j(
zu)
? 6
sstrad, newsysd
Figure 2: Diagram describing discrete time functions.
The largest part of the package is aimed at questions related to rational state realizations of control systems. The diagram in gure 1 summarizes the use of the dierent procedures in the continuous time case. In the diagram
pand
'iare dierential polynomials in
uy, i.e. they involve time derivatives of
uand
y(but not of
xi).
For discrete time systems the functions in gure 2 are available. Here
pand
'iinvolve time shifts of
uand
y(but not of
xi).
The functions
ss2iocand
ss2iodtake as input a system in state space form, rep- resented by the polynomial rhs vector eld
f(an object of type
vectorin Maple) and the output-map
h(a polynomial) and return a polynomial in the input, the output and their derivatives representing the input-output behavior of the system.
These two procedures work for many rational systems as well, i.e. systems of the type (1) or (2) where
hand all
fiare rational functions of their arguments. However, there are examples where the algorithm fails, see e.g. 13].
The functions
obsvcand
obsvdtake as input a system in state space form and one
of the state variables,
xisay, and return two polynomials in the input, the output and their
derivatives and
xiconstituting an observer relation for
xi. Such a relation exists i the system is algebraically observable, i.e. the input-output equation is of order equal to the state space dimension.
The user can choose if he only wants to accept as an answer a list of rational expressions for
xiin inputs and output (and their derivatives) or if he allows
xito occur nonlinearly. In the latter case the answer is a list of polynomials
'iin inputs and output and
xisuch that
'
i
= 0 under the system in question.
The functions
io2sscand
io2ssdcan be thought of as the inverses of
obsvcand
obsvd. The input arguments are a polynomial input-output equation (represented by a polynomial
p
only) and a list of rational expressions for state variable candidates, i.e. a list
Sof rational functions in
uyand their derivatives such that the
i:th element of
Smight serve as the
i:th state. The function returns a list consisting of the rhs and the output map of the state space equation for the continuous time polynomial SISO system given by the i/o-equation
p= 0.
The procedure
par2sscreturns the rhs vector of the state equation for a continuous time rational SISO system given in i/o-form. Its input is a list
Hof rational functions that parametrize the hypersurface
p= 0, where
pis the i/o-relation.
There is no function
par2ssd, because it is not clear at the moment whether it is al- ways possible to go from a rational parametrization of a hypersurface to a realization of the corresponding discrete time system.
The procedures
sstracand
sstradsuppose that the two systems involved are i/o- equivalent and then nd the state space transformation between them.
The functions
newsyscand
newsysdtake a system in state space form and a transfor- mation as inputs and returns the system in the new coordinates, dened by the transforma- tion.
For a full description of all
Polyconfunctions we refer either to the online help texts or to the technical report 15] which is available by anonymous ftp. This report contains exactly the same information as is available online in Maple plus some source code.
3 The Implementation
Let us here very briey mention something about the mathematics behind
Polycon.
Polycon
heavily relies on elimination theory for commutative rings and in particular Grobner bases (GB) computations. For an introduction to the theory of GB see e.g. 2, 18, 21, 29]. All major computer algebra programs (Maple, Mathematica, Reduce, Axiom and Macsyma) have GB packages of varying depth and quality. The branch of mathematics dealing with e.g. GB is currently very active and a lot of progress is still made in this research area.
Grobner bases can be seen as the generalization of Gaussian elimination to systems of
polynomial equations. A GB is a generating set for a polynomial ideal having some appealing
properties. Most important in this context is the following elimination property, which we
state without giving any details, since that would lead much too far:
Let
abe an ideal in
kX1 :::Xn] and partition
X1:::Xninto two disjoint sets
Sand
T. If G is a GB for
aw.r.t. a pure lexicographic term ordering ranking
Slower than
Tthen
hG
\kS]
i=
a\kS] .
This statement is proved in e.g. 21] or 2].
Many functions in
Polyconuse the Boege-Gebauer-Kredel (BGK) algorithm 1] for eliminating variables since this is in general more ecient than computing a GB w.r.t. a pure lexicographic term ordering. The BGK algorithm rst computes a GB which does not perform elimination, but which is comparatively cheap to compute. Then linear algebra techniques are used to nd the elimination ideal see 1, 17, 20] for more details. The BGK algorithm is implemented as
finduniin Maple. Most of the time, the BGK algorithm cannot be applied directly to the ideals considered in
Polycon. Instead the ideals must rst be localized so that they become zero-dimensional. This simply means that some of the variables are considered as parameters, i.e. the eld of coecients is extended to contain rational functions in some of the variables. Theoretical investigations of the localization procedure are presented in 16, 17].
The theoretical background, with proofs for the correctness of the algorithms in
Polycon, is given in chapters 5 and 6 of the author's PhD-thesis 12], where also some source code for primitive versions of the functions is given. Related theoretical work can be found in
5, 6, 19, 22, 23, 28, 33].
The theory behind
obsvc, obsvd, io2sscand
io2ssdis also described in 16] and 19], that of
loclyapin 11] and that of
par2sscin 14].
4 An Example
Below is an example showing how some computations on a simple control system can be performed using
Polycon. The example is taken from 27], p. 147.
The following equations roughly describe the vertical motion of a hot air balloon:
_
x
1
=
Ku;1
(
x1;T) _
x
2
=
x3_
x
3
=
g WaW
(1
; Tx
1
)
;1
;W x
3
(6)
Here
x2is the altitude above sea level,
x3=
dtd x2and
x1is the air temperature (in Kelvin) inside the balloon. The constants
K Waare related to the thermal and physical characteristics of the balloon,
Wis the weight of the balloon including payload and air (in kg),
Tis the outdoor temperature, and
gis the acceleration of gravity. The input
uof the system is the heat transfer rate supplied to the balloon by the heater. Let us consider the altitude as the output of the system:
y=
x2. If we put
g= 10
W= 200
Wa= 400 (I can't guarantee that these are realistic values
:::) we can use the procedure
ss2iocin
Polyconto obtain a dierential equation relating the input and the output this equation is
8000
Ty3;400(
T+
Ku)
y22;40
(
Ku+
T)
y1+ 200
Ku+ 10
Ty2;
2
(
Ku+
T)
y12+ 400
Kuy1+ 40000(
T ;Ku) = 0 (7)
where
y1=
dtdy(
t),
y2=
dtd22y(
t) etc.
Now suppose that we have accurate measurements of the altitude
x2(so that we can compute the velocity and acceleration with acceptable precision) and want to estimate the temperature
x1in the balloon. We can then use the function
obsvcto nd an expression for
x1in the output and its derivatives. It turns out that
x
1
= 400
T200
;20
y2;y1(8)
(In fact, the observer relation is quite easy to derive by hand, in this case.) Below is a Maple session for doing the computations above:
> with(linalg): read(`polycon.m`):
> f:=vector(-(1/tau)*(x1-T)+K*u, x3, g*((Wa/W)*(1-(T/x1))-1-(mu/W)*x3)]):
> g:=10: Wa:=400: W:=200:
> p:=ss2ioc(f,x2):
> collect(p,y3,y2,y1])
8000 T tau y3 + (- 400 T - 400 K u0 tau) y22
+ ((- 40 mu K u0 tau - 40 mu T) y1 + 8000 K u0 tau + 400 mu T tau) y2
2 2 2
+ (- mu T - mu K u0 tau) y1 + 400 mu K u0 tau y1 + 40000 T - 40000 K u0 tau
> obsvc(f,x2,x1)
- 400 ---]T 20 y2 - 200 + y1 mu
5 Future Extensions
The current plans for future versions of
Polyconinclude:
Full support for rational functions. As mentioned in section 2 some functions fail on some rational systems. It is probably not dicult to amend this using the Rabinovich trick 7 , 13].
Identiability. It is possible to test global identiability of parameters in polynomial systems in state space form using GB. Some references, treating an even more general problem, are 24, 25, 35]. It seems straightforward to implement such functions in
Polycon