Singular perturbation analysis of a mode initialization algorithm for simulating mode switching systems
Krister Edstrom
Department of Electrical Engineering Linkoping University, S-581 83 Linkoping, Sweden
WWW: http://www.control.isy.liu.se
Email: edstrom@isy.liu.se
February 9, 1999
REGLERTEKNIK
AUTOMATIC CONTROL LINKÖPING
Report no.: LiTH-ISY-R-2047 Submitted to CDC '98
Technical reports from the Automatic Control group in Linkoping are available by anonymous ftp at the address
ftp.control.isy.liu.se
. This report is contained in the compressed postscript le
2047.ps.Z.
Singular perturbation analysis of a mode initialization algorithm for simulating mode switching systems
Krister Edstrom
Dept. of Electrical Engineering Linkopings Universitet SE-581 83 Linkoping, Sweden
edstrom@isy.liu.se Abstract
An initialization algorithm for the continuous states in mode switching systems is shown to give correct ini- tial values. The mode switching systems are modeled with switched bond graphs, and the proof is based on singular perturbation theory.
1 Introduction
When simulating a physically modeled mode switch- ing system 1], the state space may change size when changing modes. The problem of initializing the new mode becomes non-trivial. From a physical point of view, the initialization rules come from a generaliza- tion of the principle of momentum conservation 5, 2].
In this paper a physically based initialization algorithm for a system modeled with switched bond graphs 6] is analyzed using singular perturbation theory.
All proofs have been omitted and can be found in 3].
2 A mode initialization algorithm
Assume that the switched bond graph model has the following properties:
A1. There are no multi-port elements in the bond graph.
A2. There are no structural loops in the bond graph.
A3. There are no transformers or gyrators. This is to simplify notation. The algorithm can be extended to bond graphs with transformers and gyrators.
We also need the following denition:
Denition 1 (Dependent set)
In a bond graph with one storage element
swith non- preferred causality, the
dependent set Dconsists of
s
and all elements that have a direct causal path 7]
leading to
s.
When, during a simulation run, a transition between two modes, denoted
M1and
M2, occurs the follow- ing assumptions are made about the transition and the mode being left,
M1.
A4. There are no causal conicts in
M1.
A5. One switch changes states when changing modes.
These assumptions can be relaxed. They are intro- duced to simplify notation and proofs.
The initialization algorithm is the following:
Algorithm 1 (Initialization algorithm)
1.
Save the value of the continuous state
x(
t0).
t0de- notes the time before the mode change and
tthe time after the mode change. Since the mode change is in- stantaneous,
t;t0<for any choice of
>0.
2.
Propagate causality in mode
M2.
3.
Find
D2, the dependent set in
M2. Let
l1and
l2be the number of storage elements and sources respec- tively in
D2.
s1is the element in
D2with non-preferred causality,
sj j= 2
:::l1the other storage elements in
D2, and
sj j=
l1+ 1
:::n1the storage elements in
{D2.
pj j= 1
:::l2are the sources in
D2, and
p
j
j
=
l2+ 1
:::n2the sources in
{D2.
Introduce a state variable
xjfor each storage element
s
j
and an input variable
ujfor each source
pj.
4.
Use a standard bond graph equation generation al- gorithm to derive an equation
x1=
gs1(
x2:::xl1) +
g p
1
(
u1:::ul2). Rewrite the equation as:
x
1
;g s
1
(
x2:::xl1) =
gp1(
u1:::ul2) (1)
5.
Derive
l1;1 equations
g2:::gl1, expressing _
xj,
j
= 2
:::l1in the rate variable _
x1, using the causal path between
sjand
s1, and neglecting all other causal paths leading to
sj:
_
x
j
=
gj( _
x1) =
j1x_
1 j= 2
:::l1(2)
6.
Rewrite and integrate both sides of
gj j= 2
:::l1across the change of mode to achieve new equations:
x
j
(
t)
;j1x1(
t) =
xj(
t0)
;j1x1(
t0) (3)
7.
All storage elements outside
D2have preferred causality, therefore they will be continuous:
x
j
(
t) =
xj(
t0)
j=
l1+ 1
:::n1(4) Equations (1), (3), and (4), form a system of equations that is solved to get the initial values of the new mode:
1
Lemma 1
The system of equations generated in Algorithm 1 is solvable when assuming that Equation (1) is linear:
g s
1
(
x2:::xl1) =
12a2x2+
:::+
1lal1xl1(5)
g p
1
(
u1:::ul2) =
b1u1+
:::+
bl2ul2(6) where
ai0, and
1iis either +1 or
;1,
i= 2
:::l1.
3 Singular perturbation analysis
We will here argue that the achieved values are cor- rect by using the theory of singular perturbations 4].
Consider the instant change of state variable values as a very fast continuous change. Then there will be two time scales in the model one fast describing the dynam- ics earlier modeled as instant changes, and one slow, describing the rest of the dynamics. By separating the two time scales, the slow dynamics can be considered constant while the fast dynamics reaches steady state.
We will show that the steady state value of the fast dynamics and the constant value of the slow dynamics are the values achieved by Algorithm 1 in Section 2.
Replace the switch that changes state with a linear
R -element,
e=
Rf, and assume that the constant
R
changes value when the mode change appear. In the new model, the causality does not change when changing modes.
Here we will only consider C -elements as storage ele- ments. Therefore we will give the parameter
Rin the added R -element a small value
. The proofs for I -
elements will be dual, if the parameter value of the added R -element is chosen to be
R= 1
=.
When generating equations from the new bond graph, we will get a state space description where the right hand side depends on
. Introduce new states
y
= (
y1:::yn)
T, related to the old states
x= (
x1:::xn)
T, with the following transformation:
y
=
Tx(7)
where the transformation matrix is derived from Equa- tions (1), (3) and (4):
T
=
2
6
6
6
6
6
4
1 ;12a2 ::: ;
1l
1 a
l
1 0::: 0
;21 1 ::: 0 0::: 0
... ... ... ... ... ... ...
;
l
1 1
0 ::: 1 0::: 0
0 0 ::: 0 1::: 0
... ... ... ... ... ... ...
0 0 ::: 0 0::: 1
3
7
7
7
7
7
5
(8)
With this change of basis the following theorem holds:
Theorem 1
In the switch bond graph model, replace the switch that is being toggled at the mode change with a linear R- element with parameter value
. Derive the state space equations for the bond graph. Make a change of bases of the state space equation according to Equation (7).
The structure of the state space form will then be the following:
h
y1_
_ y
2:n
i
=
hA11A2:n1+A11 A12:n A2:n2:n
i
y2:ny1] +
hB1+BB2 1 iu
(9) where
A11 6= 0 and
B1=A11uequals the right hand
side of Equation (1).
The fast dynamics correspond to
y1and the slow dy- namics to
y2:n. The time scale is separated by letting
tend to zero. In the limit we get
y
1
=
B1A
11
u
(10)
_
y
2:n
=
A2:n2:ny2:n+
B2u(11) By comparing Equation (10) with Equations (1), (5), and the rst row in Equation (8) it is clear that Equa- tions (10) and (1) are similar.
By assuming that the slow dynamics are constant,
y
2:n