06 - Identification
06 - Identification
Identification
Saverio Bolognani
1 / 21
No first principles to select the state
No idea of the dimension of the state
Accurate modeling sometimes suggests a huge state dimensions
Even if we can postulate a Markovian state, we cannot measure it
2 / 21
In fact, state-space representations are not even unique.
3 / 21
Impulse response
t−1
X
yt = CAt x + CAt−1−j Buj
| {z }0
j=0
initial response | {z }
convolution
SISO system
Scalar input ut ∈ R, scalar output yt ∈ R.
Impulse response
yt = CAt−1 B t>0
4 / 21
Markov parameters
The elements in position i, j represent the output i to an unit impulse on the input j.
This sequence of matrices are the Markov parameters of the system.
How can you estimate these parameters? With how many experiments?
ut yt
?
5 / 21
Controllability and Observability
Controllability
x1 = Bu0
x2 = ABu0 + Bu1
therefore to any state in the image of B AB .
...
In n steps, we can drive the system to any state in the image of
C = B AB A2 B . . . An−1 B
6 / 21
A2 B An−1 B
C= B AB ...
If the rank of C is n (full row rank) then any state x̄ ∈ Rn can be reached in n steps.
Remarks
(obvious) You may be able to control the system to any state in less than n
steps
▶ Also with a scalar input?
(non obvious) If you don’t have controllability in n steps, adding additional
steps will not help.
Given a target state x̄, how can you compute the input sequence that drives a
controllable system to x̄?
un−1
u0
this relation can be inverted to compute the input sequence.
In case of non-invertible C, the problem is underdetermined (there are more valid
input sequences). We can find one (the one with smallest norm) by using the
pseudoinverse C ⊤ (CC ⊤ )−1 of the matrix C.
7 / 21
Observability
Consider the problem of detecting the effect of an initial condition x0 in the output
of the system.
At t = 0, the output of the system is
y0 = Cx0
C
CA
2
O = CA
.
.
.
CAn−1
is unobservable.
8 / 21
C
CA If the rank of O is n (full column rank)
2
O = CA then any initial state x0 ∈ Rn is
.
.. observable in the output.
CAn−1
Remarks
(obvious) You may be able to see the effect of x0 on the output in less than n
steps
▶ Also with a scalar output?
(non obvious) If you don’t have observability in n steps, adding additional
steps will not help.
If O is an invertible matrix (which means a scalar input u) then ... = Ox0 and
yn−1
this relation can be inverted to compute the initial state.
In case of non-invertible ′ we can employ the pseudoinverse as before.
9 / 21
Controllable and observable systems
Example: Consider a plant whose output is simply a moving average of the input
10 / 21
We use the state to store a delayed copy of the input:
ut−1
xt = ut−2
ut−3
The controllability
matrix
is C = I and the observability matrix is
a1 a2 a3
O = a2 a3 0 .
a3 0 0
11 / 21
Identification from data
ut yt
?
Suppose that you only have the Markov parameters of the system.
For example: sequence of impulse-response experiments on the real plant.
How to compute A, B, C (realization)?
12 / 21
Hankel matrix
C
CA
2
Hankel matrix H := OC = CA B AB A2 B . . . An−1 B
.
..
CAn−1
CAB CA2 B . . . CAn−1 B
CB
CAB
CA2 B CA3 B . . . CAn B
2 3
= CA B
CA B ... ...
... ...
CAn−1 B ... . . . CA2n−2 B
13 / 21
Ho-Kalman algorithm
Not the Kalman filter!
Step 1: Construct H
14 / 21
Step 2: How do you factorize H in OC?
Interestingly, it does not matter!
How is that possible? Different O and C must return different A, B, C!
Consider the change of basis: Ã = T −1 AT , B̃ = T −1 B, C̃ = CT .
C̃ CT
CTT −1 AT
Õ = C̃Ã = OT
. = ..
.. .
15 / 21
Singular value decomposition
Let H be a m × n matrix of rank r.
H = UΣV ⊤
U is a m × m matrix
V is a n × n matrix
Σ is a “diagonal” m × n matrix
Σ1 0r×n−r ⊤
= U1 Σ1 V1⊤
H= U1 U2 V1 V2
0m−r×r 0m−r×n−r
16 / 21
Extended Hankel matrix
Let us build a Hankel matrix of size k × ℓ, where k and ℓ are larger than n.
G1 G2 ... Gℓ
G2 G3 ... Gℓ+1
Hk,ℓ = G 3 . . .
. . . ...
Gk Gk+1 . . . Gk+ℓ−1
If these are the Markov parameters of an A, B, C system, then Hk,ℓ is the product
between
C
CA
2
2 ℓ−1
Ok =
CA and Cℓ = B AB A B . . . A B
...
CAk−1
17 / 21
SVD of the Hankel matrix
Decompose Hk,ℓ as
1/2 1/2
Hk,ℓ = U1 Σ1 Σ1 V1⊤
| {z } | {z }
Ok Cℓ
to obtain C and B
C
CA
CA2
A2 B Aℓ−1 B
Ok =
and Cℓ = B AB ...
...
CAk−1
18 / 21
How to compute A?
Consider the shifted Hankel matrix
G1 G2 ... Gℓ G2 G3 ... Gℓ+1
G2 G3 ... Gℓ+1 G3 G4 ... Gℓ+2
↑
Hk,ℓ G3
= ...
Hk,ℓ G4
= ...
. . . ... ... ...
Gk Gk+1 ... Gk+ℓ−1 Gk+1 Gk+2 ... Gk+ℓ
C
CA2 B CA3 B
CAB ...
CA2 B CA
↑ CA3 B CA4 B . . .
A2 B
Hk,ℓ = = 2 A B AB ...
CA3 B CA4 B ... CA |
..
{z }
... ... . Cℓ
| {z }
Ok
→ A = Ok† Hk,ℓ
↑
Cℓ†
19 / 21
Kalman-Ho algorithm
20 / 21
Underlying assumptions today
There is no noise
21 / 21
This work is licensed under a
Creative Commons Attribution-ShareAlike 4.0 International License
https://bsaver.io/COCO