Discretizing stochastic dynamical systems using Lyapunov equations
Niklas Wahlström, Patrik Axelsson, Fredrik Gustafsson
Division of Automatic Control Linköping University
Linköping, Sweden
Motivation 2(15)
Stochastic dynamical systems are important in state estimation, system identification and control.
System models are often provided in continuous time, while a major part of the applied theory is developed for discrete-time systems.
Discretization of continuous-time models is hence fundamental.
AUTOMATIC CONTROL
Discretization 3(15)
Continuous-time model
˙x ( t ) = Ax ( t ) + Bw ( t ) E [ w ( t ) w ( τ ) T ] = Sδ ( t − τ )
Discrete-time model x k + 1 = Fx k + w k
E [ w k w T l ] = Qδ kl
Discretization 3(15)
Continuous-time model
˙x ( t ) = Ax ( t ) + Bw ( t ) E [ w ( t ) w ( τ ) T ] = Sδ ( t − τ )
Discrete-time model x k + 1 = Fx k + w k
E [ w k w T l ] = Qδ kl
This gives the relations
F = e AT
s, Q =
Z T
s0 e Aτ BSB T e A
Tτ dτ
AUTOMATIC CONTROL
Discretization 3(15)
Continuous-time model
˙x ( t ) = Ax ( t ) + Bw ( t ) E [ w ( t ) w ( τ ) T ] = Sδ ( t − τ )
Discrete-time model x k + 1 = Fx k + w k
E [ w k w T l ] = Qδ kl
This gives the relations
F = e AT
s, Q =
Z T
s0 e Aτ BSB T e A
Tτ dτ Problem
How do we solve this integral in a numerically good manner
for arbitrary A , B , S and T s ?
Analytical solution - System has only integrators 4(15)
If the system has only integrators, A is nilpotent and e Aτ can be expressed exactly with a finite Taylor series
e Aτ = I + Aτ + · · · + 1
p! A p − 1 τ p − 1 .
Then, the integral has an analytical solution
Q =
Z T
s0 e Aτ BSB T e A
Tτ dτ
=
p − 1 i ∑ = 0
p − 1 j ∑ = 0
T i s + j + 1 i!j! ( i + j + 1 ) A
i S ( A i ) T .
Re Im
Figure : The poles of the system
AUTOMATIC CONTROL
Theorem 5(15)
Theorem - Contribution 1 The solution to the integral
Q =
Z T
s0 e Aτ BSB T e A
Tτ dτ (1) satisfies the Lyapunov equation
AQ + QA T = − BSB T + e AT
sBSB T e A
TT
s(2)
Theorem 5(15)
Theorem - Contribution 1 The solution to the integral
Q =
Z T
s0 e Aτ BSB T e A
Tτ dτ (1) satisfies the Lyapunov equation
AQ + QA T = − BSB T + e AT
sBSB T e A
TT
s(2)
Idea
Solve (2) to find solution for (1).
AUTOMATIC CONTROL
Theorem 5(15)
Theorem - Contribution 1 The solution to the integral
Q =
Z T
s0 e Aτ BSB T e A
Tτ dτ (1) satisfies the Lyapunov equation
AQ + QA T = − BSB T + e AT
sBSB T e A
TT
s(2)
Idea
Solve (2) to find solution for (1).
Lemma Eq. (2) has a unique solution if and only if
λ i ( A ) + λ j ( A ) 6= 0 ∀ i, j
Theorem 5(15)
Theorem - Contribution 1 The solution to the integral
Q =
Z T
s0 e Aτ BSB T e A
Tτ dτ (1) satisfies the Lyapunov equation
AQ + QA T = − BSB T + e AT
sBSB T e A
TT
s(2)
Idea
Solve (2) to find solution for (1).
Lemma Eq. (2) has a unique solution if and only if λ i ( A ) + λ j ( A ) 6= 0 ∀ i, j
Note: This is not fulfilled if the system has integrators!
AUTOMATIC CONTROL
Lyapunov equation - System with only strictly stable
poles 6(15)
If the system has only strictly stable poles, the Lyapunov equation has a unique solution
AQ + QA T = − BSB T + e AT
sBSB T e A
TT
s| {z }
− V
,
which is identical to the solution of the integral
Q =
Z T
s0 e Aτ BSB T e A
Tτ dτ.
Re Im
Figure : The poles of the system
Summary so far 7(15)
Re Im
Q =
p − 1 i ∑ = 0
p − 1 j ∑ = 0
T s i + j + 1 i!j! ( i + j + 1 ) A
i S ( A i ) T
Re Im
AQ + QA T = − V
How do we find Q if we have both integrators and strictly stable poles?
AUTOMATIC CONTROL
Systems with integrators + strictly stable poles 8(15)
Consider a system on the following block triangular form
A =
A 11 A 12 0 A 22
where all integrators are collected in A 22 , i.e.
λ i ( A 11 ) 6= 0 ∀ i λ j ( A 22 ) = 0 ∀ j
Re Im
Figure : The poles of the system
Systems with integrators + strictly stable poles 9(15)
The corresponding Lyapunov equation for this system reads
A 11 A 12 0 A 22
Q 11 Q 12 Q T 12 Q 22
+ Q 11 Q 12 Q T 12 Q 22
A T 11 0 A T 12 A T 22
=− V 11 V 12 V 12 T V 22
,
which gives
A 11 Q 11 + Q 11 A T 11 = − V 11 − A 12 Q T 12 − Q 12 A T 12 , A 11 Q 12 + Q 12 A T 22 = − V 12 − A 12 Q 22 ,
A 22 Q T 12 + Q T 12 A T 11 = − V T 12 − Q 22 A T 12 , A 22 Q 22 + Q 22 A T 22 = − V 22
AUTOMATIC CONTROL
Systems with integrators + strictly stable poles 9(15)
The corresponding Lyapunov equation for this system reads
A 11 A 12 0 A 22
Q 11 Q 12 Q T 12 Q 22
+ Q 11 Q 12 Q T 12 Q 22
A T 11 0 A T 12 A T 22
=− V 11 V 12 V 12 T V 22
,
which gives
A 11 Q 11 + Q 11 A T 11 = − V 11 − A 12 Q T 12 − Q 12 A T 12 , A 11 Q 12 + Q 12 A T 22 = − V 12 − A 12 Q 22 ,
A 22 Q
T12 + Q
T12 A
T11 = − V 12
T− Q 22 A
T12 ,
A 22 Q 22 + Q 22 A T 22 = − V 22
Systems with integrators + strictly stable poles 9(15)
The corresponding Lyapunov equation for this system reads
A 11 A 12 0 A 22
Q 11 Q 12 Q T 12 Q 22
+ Q 11 Q 12 Q T 12 Q 22
A T 11 0 A T 12 A T 22
=− V 11 V 12 V 12 T V 22
,
which gives
A 11 Q 11 + Q 11 A T 11 = − V 11 − A 12 Q T 12 − Q 12 A T 12 , A 11 Q 12 + Q 12 A T 22 = − V 12 − A 12 Q 22 ,
A 22 Q
T12 + Q
T12 A
T11 = − V 12
T− Q 22 A
T12 , A 22 Q 22 + Q 22 A
T22 = − V 22
Proposed solution:
- contribution 2
1. Find Q 22 by using the analytical solution.
2. Find Q 12 by solving a Sylvester equation. 3. Find Q 11 by solving a Lyapunov equation.
AUTOMATIC CONTROL
Systems with integrators + strictly stable poles 9(15)
The corresponding Lyapunov equation for this system reads
A 11 A 12 0 A 22
Q 11 Q 12 Q T 12 Q 22
+ Q 11 Q 12 Q T 12 Q 22
A T 11 0 A T 12 A T 22
=− V 11 V 12 V 12 T V 22
,
which gives
A 11 Q 11 + Q 11 A T 11 = − V 11 − A 12 Q T 12 − Q 12 A T 12 , A 11 Q 12 + Q 12 A T 22 = − V 12 − A 12 Q 22 ,
A 22 Q
T12 + Q
T12 A
T11 = − V 12
T− Q 22 A
T12 , A 22 Q 22 + Q 22 A
T22 = − V 22
Proposed solution:
- contribution 2
1. Find Q 22 by using the analytical solution.
2. Find Q 12 by solving a Sylvester equation.
3. Find Q 11 by solving a Lyapunov equation.
Systems with integrators + strictly stable poles 9(15)
The corresponding Lyapunov equation for this system reads
A 11 A 12 0 A 22
Q 11 Q 12 Q T 12 Q 22
+ Q 11 Q 12 Q T 12 Q 22
A T 11 0 A T 12 A T 22
=− V 11 V 12 V 12 T V 22
,
which gives
A 11 Q 11 + Q 11 A T 11 = − V 11 − A 12 Q T 12 − Q 12 A T 12 , A 11 Q 12 + Q 12 A T 22 = − V 12 − A 12 Q 22 ,
A 22 Q
T12 + Q
T12 A
T11 = − V 12
T− Q 22 A
T12 , A 22 Q 22 + Q 22 A
T22 = − V 22
Proposed solution:
- contribution 2
1. Find Q 22 by using the analytical solution.
2. Find Q 12 by solving a Sylvester equation.
3. Find Q 11 by solving a Lyapunov equation.
AUTOMATIC CONTROL
Systems with integrators + strictly stable poles 9(15)
The corresponding Lyapunov equation for this system reads
A 11 A 12 0 A 22
Q 11 Q 12 Q T 12 Q 22
+
Q 11 Q 12 Q T 12 Q 22
A T 11 0 A T 12 A T 22
=− V 11 V 12 V 12 T V 22
,
which gives
A 11 Q 11 + Q 11 A T 11 = − V 11 − A 12 Q T 12 − Q 12 A T 12 , A 11 Q 12 + Q 12 A T 22 = − V 12 − A 12 Q 22 ,
A 22 Q
T12 + Q
T12 A
T11 = − V 12
T− Q 22 A
T12 , A 22 Q 22 + Q 22 A
T22 = − V 22
Proposed solution:
- contribution 2
1. Find Q 22 by using the analytical solution.
2. Find Q 12 by solving a Sylvester equation.
3. Find Q 11 by solving a Lyapunov equation.
Van Loan’s method (standard method in literature) 10(15) 1. Form the 2n × 2n matrix
H = A BSB
T
0 − A T
.
2. Compute the matrix exponential
e HT
s= M 11 M 12 0 M 22
.
3. Then Q is given as Q = M 12 M T 11 .
Van Loan, C.F. (1978).Computing integrals involving the matrix exponential.
IEEE Transactions on Automatic Control, 23(3), 395-404.
Re Im
Figure : The poles of the system
AUTOMATIC CONTROL
Numerical Evaluation 11(15)
Marginally stable systems with 4 stable poles and 2
integrators are considered.
The 2D region
γ slow , γ fast ∈ [ 10 − 1 , 10 1 ] is divided into 25 × 25 bins.
In total 100 systems are randomly generated for each bin.
Consider the sampling time T s = 1 .
Re Im
γ slow
γ fast
Figure : The poles of the system
Numerical Evaluation - Proposed method 12(15)
10 −1 10 0 10 1 10 −1
10 0 10 1
γ fast
γ slo w
Proposed method
10 −7 10 −6 10 −5
Numer ical error
If γ slow is small, the condition is closer to be violated
λ i ( A 11 ) + λ j ( A 11 ) 6= 0 ∀ i, j
Re Im
γ slow
γ fast
Figure : The poles of the system
AUTOMATIC CONTROL
Numerical Evaluation - Van Loan’s method 13(15)
10 −1 10 0 10 1 10 −1
10 0 10 1
γ fast γ slo w
Van Loan’s method
10 −7 10 −6 10 −5
Numer ical error
If γ fast is large, the matrix exponential is ill-conditioned
exp A BSB T 0 − A T
T s
Re Im
γ slow
γ fast
Figure : The poles of the system
Numerical Evaluation - Comparison 14(15)
10 −1 10 0 10 1 10 −1
10 0 10 1
γ fast
γ slo w
Proposed method
10 −1 10 0 10 1 10 −1
10 0 10 1
γ fast
γ slo w
Van Loan’s method
10 −7 10 −6 10 −5
Numer ical error
The proposed method performs better if the slowest pole is fast.
Van Loan’s method performs better if the fastest pole is slow.
AUTOMATIC CONTROL
Conclusions 15(15)
An algorithm for computing an integral involving the matrix exponential common in optimal sampling has been proposed.
The algorithm is based on a Lyapunov equation and is justified with a novel theorem.
Numerical evaluations showed that the proposed algorithm has
advantageous numerical properties for slow sampling and
fast dynamics in comparison with a standard method in the
literature.
Analytical solution - Example 16(15) Consider a double integrator (two zero eigenvalues of A )
˙x ( t ) = 0 1 0 0
| {z }
A
x ( t ) + 0 1
|{z}
B
w ( t ) , E [ w ( t ) w ( τ )] = γδ ( t − τ ) .
Only zero eigenvalues ⇔ nilpotent, so
e Aτ = I + Aτ = 1 0 0 1
+ 0 1 0 0
τ
Q can be computed analytically
Q =
Z T
s0
e Aτ BSB T e A
Tτ dτ = γ
" T
3 s3 T
2sT
2s2
2 T s
# .
AUTOMATIC CONTROL