Lecture 11 - Automatic Control

Modeling & Simulation, TSRT62
Lecture 11. DAE models
Claudio Altafini
Automatic Control, ISY, Linköping University
Claudio Altafini
Modeling & Simulation 2014, Fö 11
AUTOMATIC CONTROL
REGLERTEKNIK
LINKÖPINGS UNIVERSITET
Summary of lecture 10
2(19)
Bond graphs: systematic construction
Bond graphs: state space models
An object-oriented modeling language: Modelica
Claudio Altafini
Modeling & Simulation 2014, Fö 11
AUTOMATIC CONTROL
REGLERTEKNIK
LINKÖPINGS UNIVERSITET
Lecture 11: DAE models
3(19)
Summary of today
Differentiability Index
Linear DAE-models, standard form
Nonlinear DAE-models
In the book: chapter 7
Claudio Altafini
Modeling & Simulation 2014, Fö 11
AUTOMATIC CONTROL
REGLERTEKNIK
LINKÖPINGS UNIVERSITET
DAE models
4(19)
Differential Algebraic Equations, DAE
x˙ 1 = f (x1 , x2 , u)
0 = g(x1 , x2 )
y = h(x1 , x2 , u)
or, more generally,
F(z˙ , z, u) = 0,
y = h(z, u)
u = input,
y = output,
z = generalized state space, or internal variables
Claudio Altafini
Modeling & Simulation 2014, Fö 11
AUTOMATIC CONTROL
REGLERTEKNIK
LINKÖPINGS UNIVERSITET
Bond graphs and DAE models
5(19)
A bond graph leads to a DAE once we plug in
1. ODEs for the I- and C-elements
2. static relationships for R elements
3. expressions for sources
4. Kirchhoff laws for s- and p- junctions
if the bond graph has conflict-free causality and has no causal
loops, then the DAE can be mapped to a state space model
Claudio Altafini
Modeling & Simulation 2014, Fö 11
AUTOMATIC CONTROL
REGLERTEKNIK
LINKÖPINGS UNIVERSITET
RC-circuit with nonlinear R
6(19)
v
i
u
C
Linear resistor
v = R1 i
Cx˙ = i
u = x+v
Claudio Altafini
Modeling & Simulation 2014, Fö 11
AUTOMATIC CONTROL
REGLERTEKNIK
LINKÖPINGS UNIVERSITET
RC-circuit with nonlinear R
6(19)
v
i
u
C
Linear resistor
v = R1 i
Cx˙ = i
u = x+v
Nonlinear resistor
v = R1 i + R2 i5
Cx˙ = i
u = x+v
It is not possible to solve explicitly for
i as a function of u, x =⇒DAE
Claudio Altafini
Modeling & Simulation 2014, Fö 11
AUTOMATIC CONTROL
REGLERTEKNIK
LINKÖPINGS UNIVERSITET
Definition of index
7(19)
Index for a DAE
F(z˙ , z, u) = 0
is the number of differentiations needed to achieve a state space
form
˙ . . . , u(k ) )
z˙ = φ(z, u, u,
Number of times that the equations must be derived in order for
z˙ to be computable (from the rest)
Called sometimes differentiation index
It constitute a measure of the difficulty to simulate a system
Claudio Altafini
Modeling & Simulation 2014, Fö 11
AUTOMATIC CONTROL
REGLERTEKNIK
LINKÖPINGS UNIVERSITET
Index for a DAE
8(19)
Index for a DAE
1. special case: state space
z˙ = f (z, u)
=⇒
index = 0
2. otherwise: differentiate
∂F
∂F
∂F
z¨ + z˙ + u˙ = 0
∂z˙
∂z
∂u
If z˙ can be computed
=⇒
index = 1
3. otherwise: keep differentiating
Claudio Altafini
Modeling & Simulation 2014, Fö 11
AUTOMATIC CONTROL
REGLERTEKNIK
LINKÖPINGS UNIVERSITET
ODE vs. DAE: comparison
9(19)
DAEs are more complicated than ODEs
The solution is less continuous than the input signal (need to
differentiate the input if index > 0)
Initial values must satisfy all equations (including algebraic
ones)
Index can be seen as a measure of how far a DAE is from an
ODE
In practice:
• if index = 1 it is possible to solve numerically
• If index > 1 it is more difficult to solve a DAE numerically
Claudio Altafini
Modeling & Simulation 2014, Fö 11
AUTOMATIC CONTROL
REGLERTEKNIK
LINKÖPINGS UNIVERSITET
Linear DAE model
10(19)
general form of a linear DAE
E˙z + Fz = Gu
If E is invertible, then
z˙ = −E−1 Fz + E−1 Gu
which is the usual state space description.
If E is singular, then one gets a genuine DAE description
=⇒ index is nontrivial
Claudio Altafini
Modeling & Simulation 2014, Fö 11
AUTOMATIC CONTROL
REGLERTEKNIK
LINKÖPINGS UNIVERSITET
Index for linear systems. Computation
1. Order rows so that
11(19)
E1
F1
G1
z˙ +
z=
u
E2
F2
G2
where E1 full rank, and E2 linear combination of E1
2. Eliminate E2 through row operations
E1
F1
G
z˙ + ˜ z = ˜ 1 u
0
F2
G2
3. Differentiate the bottom part
E1
F1
G1
0
˜F2 z˙ + 0 z = 0 u + G
˜ 2 u˙
E1
4. If ˜ invertible =⇒ Index = 1
F2
5. If not, repeat procedure. Index=number of differentiations
Claudio Altafini
Modeling & Simulation 2014, Fö 11
AUTOMATIC CONTROL
REGLERTEKNIK
LINKÖPINGS UNIVERSITET
Solvability for DAE models
12(19)
E˙z + Fz = Gu
Laplace transform:
(sE + F)Z(s) = GU (s)
Exist a unique solution if
sE + F
is invertible for some s
Z(s) = (sE − F)−1 GU (s)
=⇒ DAE is solvable uniquely in the Laplace variable
Claudio Altafini
Modeling & Simulation 2014, Fö 11
AUTOMATIC CONTROL
REGLERTEKNIK
LINKÖPINGS UNIVERSITET
Transformation for DAE systems
13(19)
E˙z + Fz = Gu
change variable
z = Qw
where Q non-singular matrix
left multiply with P
PEQw˙ + PFQw = PGu
where P nonsingular matrix
Claudio Altafini
Modeling & Simulation 2014, Fö 11
AUTOMATIC CONTROL
REGLERTEKNIK
LINKÖPINGS UNIVERSITET
Standard form for DAE systems
14(19)
If (sE + F) invertible =⇒ P and Q can be chosen so that the system
take the standard form
I 0
0 N
B
−A 0 w1
w˙ 1
=
u
+
D
w˙ 2
0
I w2
where the matrix N obeys to Nk = 0, for some k
w1 = state variable obeying normal state space ODE
w˙ 1 = Aw1 + Bu
equation for w2 :
Nw˙ 2 + w2 = Du
Claudio Altafini
Modeling & Simulation 2014, Fö 11
AUTOMATIC CONTROL
REGLERTEKNIK
LINKÖPINGS UNIVERSITET
Index for standard form
15(19)
Nw˙ 2 + w2 = Du
if N = 0 then
w2 = Du
=⇒
index = 1
if N 6= 0 but N2 = 0
w2 = Du − NDu˙
=⇒
index = 2
Notice that u˙ is needed.
index = k : u must be differentiated k − 1 times
w2 = Du − NDu˙ + . . . + (−N )k−1 Du(k−1)
Claudio Altafini
Modeling & Simulation 2014, Fö 11
AUTOMATIC CONTROL
REGLERTEKNIK
LINKÖPINGS UNIVERSITET
Index for nonlinear DAEs
16(19)
Index for a DAE = number of differentiations needed to express z˙ as
˙ . . . , u(k )
a function of z, u, u,
F(z˙ , z, u) = 0
state space case
z˙ = f (z, u)
=⇒
index = 0
otherwise: differentiate
∂F
∂F
∂F
z¨ + z˙ + u˙ = 0
∂z˙
∂z
∂u
If z˙ can be computed
=⇒
index = 1
otherwise: keep differentiating
Claudio Altafini
Modeling & Simulation 2014, Fö 11
AUTOMATIC CONTROL
REGLERTEKNIK
LINKÖPINGS UNIVERSITET
Implicit function theorem
17(19)
Nonlinear DAE systems lead to nonlinear equation solving
For a nonlinear equation
g(x, y) = 0
the implicit function theorem holds
If g(xo , yo ) = 0 and gy (xo , yo ) is invertible then the
equation g(x, y) = 0 can be solved in a neighborhood of
xo , yo , i.e., there exist a function φ such that y = φ(x)
satisfies g(x, y) = g(x, φ(x)) = 0
Claudio Altafini
Modeling & Simulation 2014, Fö 11
AUTOMATIC CONTROL
REGLERTEKNIK
LINKÖPINGS UNIVERSITET
Example: index = 1
18(19)
System of index = 1
x˙ = f (x, y)
0 = g(x, y),
gy invertible
use differentiation
use implicit function theorem to eliminate y
y = φ (x)
=⇒
x˙ = f (x, φ(x))
state space in x only
Claudio Altafini
Modeling & Simulation 2014, Fö 11
AUTOMATIC CONTROL
REGLERTEKNIK
LINKÖPINGS UNIVERSITET
Example: index=2
19(19)
System of index = 2
x˙ = f (x, y)
0 = g(x),
gx fy invertible
use differentiation
Claudio Altafini
Modeling & Simulation 2014, Fö 11
AUTOMATIC CONTROL
REGLERTEKNIK
LINKÖPINGS UNIVERSITET