0% found this document useful (0 votes)
74 views

Lecture5 PDF

We see that the outputs trace out a linear subspace of dimension equal to the system order n. This subspace contains all the information about the system matrices A and C.

Uploaded by

Serkan Sezin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
74 views

Lecture5 PDF

We see that the outputs trace out a linear subspace of dimension equal to the system order n. This subspace contains all the information about the system matrices A and C.

Uploaded by

Serkan Sezin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 51

Filtering and Identification

Lecture 5:
Subspace Identification
The Deterministic case

Michel Verhaegen and Jan-Willem van Wingerden


1/31

Delft Center for Systems and Control


Delft University of Technology
Overview
• Recap course outline
• Recap “classical” system identification
• A different approach: Subspace Identification
• A deterministic Identification problem
• Subspace Identification of an autonomous
system
• Subspace Identification with inputs

2/31

Delft Center for Systems and Control


Recap “goal” of the course
• Estimate linear static models from data:

min ky − F xk2W
x

Relevant and to introduce the numerical fundaments of this course!


• Estimate the state of an LTI state space model:

x(k + 1) = Ax(k) + Bu(k) + Ke(k) e(k) ∼ (0, Re )


y(k) = Cx(k) + Du(k) + e(k)

given the model (A, B, C, D) and K and input-output data.


• “Identify” state space model matrices (A, B, C, D, K) from
input-output data {u(k), y(k)}N
k=1 .

3/31

Delft Center for Systems and Control


Recap “goal” of the course
• Estimate linear static models from data:

min ky − F xk2W
x

Relevant and to introduce the numerical fundaments of this course!


• Estimate the state of an LTI state space model:

x(k + 1) = Ax(k) + Bu(k) + Ke(k) e(k) ∼ (0, Re )


y(k) = Cx(k) + Du(k) + e(k)

given the model (A, B, C, D) and K and input-output data.


• “Identify” state space model matrices (A, B, C, D, K) from
input-output data {u(k), y(k)}N
k=1 .

4/31

Delft Center for Systems and Control


Overview
• Recap course outline
• Recap “classical” system identification
• A different approach: Subspace Identification
• A deterministic Identification problem
• Subspace Identification of an autonomous
system
• Subspace Identification with inputs

5/31

Delft Center for Systems and Control


Recap “Classical” (PEM) Identification methods
w(k)
SGM v(k)
u(k) y(k)

+ ǫ(k, θ)

A(θ) B(θ) K(θ)
C(θ)D(θ) ŷ(k, θ)

\
1. Assume SGM(θ)
2. Derive the “optimal” predictor for
ŷ(k, θ).
3. Find the “best” estimate
θ̂N = argminJN (θ) with
1 X
N
with JN (θ) = ky(k) − ŷ(k, θ)k22
N k=1

6/31

Delft Center for Systems and Control


Recap “Classical” (PEM) Identification methods
w(k)
SGM v(k)
Challenges:
u(k) y(k) 1. You need to fix the order of the SS
model a priori!
+ ǫ(k, θ)
− 2. (MIMO) parametrization is a diffi-
A(θ) B(θ) K(θ) cult?
C(θ)D(θ) ŷ(k, θ)
3. non-convex optimization
100
\
1. Assume SGM(θ) 90 53.1 %

2. Derive the “optimal” predictor for 80

70
ŷ(k, θ). 60

3. Find the “best” estimate 50

40
θ̂N = argminJN (θ) with
30

1 X
N 20

with JN (θ) = ky(k) − ŷ(k, θ)k22 10


N k=1 0
0 20 40 60 80 100

6/31

Delft Center for Systems and Control


Example: Spatial Discretization of vibrating membrame

Approximationvia “multiple” mass-spring-damper


  systems:

0 I 0
ẋ(t) =   x(t) +   u(t)
−M −1 B −M −1 K −M −1

7/31

Delft Center for Systems and Control


Example: Spatial Discretization of vibrating membrame

Approximationvia “multiple” mass-spring-damper


  systems:

0 I 0
ẋ(t) =   x(t) +   u(t)
−M −1 B −M −1 K −M −1

Multiple key problems:


