Telemark university college. Department of process automation. N-3914 Porsgrunn, Norway. Fax: +47 35 57 52 50. Tel: +47 35 57 51 68. May 22, 2008. Abstract.
Subspace system identification of the Kalman filter: open and closed loop systems Dr. David Di Ruscio Telemark university college Department of process automation N-3914 Porsgrunn, Norway Fax: +47 35 57 52 50 Tel: +47 35 57 51 68 May 22, 2008
Abstract
systems when E is to be estimated. Furthermore, for the innovations model (1) and (2) ek is white with A new, simple and effective algorithm for consis- unit covariance matrix, i.e. E(ek eTk ) = I . tent closed loop subspace system identification is preNote that corresponding to the model (1) and (2) sented. on innovations form we may, if the system is not pure deterministic, define the more common Kalman filter Key words: Identification methods; Subspace meth- on innovations form by defining the innovations as ods; Stochastic systems; Sampled data systems; Lin- εk = F ek and then K = CF −1 is the Kalman filter ear systems. gain. Hence, the kalman filter on innovations form is defined as
1
Introduction
xk+1 yk
System identification is the science of building a mathematical model from known system data. So called subspace system identification methods which developed during the 90’ies by several researchers, see e.g. Katayama (2005), Di Ruscio (2003) and the references therein, are in general not consistent for data collected in closed loop. In this work a new and simple subspace identification method which is consistent and efficient also for closed loop data is presented.
2
= =
Axk + Buk + Kεk , Dxk + Euk + εk ,
(3) (4)
where the innovations process εk have covariance matrix E(εk εTk ) = F F T . The quintuple system matrices (A, B, C, D, E, F ) and the Kalman filter gain K are of appropriate dimensions. The problem addressed in this paper is to determine these matrices from the known data. Both closed and open loop systems are addressed.
3
Problem Formulation
Definitions
Define a parameter, J, representing a horizon of data We will restrict ourselves to linearized or linear state into the past used to remove noise from future data. From the known data form the following Hankel data space dynamic models of the form matrix ¸ · xk+1 = Axk + Buk + Cek , (1) Y0|J (5) Y0|J+1 = yk = Dxk + Euk + F ek , (2) YJ|1 y0 y1 y2 · · · yN −J−1 where a series of input and output data vectors uk y y y · · · yN −J 2 3 and yk ∀ k = 0, 1, . . . , N − 1 are known, and where 1 . . . . . there is possible feedback in the input data. In case of .. .. . . .. = .. ∈ Rim×K ,(6) output feedback the feed through matrix is zero, i.e. yJ−1 yJ yJ+1 · · · yN −2 E = 0. Also for open loop systems the feed through yJ yJ+1 yJ+2 · · · yN −1 matrix may be zero. We will include a structure parameter g = 0 in case of feedback data or for open where K = N − J is the number of columns. Matrix loop systems in which E = 0, and g = 1 for open loop Y0|J is defined as the J first block rows of Y0|J+1 and 1
matrix YJ|1 as the last block row in (6). Matrices In order to find the system order, n, and the rest of U0|J , UJ|1 , EJ|1 and XJ|1 are defined similarly. These the model matrices, e.g. (A, B, K, D), we simply have matrices are to be used in the next section in order to to solve a deterministic subspace system identification filter the data and directly to compute the innovations problem process εk = F ek ∀ k = J, J + 1, . . . , N − 1. · ¸ £ ¤ uk xk+1 = Axk + B K (13) εk
4
A new subspace identification method for closed and open loop system identification
yk − εk
= Dxk
(14)
where not only the input and output data, uk and yk are known, but also the innovations, εk , are known. First we will discuss the case with no feed through Hence, the data term in the output equation, i.e., E = 0 in (2), and uk the closed loop subspace identification. From (1) we ε ∀ k = J, J + 1, . . . , N − 1 (15) k have yk − εk YJ|1 = DXJ|1 + F EJ|1 . (7) are known, and the model matrices (A, B, K, D) may From the Kalman filter version of the innovations be computed in an optimal least squares sense. This model (1) and (2) we have that the future states, XJ|1 , results in a very simple an efficient algorithm for are a function of the past data, i.e. closed loop subspace system identification. · ¸ £ d ¤ The above algorithm may be modified in order to U0|J XJ|1 = C˜J C˜Js + (A − KD)J X0|1 , (8) work also for open loop systems. For open loop sysY0|J tems we usually have a direct feed through term in where matrices C˜Jd and C˜Js are the reversed ex- the output equation, i.e., E 6= 0 and with an output tended controllability matrices of the matrix pairs equation yk = Dxk + Euk + F ek . Hence, (A − KD, B − KE) and (A − KD, K), respectively. Hence, for large J or as J → ∞ we have that YJ|1 = DXJ|1 + EUJ|1 + F EJ|1 (16) · ¸ U0|J XJ|1 / = XJ|1 . (9) and the innovations and signal parts may be comY0|J puted similarly as above, i.e., The past data matrices, U0|J and Y0|J , are uncorre UJ|1 lated with the future innovations sequence, EJ|1 . This s ZJ|1 = F EJ|1 = YJ|1 − YJ|1 / U0|J (17) is true for both closed and open loop systems. Hence, Y0|J the innovations sequence is simply identified as · ¸ U0|J s def = F EJ|1 = YJ|1 − YJ|1 / ZJ|1 (10) and Y0|J UJ|1 and d (18) ZJ|1 = DXJ + EUJ|1 = YJ|1 / U0|J . £ ¤ s m×(N −J) Y0|J F EJ|1 = εJ εJ+1 · · · εN −1 = ZJ|1 ∈ R . (11) Note that the F matrix, which is the square root of the innovations covariance matrix of the innovations εk , may be computed through a QR decomposition of s the sequence ZJ|1 . Similarly, the signal part, or the optimal predictions of the outputs, Y¯J|1 = DXJ|1 , are identified as ¸ · U0|J d def (12) ZJ|1 = DXJ|1 = YJ|1 / Y0|J
d The separation of the data into the signal part ZJ|1 s and the innovations part ZJ|1 may be effectively computed through an LQ or QR decomposition of the matrix · ¸· ¸ ¸ · R11 0 Q1 U0|J+g (19) = R21 R22 Q2 Y0|J+1
where g = 0 for closed loop systems and systems with no direct feed through term in the output equation. Hence, we have
and DXJ|1
= = =
YJ|1 − F EJ|1 £ ¤ yJ − εJ yJ+1 − εJ+1 · · · yN −1 − εN −1 £ ¤ d DxJ DxJ+1 · · · DxN −1 = ZJ|1 ∈ Rm×(N −J) . 2
d ZJ|1 = R21 Q1 s ZJ|1 = R22 Q2
(20) (21)
5
Numerical Example
B parameter DSR
B parameter MOESP
0.54
0.6
0.52
0.5
0.5
0.4
(22) (23)
0.48
0.3
0.46
0.2
0.44
0.1
with ek white noise with unit variance. The controller is taken as
0.42
Consider the following system xk+1 yk
= =
0.9xk + 0.5uk + 0.6ek xk + ek
uk = 0.6(rk − yk ),
0.4
(25)
A Monte carlo simulation study is performed with N = 2000 data points and M = 100 different noise realizations ek . The results are illustrated in Figures 1 and 2. As we can see, both DSR e and PEM gives consistent results. It shows also that the subspace method, DSR e, is as efficient that PEM is. The DSR function results in a smaller bias than MOESP. The parameters L = 1 and J = 6 was used for the DSR e function. Parameters L = 2 and J = 6 for DSR and i = L + 1 = 3 for MOESP. The DSR e function is implemented along the lines in Section 5. The DSR algorithm gives usually less bias than MOESP for closed loop data, se Figures 1 and 2. It is very interesting that the DSR e algorithm gives parameter estimates which are as optimal as the corresponding PEM estimates. Eigenvalues: DSR
0
0
−0.5
0
0.2
0.4
0.6
0.8
1
−0.5
0
0.2
Eigenvalues: DSRe 0.5
0
0
0
0.2
0.4
0.6
0.8
0.6
0.8
1
−0.5
0
0.2
0.4
0.6
0.8
100
−0.1
0
20
40
60
80
100
80
100
B parameter PEM 0.65
0.6
0.6 0.55
0.5
0.5
0.45
0.45
0
20
40 60 Realizations
80
100
0.4
0
20
40 60 Realizations
sented.
References Di Ruscio, D. (2003). Subspace system identification of the Kalman filter. Modeling, Identification and Control. Vol24, No.3, pp. 125-157. Katayama, T. (2005). Subspace Methods for System Identification. Springer.
1
1
Figure 1: The pole estimates from the closed loop data as described in Example 5 with reference signal rk = sin(k) + sin(0.5k).
6
80
Figure 2: The estimates of the B parameter from the closed loop data as described in Example 5 with reference signal rk = sin(k) + sin(0.5k).
Eigenvalues: PEM
0.5
−0.5
0.4
60
0.55
0.4
Eigenvalues: MOESP 0.5
40
0.65
and a deterministic reference signal
0.5
20
B parameter DSRe
(24)
rk = sin(0.5k) + sin(k).
0 0
Conclusion
A new algorithm for consistent and efficient closed and open loop subspace system identification is pre3