Predicting demand of natural gas: a system identification approach
Master research project Applied Mathematics
March 2013
Student: R.R.A Prins
First advisor: Prof. Dr. M.K. Camlibel
Abstract
In this thesis we construct a linear discrete-time time-invariant input/state/output sys-
tem in order to predict the demand of natural gas based on the available data. A Python
program is written to create this model based on the known input and output. Further-
more a methodology is established to give the best parameters of the system which lead
to the best predictions.
Acknowledgements
I would like to thank GasTerra B.V. for giving me the opportunity to do my final years project at their company. Furthermore I thank the coworkers at GasTerra B.V. for helping me during the process. I would like to especially than H. Kremer for providing an interesting research, L.M.H. Haveman and S. Douma for their guidance and moral support.
At the university I would like to thank Prof.dr. J. Top for accepting the role as second supervisor. Last but definitely not least I would like to give special thanks to Prof. dr.
M.K. Camlibel for supervising me in this for us both unknown field of research, and for his guidance and support along the way.
Of course I am also grateful for all the support given by friends, family and fellow students, in especially S. Baars for helping me with understanding Python.
Thank you all.
List of Tables
1.1 List of connections to Germany . . . . 2
1.2 List of factors . . . . 3
1.3 Used factors . . . . 3
2.1 Input data . . . . 10
2.2 Output data . . . . 10
3.1 Results for hour-ahead . . . . 20
3.2 Results for 12-hours ahead . . . . 20
3.3 Results for day-ahead . . . . 21
3.4 Results for week-ahead . . . . 21
List of Figures
2.1 n = 17, N = 2500, p = 31, i = 2530 . . . . 18
3.1 Reinitializing . . . . 23
3.2 4,5 years of data . . . . 24
Contents
1 Introduction 1
1.1 GasTerra B.V. . . . . 1
1.2 This research . . . . 1
1.3 Existing methods . . . . 2
1.4 Choosing the model . . . . 3
2 The model 5 2.1 Discrete-time dynamical linear models . . . . 5
2.2 System identification . . . . 7
2.2.1 Preliminaries . . . . 7
2.3 Predicting gas demand . . . . 16
3 Using the model 19 3.1 Reinitialization . . . . 19
3.2 Parameter analysis . . . . 19
4 Conclusions and future work 25 A Python programs 28 A.1 Data processing . . . . 28
A.1.1 Creating the input . . . . 28
A.1.2 Creating the output . . . . 37
A.1.3 Creating input and output . . . . 38
A.2 Estimating the system matrices . . . . 41
A.3 Running the system . . . . 46
A.4 Data analyzis . . . . 47
A.5 Plotting and reinitialization . . . . 49
A.6 Optimizing p,N,n . . . . 54
Chapter 1
Introduction
This master thesis is the result of a research worth 50 European Credits done at GasTerra B.V. in association with the University of Groningen concerns research on the prediction of demand of natural gas.
1.1 GasTerra B.V.
GasTerra B.V. is an international company trading in natural gas. It operates on the European energy market and accounts for a significant share of the Dutch gas supply.
The company also provides services related to gas trading. The company has a strong purchasing position and almost fifty years of experience in natural gas procurement and sales [4].
At GasTerra B.V. there is a need to predict the demand of natural gas, based on fore- casting they can make decisions important to insure their position in the gas market.
The methods used at this moment are based on stationary models, which do not change in response to the alternating environment. Their interest lays at constructing a model which can learn from new information and adjust itself in such a way that it captures the change in response to changing environment.
1.2 This research
Based on the need of GasTerra B.V. we want to construct a model which learns from
the changing environment and predicts the demand of gas. The focus of the thesis will
be on the export to Germany. Table 1.1 shows the connections for pipelines between the
Netherlands and Germany. The connection Zevenaar/Winterswijk will be considered in
this work. This connection is together with Oude StatenZijl (OSZ) the biggest connection
to Germany. Zevenaar/Winterswijk delivers only L-gas, OSZ on the other hand delivers
both L-gas and G-gas. Tegelen also delivers to to the same distributer in Germany, but
in comparison to Zevenaar/Winterswijk this is a really small quantity, therefore it is
not considered in this thesis. Hence we focus on the total amount of natural gas which
Oude Statenzijl (OSZ) Winterswijk
Zevenaar Tegelen Bocholtz
Table 1.1: List of connections to Germany
flows through Zevenaar/Winterswijk. The aim of this work is to create a dynamic model which can predict the demand of natural gas and adjusts itself in case of changes in the behavior of the system.
The rest of the chapter will proceed as follows. First we will give a summary of the already existing methods in Section 1.3. In Section 1.4 the proposed model will be introduced.
1.3 Existing methods
In [3],the authors proposed a model for the demand of gas for household use in four states of the United States of America, first by using only physical factors and second by also implementing economical factors. It turns out that for the four states the model is differently accurate. Furthermore, the influence of economical factors was in some cases insignificant and in other cases significant but not of big influence in comparison to the physical factors. One can conclude from this that physical factors are the leading influence on the demand of natural gas and economical factors might be of influence (but of smaller influence then physical factors). H.G. Berrisford [2] stated that using predetermined seasonal pattern would cause less power to predict. He only uses the direct past history of the temperature by means of an exponentially weighted average.
In [1], P. Balestra and M. Nerlove propose a dynamical model, for the estimation of the parameters they use the least squares and maximum likelihood method, both methods of estimation result in weak predictions. In [17], Siemek et al. employ a Hubert model which is based on a decay method. This method works too slow to be able to deal with hourly data. It is used to estimate an overall demand of natural gas of a specific country, so not specifically for a company, or for a certain client. Liu and Lin [12] forecast household use of natural gas by using monthly and quarterly time series. They found that using quarterly data was less time-consuming, but not necessarily more accurate in comparison to monthly data. Furthermore, they state that using monthly data has the tendency to over-parametrize the system. In [18], the authors model the demand of gas in Bangladesh. Their model gives a lower bound and does not estimate the actual amount.
Many other models exist for predicting the demand of gas. Most of these models are
stationary. Almost all papers estimate the demand of household use, and are not aiming
to estimate the amount of gas for a specific company. In this thesis, we will propose a
dynamical model in order to predict the demand of natural gas for a specific company.
1.4 Choosing the model
In [13], Ljung mentions that the construction of a model involves three basic entities:
1. A data set.
2. A set of candidate models
3. A rule by which the candidate models can be assessed using the data.
This can be used as a guide to decide which kind of model one should use. We start with constructing a data set. The list of factors in Table 1.2 consists of factors which might be of interest. Among these possible factors, we focus n physical parameters suggested by the experts of GasTerra B.V.. The output will be the physical flow.
Temperature Price of gas Day
Hours sun Wind Price other energy carriers
CO
2Price Spark spread Storage
Unemployment rate Consumer trust Einkaufsmanagers index
Transportation costs rainfall Time
Table 1.2: List of factors
Spark spread shows a balance between the price of gas and the price of coal included the CO
2price. CO
2Price represents the costs a company has to pay for the CO
2created by for instance burning coal. Einkaufsmanagers index is an index which stands for the development of the economy of Germany.
For data concerning weather we will retrieve our information from the Koninklijk Ned- erlands Meteorologisch Instituut (KNMI) [9]. For the data concerning gas flows we will retrieve information from the Gasunie Transport Services (GTS) [16]. In the rest of the thesis we will use the factors given in Table 1.3.
Direction of the wind Speed of the wind Temperature Sunshine duration Solar radiation Duration of rainfall Amount of rainfall Air pressure Overcast
Table 1.3: Used factors
The direction of the wind (in degrees) represents the average of the last 10 minutes of the past hour. Speed of the wind (in m/s) is the hourly average. Temperature (in degrees Celsius) is measured 1.50 meter above sea level and represents the temperature at that moment. Sunshine duration (in hours) is the duration of sunshine in an hour.
Solar radiation (in J/cm
2) represents the strength of the sun. The duration of rainfall (in hours) is the duration of rainfall during the hour. The amount of rainfall (in mm) is the total amount of rainfall in an hour. Air pressure is given in hPa. Overcast is a number which represents the cloudiness.
In this thesis, we will construct a discrete-time dynamical model based on the factors
given in Table 1.3. One of the advantages working with the model class we have chosen is the case of including new factors and/or discarding existing ones.
The class of discrete dynamical linear models can be divided into time-invariant and time-varying models. The demand of gas is most likely time-varying, since the same conditions in the winter might lead to another result than the same conditions in the summer. However, dealing with time-varying models is not always preferable due to the heavy computations required by such models. In this thesis, we will employ the-invariant models and try to capture the time dependency of the model by creating new models over time. The findings of this thesis can be taken as a starting point for further research on modeling the gas demand by time-varying systems. We will discuss the details of the model we propose in Section 2.1. Before dealing with the mathematical details, we first discuss various existing methodologies in what follows.
In [6], the authors investigate how a linear input/state/output system can be constructed from given input/output data. Their method uses the so-called information matrix along with its Toeplitz matrix structure. The information matrix contains the given input/out- put data. By using the information matrix as well as its shifted versions, they construct the matrices that determine a linear input/state/output system. In [19], Wang and Qin proposed a subspace identification method that is based on principal component analy- sis (PCA) which gives consistent estimates in the error-in-variables (EIV) formulation.
Lacy and Bernstein presented a constraint optimization method to ensure asymptotic stability of the identified model in the context of subspace identification in [11]. Several other papers investigated how to estimate the system matrices in the presence of noise, e.g. [5] and [15]. Katayama and Tanaka [8] also use the noise term, they estimate the matrices using an LQ-decomposition which can be used to create the orthogonal and oblique projections of parts of the information matrices. The paper [10] exploits the information and its Toeplitz structure in the presence of noise. In [7] adaptive Iterative learning control (ILC) has been employed. They first estimate the matrices, in what- ever way one might prefer, and then they keep reshaping the system matrices by use of ILC. Merc` ere and Bako [14] revise the problem of determining a canonical state-space representation for multi-variable systems. They first estimate the system matrices and finally put them in canonical representation.
Most of the methods mentioned in the papers are using an information matrix and do basically the same as Juang did in [6], even the papers concerning noise terms often use this method of estimation. In all the papers mentioned above, the estimation problem boils down to solving certain linear equations. These papers differ from each other by the methods they proposed in solving the equations. Such as LQ-factorization, least squares, or pseudo-inverse etc. In this thesis, we will focus on the method proposed by Juang in [6].
The structure of the thesis is as follows. In Chapter 2 the modeling methodology we
adopt will be discussed in detail. Chapter 3 is devoted to the question of how to update
the model when new data is available. Finally, the thesis closes with the conclusions and
a discussion for further research in Chapter 4. The computer program that was used for
this thesis is included in Appendix A.
Chapter 2
The model
Physical behavior can be modeled in a system, for instance the motion of a car driving in a straight line. We can use as input the pressure given on the throttle, as output we want the distance traveled. This is the best modeled by a dynamical input/state/output system, where the state represents some physical quantities and is able to keep track of the speed and the distance. This chapter will provide a dynamical system which will be used to predict the amount of gas. Note that we do not know the exact behavior of the demand, and therefore cannot give physical meaning to the state.
The organization of this chapter is as follows. In Section 2.1 we will introduce discrete time-invariant input/state/output dynamical linear systems and review certain proper- ties of such systems. In Section 2.2, we will present a methodology based on [6] in order to estimate system matrices from given input/output observations. Finally we will dis- cuss how this methodology can be employed in the context of predicting gas demand in Section 2.3.
2.1 Discrete-time dynamical linear models
Consider the linear discrete-time time-invariant input/state/output system Σ(A, B, C, D) of the form:
x(k + 1) = Ax(k) + Bu(k),
y(k) = Cx(k) + Du(k), (2.1)
where k ∈ N denotes the time, u(k) ∈ R
rthe input vector, x(k) ∈ R
nthe state vec-
tor, y(k) ∈ R
mthe output vector and the so-called system matrices A, B, C, D are of
appropriate dimensions. We sometimes refer to this representation as state-space repre-
sentation. If the system description (2.1) is obtained from a physical system the state
of the system (very often) has a physical interpretation. For instance, if one models an
electrical circuit containing linear dynamical elements like capacitors and inductors then
the components of the state vector correspond to the voltages/charges of the capacitors
and the current/flows of the inductors. In this thesis we attempt to identify a system
of the form (2.1) in order the model gas demand. As such, the state vector will not
necessarily admit a certain physical meaning.
Next, we illustrate the underlying dynamics of the system of the form (2.1) by means of an example.
Example Consider the state space representation of the form (2.1) where A = 1 2
3 4
, B = 1 −0.2 3 4 −0.5 6
, C = 1 2 , D = 1 −0.4 2 .
For this model, the input vector u consists of three components: the first corresponds to the speed of the wind (10
−1m/s), the second to the temperature (10
−1), and the third corresponds to the amount of rain fallen in the hour (10
−1mm)
1whereas the scalar output y corresponds to the amount of gas (10
7kWh)
2.
Suppose that the initial state x(0) is given by x(0) = 1
1
.
To calculate the output we use the input, the system matrices and the state together with equation (2.1). Assume that at time instance 0 the speed of the wind is 1.0 m/s, the temperature is 10.6 and the amount of rain fallen is 1.6 mm. This leads to the output at time instance 0
y(0) = Cx(0) + Du(0) = 1 2 1 1
+ 1 −0.4 2
10 106
16
= 2.6.
Additionally, we calculate x(1):
x(1) = Ax(0) + Bu(0) = 1 2 3 4
1 1
+ 1 −0.2 3 4 −0.5 6
10 106
16
= 39, 8 96
.
Assume at time instance 1 that the speed of the wind is 2.0 m/s, the temperature is 10.8
and the amount of rain fallen is 1.2 mm. This leads to the output at time instance 1
y(1) = Cx(1) + Du(1) = 1 2 39, 8 96
+ 1 −0.4 2
20 108
12
= 232.6.
Additionally, we calculate x(2):
x(2) = Ax(1) + Bu(1) = 1 2 3 4
39, 8 96
+ 1 −0.2 3 4 −0.5 6
20 108
12
= 266.2 601.4
.
In a similar fashion, one can compute the state and the output at time instant k, i.e.
x(k) and y(k), based on the values of inputs u(0), u(1), . . . , u(k).
11 millimeter rainfall is the equivalent of 1 liter of water per square meter per hour.
2.2 System identification
Roughly speaking, the system identification problem we deal with in this thesis amounts to construct a dynamical system of the form (2.1) based on given input/output observa- tions. In order to elaborate on the method we use, we first introduce a set of machinery in what follows
2.2.1 Preliminaries
This section is devoted to the definitions of mathematical concepts and notations that will be used throughout the thesis.
Most of the time we follow the standard mathematical notation and conventions. We denote the set of natural numbers (including zero) by N, the set of real number by R, the set of q-tuples of real numbers by R
qand the set of q × p matrices by R
q×p.
In this Chapter the Moore-Penrose pseudo-inverse will be used, hence we define it below.
Definition 2.2.1 (Moore-Penrose pseudo-inverse). For the matrix A ∈ R
m×n, the Moore-Penrose pseudo-inverse is defined as A
†∈ R
n×mand satisfies the following prop- erties:
(i) AA
†A = A (ii) A
†AA
†= A
†(iii) (AA
†)
T= AA
†(iv) (A
†A)
T= A
†A.
Furthermore, A
†exists and is unique.
In the case that A is invertible this inverse will be the normal inverse of an invertible matrix. The advantage of using this pseudo-inverse is that it is widely used and most mathematical programming languages have a build in program to compute the Moore- Penrose pseudo-inverse of any matrix.
A commonly used class of matrices in the context of system identification is the so-called Hankel matrices. The Output matrix and the Input matrix have the shape of a Hankel matrix.
Definition 2.2.2 (Hankel matrix). A matrix M ∈ R
q×qis called a Hankel matrix if M
ij= M
krwhenever i + j = k + l, that is if it is off the form:
m
1m
2m
3· · · m
qm
2m
3m
4· · · m
q+1m
3m
4m
5· · · m
q+2.. . .. . .. . . .. .. . m
qm
q+1m
q+2· · · m
2q−1
.
for some real numbers m
iwith 1 ≤ i ≤ 2q − 1.
We sometimes say that a (possibly non-square) matrix is a block Hankel matrix if it admits the Hankel structure blockwise.
Another relevant class of matrices is the so called Toeplitz matrices.
Definition 2.2.3 (Toeplitz matrix). Given the system matrices A ∈ R
n×n, B ∈ R
n×r, C ∈ R
m×n, D ∈ R
m×rand an integer p ∈ N we define the corresponding Toeplitz matrix as
T
p:=
D 0
CB D 0
CAB CB D 0
.. . .. . .. . . .. ...
.. . .. . .. . .. . . .. 0 CA
p−2B CA
p−3B CA
p−4B · · · · · · D
.
In the course of the discussion, we will work with matrices obtained from sequences of inputs, states and outputs. In what follows we introduce these matrices.
Definition 2.2.4 (Input matrix). Let u(k) ∈ R
rbe the input at time instance k ∈ N and p ∈ N, then we define the vector u
p(k) ∈ R
pras:
u
p(k) :=
u(k) u(k + 1) u(k + 2)
.. . u(k + p − 1)
.
Then for given N ∈ N we define the input matrix U
p(k) ∈ R
pr×Nas:
U
p(k) := u
p(k) u
p(k + 1) · · · u
p(k + N − 1)
=
u(k) u(k + 1) · · · u(k + N − 1) u(k + 1) u(k + 2) · · · u(k + N )
.. . .. . . .. .. .
u(k + p − 1) u(k + p) · · · u(k + p + N − 2)
.
Similar to the input matrix, we define the output matrix as the following.
Definition 2.2.5 (Output matrix). Let y(k) ∈ R
mbe the output at time instance k ∈ N and p ∈ N, then we define the vector y
p(k) ∈ R
pmas:
y
p(k) :=
y(k) y(k + 1) y(k + 2)
.. .
.
Then for given N ∈ N we define the output matrix Y
p(k) ∈ R
pm×Nas:
Y
p(k) := y
p(k) y
p(k + 1) · · · y
p(k + N − 1)
=
y(k) y(k + 1) · · · y(k + N − 1) y(k + 1) y(k + 2) · · · y(k + N )
.. . .. . . .. .. .
y(k + p − 1) y(k + p) · · · y(k + p + N − 2)
.
Note that the input and output matrix are of block Hankel matrix form.
Apart from these matrices, we need to define the state matrix.
Definition 2.2.6 (State matrix). Let x(k) ∈ R
nbe the state at time instance k ∈ N then for a given N ∈ N we define the state matrix X(k) ∈ R
n×Nas:
X(k) := x(k) x(k + 1) · · · x(k + N − 1) . Finally, we define the observability matrix.
Definition 2.2.7 (Observability matrix). Given the system matrices A ∈ R
n×n, C ∈ R
m×nand p ∈ N we define the observability matrix as:
O
p:=
C CA CA
2.. . .. . CA
p−1
.
The relationships among the matrices defined above is in order. By straightforward calculations, we arrive at the following state and output trajectories of the system (2.1) for the initial state x(0) and the input sequence u(0), u(1), . . . , u(k):
x(k) = A
kx(0) + A
k−1Bu(0) + A
k−2Bu(1) + · · · + ABu(k − 2) + Bu(k − 1), y(k) = CA
kx(0) + CA
k−1Bu(0) + · · · + CABu(k − 2) + CBu(k − 1) + Du(k).
In a more compact form we have
y
p(k) = O
px(k) + T
pu
p(k), (2.2)
Y
p(k) = O
pX(k) + T
pU
p(k). (2.3)
The goal of the method we use it to determine A, B, C, D matrices from given input/out-
put observations. To do so, we first focus on determining the observabilitymatrix O
p.
Define:
R
yy= 1
N Y
p(k)Y
pT(k), R
yu= 1
N Y
p(k)U
pT(k), R
uu= 1
N U
p(k)U
pT(k), R
xx= 1
N X(k)X
T(k), R
yx= 1
N Y
p(k)X
T(k), R
xu= 1
N X(k)U
pT(k).
(2.4)
The matrices R
yy∈ R
mp×mp, R
uu∈ R
rp×rp, R
xx∈ R
n×nare symmetric matrices that represent the autocorrelations of the output data y with the time shifts, the input data u with the time shifts, and the state vector x, respectively, whereas the matrices R
yu∈ R
mp×rp, R
yx∈ R
mp×n, R
xu∈ R
n×rprepresent the cross correlations of the output data y with time shifts and the input data u with time shifts, the output data y with time shifts and state vector x, and the state vector x and the input u with time shifts, respectively.
0 1 2 3 4 5
Speed of the wind (in 10
−1m/s) 10 10 20 30 10 20 Temperature (in 10
−1) 98 94 136 106 102 92 Amount of rain fallen (in 10
−1mm) 18 73 16 33 40 31
Table 2.1: Input data
0 1 2 3 4 5
Energy (in 10
7kWh) 1.2 1.1 1.2 1.1 1.2 1.3 Table 2.2: Output data
Example We can use the input data and output data given in Table 2.1 and Table 2.2,
respectively to calculate the input matrix U
3(0) and the output matrix Y
3(0). We have
r = 3 and m = 1, choose p = 3 and N = 4 and k = 0. This leads to the following input
and output matrices:
U
3(0) =
10 10 20 30 98 94 136 106 18 73 16 33 10 20 30 10 94 136 106 102 73 16 33 40 20 30 10 20 136 106 102 92 16 33 40 31
,
Y
3(0) =
" 1.2 1.1 1.2 1.1 1.1 1.2 1.1 1.2 1.2 1.1 1.2 1.3
# .
Using these matrices the quantities R
yy, R
yu, R
uucan be calculated using (2.4) Estimating the observability matrix
By post-multiplying (2.3) by U
pT(k)/N , we get
R
yu= Y
p(k)U
pT(k) = O
pX(k)U
pT(k) + T
pU
p(k)U
pT(k) = O
pR
xu+ T
pR
uu.
Suppose that R
uuis nonsingular. Then, we obtain the Toeplitz matrix T
pby post- multiplying the last equation by R
−1uu:
T
p= (R
yu− O
pR
xu) R
−1uu(2.5) Similarly, we get
R
yy= Y
p(k)Y
pT(k) = O
pX(k)Y
pT(k) + T
pU
p(k)Y
pT(k) = O
pR
Tyx+ T
pR
Tyu, (2.6) and
R
yx= Y
p(k)X
T(k) = O
pX(k)X
T(k) + T
pU
p(k)X
T(k) = O
pR
xx+ T
pR
Txu. (2.7) by post-multiplying (2.3) by Y
pT/N and by X
pT/N , respectively. Substituting (2.7) in (2.6) results in
R
yy= O
pO
pR
xx+ T
pR
TxuT+ T
pR
Tyu= O
pR
xxO
p+ O
pR
xuT
pT+ T
pR
Tyu. Furthermore, one can substitute T
pgiven by (2.5) and get:
R
yy= O
pR
xxO
p+ O
pR
xuT
pT+ T
pR
Tyu,
= O
pR
xxO
p+ O
pR
xu(R
yu− O
pR
xu) R
−1uuT+ (R
yu− O
pR
xu) R
−1uuR
Tyu,
= O
pR
xxO
Tp+ O
pR
xuR
−1uuR
Tyu− O
pR
xuR
−1uuR
TxuO
pT+ R
yuR
−1uuR
Tyu− O
pR
xuR
−1uuR
T,
= O
pR
xxO
Tp− O
pR
xuR
−1uuR
TxuO
pT+ R
yuR
−1uuR
Tyu.
This leads to
R
yy− R
yuR
−1uuR
Tyu= O
pR
xx− R
xuR
−1uuR
TxuO
Tp. (2.8) Now, we define
R
hh= R
yy− R
yuR
−1uuR
Tyu, (2.9) R ˜
xx= R
xx− R
xuR
−1uuR
Txu. (2.10) Then, (2.8) can be written as
R
hh= O
pR ˜
xxO
Tp. (2.11)
Clearly, both R
hh∈ R
mp×mpand ˜ R
xx∈ R
n×nare symmetric matrices.
We are now in a position to compute an estimate of the observability matrix. By following the footsteps of [6], let R
hhR
hh= U Σ
2V
T= U
nU
0Σ
2n0
n×n00
n0×n0
n0×n0V
nTV
0T= U
nΣ
2nV
nT, (2.12) be the singular value decomposition of R
hhwhere n
0is the amount of singular values equal to 0. Since R
hhis symmetric, we have U
n= V
nand U
0= V
0. Then, it follows from (2.11) that
R
hh= O
pR ˜
xxO
pT= U
nΣ
2nU
nTThis leads to the obvious estimates for O
pand ˜ R
xx:
O
p= U
n, (2.13)
R ˜
xx= Σ
2n. (2.14)
In this method the dimension of the state is equal to n. In order to get a specific dimension of the state, we must have pm − n singular values equal to 0. In practice non of the singular values of R
hhare equal to 0. To achieve the desired dimension of the state we will truncate the smallest pm − n singular values. So Σ
2ncontains the n highest singular values. Then, we have U
n∈ R
pm×n= O
p.
Example Assume p = 3 and N is chosen such that R
uuis non-singular. Using R
yy, R
yu, R
uuwe can calculate R
hh. Assume that we have
R
hh=
2 3 5 3 8 7 5 7 4
.
Using the singular value decomposition shown in (2.12) gives us the following matrices for U
n, Σ
2n, V
n:
U
n=
−0.39 −0.57 −0.73
−0.71 −0.33 0.63
−0.59 0.75 −0.28
,
Σ
2n=
15.49 0 0
0 2.85 0
0 0 1.36
,
V
n=
−0.39 −0.57 −0.73
−0.71 −0.33 0.63
−0.59 0.75 −0.28
. Clearly, U
n= V
n. Assume n = 2, then this leads to:
O
p=
−0.39 −0.57
−0.71 −0.33
−0.59 0.75
. (2.15)
Estimating A
We construct the matrix A ∈ R
n×nusing the observability matrix. We have the follow- ing:
O
p(m + 1 : pm, :) =
CA CA
2CA
3.. . CA
p−1
=
C CA CA
2.. . CA
p−2
A = O
p(1 : (p − 1)m, :)A.
We use the Moore-Penrose pseudo-inverse to compute the matrix A. This leads to:
A = O
p†(1 : (p − 1)m, :)O
p(m + 1 : pm, :), (2.16) where O
†p(1 : (p−1)m, :) denotes the Moore-Penrose pseudo-inverse of O
p†(1 : (p−1)m, :).
Example Using the observability matrix given by (2.15) we have A = −0.39 −0.57
−0.71 −0.33
†−0.71 −0.33
−0.59 0.75
= 0.39 −1, 90 0.98 1.83
. (2.17)
Estimating C
The estimation of the matrix C ∈ R
m×nfollows directly from the estimation of the observability matrix. Recall that the first m rows of the observability matrix are exactly C. In other words, we have
C = O
p(1 : m, :). (2.18)
Example Using the observability matrix given by (2.15) we have
C = −0.39 −0.57 . (2.19)
Estimating B and D
The observability matrix and the form of the Toeplitz matrix are used for the estimation of the matrices B and D. To do so we use the output-error minimization method proposed in [6].
We begin with substituting p = N and k = 0 in (2.2)
y
N(0) = O
Nx(0) + T
Nu
N(0). (2.20) We write the matrices B and D in the following way:
B = b
1b
2· · · b
r, D = d
1d
2· · · d
r,
where b
i∈ R
nand d
i∈ R
mfor i = 1, 2, . . . , r. Define the vectors b ∈ R
rnand d ∈ R
rmas:
b =
b
1b
2.. . b
r
, d =
d
1d
2.. . d
r
.
Also, let
u(k) =
u
1(k) u
2(k)
.. . u
r(k)
.
We now have the following for T
Nu
N(0):
T
Nu
N(0) =
D
CB D
CAB CB D
.. . .. . .. . . ..
CA
N −2B CA
N −3B CA
N −4B · · · D
u(0) u(1) u(2) .. . u(N − 1)
,
=
U
m(0) U
m(1) U
m(2)
.. . U
m(N − 1)
d +
0
m×nrCU
n(0) CAU
n(0) + CU
n(1)
.. .
N −2
P
k=0
CA
N −k−2U
n(k)
b,
(2.21)
where 0
m×nr∈ R
m×ndenotes the zero matrix, and
U
m(k) = I
mu
1(k) I
mu
2(k) · · · I
mu
r(k) , U
n(k) = I
nu
1(k) I
nu
2(k) · · · I
nu
r(k) ,
where I
m∈ R
m×mand I
n∈ R
n×nare the identity matrices of order m and n, respec- tively. Substituting the expression for T
Nu
N(0) from (2.21) into (2.20) gives:
y
N(0) = ΦΘ, where
Θ =
x(0)
d b
, Φ =
C U
m(0) 0
m×nrCA U
m(1) CU
n(0)
CA
2U
m(2) CAU
n(0) + CU
n(1)
.. . .. . .. .
CA
N −1U
m(N − 1)
N −2
P
k=0