1. Number of mass-spring-damper segments?
2. Parametrization of the “mass”, “stiffness” and “damping”
matrices. Following “The Timoshenko”, “The
Bernoulli-Euler”, etc. beam theories?

7/31

Delft Center for Systems and Control


Overview
• Recap course outline
• Recap “classical” system identification
• A different approach: Subspace Identification
• A deterministic Identification problem
• Subspace Identification of an autonomous
system
• Subspace Identification with inputs

8/31

Delft Center for Systems and Control


Deterministic Identification problem

SGM:
(
x(k + 1) = Ax(k) + Bu(k)
x(k) ∈ Rn
y(k) = Cx(k) + Du(k)

Determine n AND the system matrices A, B, C, and D from a


finite number of measurements of u(k) and y(k) without
parametrizing the system matrices, etc.

9/31

Delft Center for Systems and Control


Deterministic Identification problem

SGM:
(
x(k + 1) = Ax(k) + Bu(k)
x(k) ∈ Rn
y(k) = Cx(k) + Du(k)

Determine n AND the system matrices A, B, C, and D from a


finite number of measurements of u(k) and y(k) without
parametrizing the system matrices, etc.

In general no unique solution!

9/31

Delft Center for Systems and Control


Overview
• Recap “classical” system identification
• A different approach: Subspace Identification
• A deterministic Identification problem
• Subspace Identification of an
autonomous system
• Subspace Identification with inputs

10/31

Delft Center for Systems and Control


Identification of an autonomous system

SGM: Autonomous system


(
x(k + 1) = Ax(k)
x(k) ∈ Rn
y(k) = Cx(k)

Output: y(j) = CAj x(0) j =0:s−1

11/31

Delft Center for Systems and Control


SIDemo.m
For a second order system (n = 2), we display:
     
y(0) y(1) y(2)
     
y(1) y(2) y(3)
y(2) y(3) y(4)

in R3 . What do we see?

12/31

Delft Center for Systems and Control


Identification of an autonomous system
SGM: Autonomous system
(
x(k + 1) = Ax(k)
x(k) ∈ Rn
y(k) = Cx(k)

Output: y(k + j) = CAj x(k) j =0:s−1


   
y(k) C
   
   
 y(k + 1)   CA 
   

y(k + 2)
 
= CA2 x(k) = O x(k)
    s
   
 ..   .. 
 .   . 
   
y(k + s − 1) CAs−1

13/31

Delft Center for Systems and Control


SubidPlot.m
For the 2nd order system:
" #
0.9 0
x(k + 1) = x(k)
−0.5 0.7
h i
y(k) = 1 −1 x(k)
 
y(k)
 
we plot the vector y(k + 1) for k = 1 : 10 in R3 .
y(k + 2)
What do we see?
14/31

Delft Center for Systems and Control


Revealing information
We take y(k) ∈ R, n = 2, s = 3.
 
y(k)
 
y(k + 1) = Os x(k)
y(k + 2)

Plot for k = 0, 1, 2, . . .

15/31

Delft Center for Systems and Control


Revealing information
We take y(k) ∈ R, n = 2, s = 3.
 
y(k)
 
y(k + 1) = Os x(k)
y(k + 2)

Plot for k = 0, 1, 2, . . .
   
y(0) y(1) · · · y(N − 2) C
   h i
y(1) y(2) · · ·
 y(N − 1) =
 
 CA  x(0) x(1) · · · x(N − 2)

y(2) y(3) · · · y(N ) CA2
15/31

Delft Center for Systems and Control


Data equation: 2nd-order example
   
y(0) y(1) · · · y(N − 2) C
   h i
y(1) y(2) · · · y(N − 1) =  CA  x(0) x(1) · · · x(N − 2)
   
2
| {z }
y(2) y(3) · · · y(N ) CA X0,N −1
| {z } | {z }
Y0,3,N −1 O3

Use Sylvester’s inequality


 
rank(O3 )+rank(X0,N −1 )−2 ≤ rank(Y0,3,N −1 ) ≤ min rank(O3 ), rank(X0,N −1 )

16/31

Delft Center for Systems and Control


Data equation: 2nd-order example
   
y(0) y(1) · · · y(N − 2) C
   h i
y(1) y(2) · · · y(N − 1) =  CA  x(0) x(1) · · · x(N − 2)
   
2
| {z }
y(2) y(3) · · · y(N ) CA X0,N −1
| {z } | {z }
Y0,3,N −1 O3

Use Sylvester’s inequality


 
rank(O3 )+rank(X0,N −1 )−2 ≤ rank(Y0,3,N −1 ) ≤ min rank(O3 ), rank(X0,N −1 )

If (A, C) is observable and (A, x(0)) is controllable:

rank(Y0,3,N −1 ) = 2 = n
16/31

Delft Center for Systems and Control


SubidPlot.m
Let the SVD of the matrix Y0,3,N −1 be given as:
" #
h i Σ 0 h i
⊥ 2
Y0,3,N −1 = U2 U2 (V2 )T (V2⊥ )T
0 0

with Σ2 ∈ R2×2 and rank(Σ2 ) = 2.


Illustration of the column space equivalence
between U2 and O3 .
Open File: SubidPlot.m and inspect the final 2
lines! minT kO3 − U2 T k2F

17/31

Delft Center for Systems and Control


Compute the matrices A and C
   
CT CT
   

 CT T −1 AT   
 CT AT 

Un = Os T =  ..  =  . 
 .   .. 
   
s−1
−1
CT (T AT ) CT ATs−1

18/31

Delft Center for Systems and Control


Compute the matrices A and C
   
CT CT
   

 CT T −1 AT   
 CT AT 

Un = Os T =  ..  =  . 
 .   .. 
   
s−1
−1
CT (T AT ) CT ATs−1

We can determine A and C up to an unknown


similarity transformation T .

18/31

Delft Center for Systems and Control


Compute the matrices A and C
   
CT CT
   

 CT T −1 AT   
 CT AT 

Un = Os T =  ..  =  . 
 .   .. 
   
s−1
−1
CT (T AT ) CT ATs−1

We can determine A and C up to an unknown


similarity transformation T .

CT equals the first ℓ rows of Un : CT = Un (1 : ℓ, :)


AT is computed by solving:
Un (1 : (s − 1)ℓ, :)AT = Un (ℓ + 1 : sℓ, :)
18/31

Delft Center for Systems and Control


Zoom in: Computation of the A matrix
 
As Un is equal to, CT
 
 CT AT 
 
Un =  . 
 .. 
 
CT ATs−1

Therefore, we can find AT by,


   
CT CT AT
   
 CT AT   CT A2 
   T 
Un (1 : (s−1)ℓ, :)AT =  .  AT =  .  = Un (ℓ+1 : sℓ, :)
 ..   .. 
   
CT ATs−2 CT ATs−1
19/31

Delft Center for Systems and Control


A systematic Approach
• Step
 1:Data stacking into Hankel matrices
Y0,s,N .

20/31

Delft Center for Systems and Control


A systematic Approach
• Step
 1:Data stacking into Hankel matrices
Y0,s,N .
• Step 2: The Data Equation relating these
Hankel
 matrices 
to the state space matrices.
Y0,s,N = Os X0,N .

20/31

Delft Center for Systems and Control


A systematic Approach
• Step
 1:Data stacking into Hankel matrices
Y0,s,N .
• Step 2: The Data Equation relating these
Hankel
 matrices 
to the state space matrices.
Y0,s,N = Os X0,N .
• Step 3: Retrieving the column space of Os .

20/31

Delft Center for Systems and Control


A systematic Approach
• Step
 1:Data stacking into Hankel matrices
Y0,s,N .
• Step 2: The Data Equation relating these
Hankel
 matrices 
to the state space matrices.
Y0,s,N = Os X0,N .
• Step 3: Retrieving the column space of Os .
• Step 4: Calculating the system matrices
(AT , CT )

20/31

Delft Center for Systems and Control


Overview
• Recap “classical” system identification
• A different approach: Subspace Identification
• A deterministic Identification problem
• Subspace Identification of an autonomous
system
• Subspace Identification with inputs

21/31

Delft Center for Systems and Control


Identification with inputs
(
x(k + 1) = Ax(k) + Bu(k)
SGM
y(k) = Cx(k) + Du(k)

22/31

Delft Center for Systems and Control


Identification with inputs
(
x(k + 1) = Ax(k) + Bu(k)
SGM
y(k) = Cx(k) + Du(k)

x(1) = Ax(0) + Bu(0)


x(2) = Ax(1) + Bu(1)
= A2 x(0) + ABu(0) + Bu(1)
x(3) = A3 x(0) + A2 Bu(0) + ABu(1) + Bu(2)

22/31

Delft Center for Systems and Control


Identification with inputs
(
x(k + 1) = Ax(k) + Bu(k)
SGM
y(k) = Cx(k) + Du(k)

x(1) = Ax(0) + Bu(0)


x(2) = Ax(1) + Bu(1)
= A2 x(0) + ABu(0) + Bu(1)
x(3) = A3 x(0) + A2 Bu(0) + ABu(1) + Bu(2)
k−1
X
State at time k: x(k) = Ak x(0) + Ak−i−1 Bu(i)
i=0
22/31

Delft Center for Systems and Control


Data equation with inputs
Output at time k:
k−1
X
y(k) = CAk x(0) + CAk−i−1 Bu(i) + Du(k)
i=0
      
y(0) C D 0 0 ··· 0 u(0)
      
      
 y(1)   CA   CB D 0 · · · 0  u(1) 
      
   2    
 y(2)  =  CA x(0)+ CAB CB D 0  u(2) 
      
 ..   ..   .. .. .. .
 . 
 .   .   . . .  . 
      
y(s − 1) CAs−1 CAs−2 B CAs−3 B · · · CB D u(s − 1)
| {z } | {z }
Os Ts
23/31

Delft Center for Systems and Control


Data equation with inputs
Output at time k:
k−1
X
y(k) = CAk−j x(j) + CAk−i−1 Bu(i) + Du(k)
i=j
      
y(1) C D 0 0 · · · 0 u(1)
      
      
y(2)  CA   CB D 0 · · · 0 u(2)
      
   2    
y(3) =  CA x(1) +  CAB CB D 0 u(3)
      
 ..   ..   .. .. .. .
 . 
 .   .   . . .  . 
      
y(s) CAs−1 CAs−2 B CAs−3 B · · · CB D u(s)
| {z } | {z }
Os Ts
24/31

Delft Center for Systems and Control


Data equation with inputs
Output at time k:
k−1
X
y(k) = CAk−j x(j) + CAk−i−1 Bu(i) + Du(k)
i=j
     
y(k) C D 0 0 ··· 0 u(k
     
     
 y(k + 1)   CA   CB D 0 · · · 0  u(k +
     
   2   
 y(k + 2)  =  CA x(k)+ CAB CB D 0  u(k +
     
 ..   ..   .. .. ..  ..
 .   .   . . .  .
     
y(k + s − 1) CAs−1 CAs−2 B CAs−3 B · · · CB D u(k + s
| {z } | {z }
Os Ts
25/31

Delft Center for Systems and Control


Data equation with inputs
Data equation Y0,s,N = Os X0,N + Ts U0,s,N

26/31

Delft Center for Systems and Control


Data equation with inputs
Data equation Y0,s,N = Os X0,N + Ts U0,s,N

Step 3 of the Strategy:


How to estimate the column space of Os ?

26/31

Delft Center for Systems and Control


Data equation with inputs
Data equation Y0,s,N = Os X0,N + Ts U0,s,N

Step 3 of the Strategy:


How to estimate the column space of Os ?
Step 4 of the Strategy: Estimate the system
matrices?
• Determine A and C (up to a similarity
transformation) from the column space of Os .
• Given A and C determine B and D from the
input and output measurements.
26/31

Delft Center for Systems and Control


Removing U0,s,N from Y0,s,N = Os X0,N + Ts U0,s,N

27/31

Delft Center for Systems and Control


Removing U0,s,N from Y0,s,N = Os X0,N + Ts U0,s,N

Can we transform the data equation, i.e. can we


find a matrix (of appropriate dimensions) Π such
that:
Y0,s,N Π = Os X0,N Π + Ts U0,s,N Π
is “transformed” into
Y0,s,N Π = Os X0,N Π

27/31

Delft Center for Systems and Control


Removing U0,s,N from Y0,s,N = Os X0,N + Ts U0,s,N

Can we transform the data equation, i.e. can we


find a matrix (of appropriate dimensions) Π such
that:
Y0,s,N Π = Os X0,N Π + Ts U0,s,N Π
is “transformed” into
Y0,s,N Π = Os X0,N Π
Example Matlab: U = randn(2,5);
Pu = (eye(5) - U’*inv(U*U’)*U);
U Pu? What is Pu - Pu’?

27/31

Delft Center for Systems and Control


Removing U0,s,N from Y0,s,N = Os X0,N + Ts U0,s,N

28/31

Delft Center for Systems and Control


Removing U0,s,N from Y0,s,N = Os X0,N + Ts U0,s,N
Let Π⊥ U0,s,N be the Projection matrix onto the
orthogonal complement of the row space of
U0,s,N . This matrix is given as:
 
Π⊥
U0,s,N = I N −U T
0,s,N (U U T
0,s,N 0,s,N ) −1
U 0,s,N ∈ R N ×N

Then: U0,s,N Π⊥
U0,s,N = 0.

28/31

Delft Center for Systems and Control


Removing U0,s,N from Y0,s,N = Os X0,N + Ts U0,s,N
Let Π⊥ U0,s,N be the Projection matrix onto the
orthogonal complement of the row space of
U0,s,N . This matrix is given as:
 
Π⊥
U0,s,N = I N −U T
0,s,N (U U T
0,s,N 0,s,N ) −1
U 0,s,N ∈ R N ×N

Then: U0,s,N Π⊥
U0,s,N = 0.

⊥ ⊥
Y0,s,N ΠU0,s,N = (Os X0,N + Ts U0,s,N ) ΠU0,s,N
= Os X0,N Π⊥
U0,s,N

28/31

Delft Center for Systems and Control


Dealing with inputs
Y0,s,N Π⊥
U0,s,N = O X Π ⊥
s 0,N U0,s,N

range(Y0,s,N Π⊥
U0,s,N ) ⊆ range(Os )

29/31

Delft Center for Systems and Control


Dealing with inputs
Y0,s,N Π⊥
U0,s,N = O X Π ⊥
s 0,N U0,s,N

range(Y0,s,N Π⊥
U0,s,N ) ⊆ range(Os )

Lemma:  
X0,N
If u(k) is such that rank   = n + sm
U0,s,N
 
and (A, C) observable ⇒ rank Y0,s,N Π⊥
U0,s,N = n

range(Y0,s,N Π⊥
U0,s,N ) = range(Os ) ⇒ AT , CT

29/31

Delft Center for Systems and Control


Determine B and D
k−1
X
y(k) = CT AkT x(0) + CT Ak−i−1
T BT u(i) + DT u(k)
i=0

Given AT and CT , the output depends affinely on BT , DT and x(0).

30/31

Delft Center for Systems and Control


Determine B and D
k−1
X
y(k) = CT AkT x(0) + CT Ak−i−1
T BT u(i) + DT u(k)
i=0

Given AT and CT , the output depends affinely on BT , DT and x(0).


Using property (§2.3) vec(XY Z) = (Z T ⊗ X)vec(Y ) ,

k−1
X
y(k) = CT AkT x(0) + (u(i)T ⊗ CT Ak−i−1
T ) vec(B T ) + (u(k) T
⊗ I)vec(D
i=0
h iT
= F (k, AT , CT )θ θ = x(0)T vec(BT )T vec(DT )T

Find θ by solving a Linear least squares problem!


N −1
1 X
min ||y(k) − F (k, AT , CT )T θ||2
θ N
k=0
30/31

Delft Center for Systems and Control


Preparation and next lecture
Preparation:
Study Chapter 9 (9.1-9.2)
Download Homework 4 and Matlab Session 1

Next lecture:
Lecture 6: Subspace Identification Step Inputs and Ambient
Excitation
Keep your eyes focussed on “Guide-
lines/Rules/Schedule sc4040: 2016-2017” for the
correct deadlines!

31/31

Delft Center for Systems and Control

You might also like