# Computation of Gram Matrix and Its Partial Derivative Using Precise Integration Method for Linear Time-Invariant Systems

Authors: Sulan Li; Yuanhao Ren; Hong Bao; Wei Zhang
Journal: Journal of Applied Mathematics
 (2014)

---

## Abstract

Gram matrix is an important tool in system analysis and design as it provides a description of the input-output behavior for system; its partial derivative matrix is often required in some numerical algorithms. It is essential to study computation of these matrices. Analytical methods only work in some special circumstances; for example, the system matrix is diagonal matrix or Jordan matrix. In most cases, numerical integration method is needed, but there are two problems when compute using traditional numerical integration method. One is low accuracy: as high accuracy requires extremely small integration step, it will result in large amount of computation; and another is stability and stiffness issues caused by the dependence on the property of system matrix. In order to overcome these problems, this paper proposes an efficient numerical method based on the key idea of precise integration method (PIM) for the Gram matrix and its partial derivative of linear time-invariant systems. Since matrix inverse operation is not required in this method, it can be used with high precision no matter the system is normal or singular. The specific calculation algorithm and block diagram are also given. Finally, numerical examples are given to demonstrate the correctness and validity of this method.


---

## Body

## 1. Introduction

Gram matrix contains elements which are scalar products of repeated integrals of impulse response of the system. It provides a description of the input-output behavior of the system and is therefore a potential tool in system analysis and design. Not only it determines controllability and observability of system [1], but also in several applications [2–10], it is essential. Such as in [2], Gram matrix was used in identification of linear system, in [3, 4], methods based on Gram matrix for observability restoration were presented, in [5, 6], Gram matrix was applied in state estimation and observability analysis, and in [4, 7–10] problems of state estimation using Gram matrix associated with Jacobian matrix for power system were studied. Great attention has been gained in the theoretical study and practical engineering, so it is very necessary to study its calculation.If the system matrix is in a special form, for example, is a diagonal matrix or a Jordan matrix, or when the order of the system under consideration is not large, analytical solution of Gram matrix will be obtained [1]. But in practice, most of the system matrices are not in conformity with the forms above; the order is large or even system matrix is singular in some cases; analytical method is essentially useless; some other methods can be used to solve it. A variety of methods permit a both fast and accurate computation of the Gram matrix of system [11–16]. In [11], a method for evaluation of the Gram matrix from the coefficients of the system transfer function is proposed, but it is tedious and cumbersome; the methods proposed in [12–14] computed Gram matrix using its properties in time-domain, but as the authors stated, the technique though very elegant in principle it gives poor results due to two reasons. Firstly, it is difficult to obtain accurate measurements of impulse response date since the data obtained is usually contaminated with noise. And secondly, numerical integration techniques again introduce errors due to truncation and round off. Reference [15] presents an efficient algorithm for orthogonal decomposition of derivatives and antiderivatives of functions with rational Laplace transforms. A method for computing extended Gram matrix was proposed based on the new theorem related to Rough α
-
β expansion. But it is relatively applied in a narrow scope and not suited for irrational resonant system. In [16], a method for evaluation of the Gram matrix via a Kautz model is proposed. However, the efficiency or accuracy of the computation heavily depends on the choice of Kautz parameters, and it is also only suitable for stable systems. And traditional numerical integration methods [17], such as trapezoidal integration, Simpson integration, and Gaussian integral, also can be used to compute Gram matrix. Unfortunately, they are always with low accuracy; to improve accuracy, integration step needs to be divided as small as possible; thus, computational effort will greatly increase and the solution also heavily depends on the behavior of system matrix, which will result in some troubles, such as stability and stiffness issues.To overcome the above shortcomings and improve the accuracy of time step integration, Zhong and Williams proposed the precise integration method originally in [18]. It has been widely used in solving matrix integrals because of its high precision, stability, and fast calculation. On application to linear time-invariant dynamic homogeneous systems [19], the method can give precise numerical results approaching the exact solution at the integration points. In [20–23], it is applied to non-homogeneous dynamic systems. And Duhamel integral term is approximated using polynomial functions, sin/cos functions, exponential functions, and their combinations firstly. The corresponding recursive format is derived [20]. The accuracy of the algorithm is restricted by the inherent errors in matrix inversion and simulation of the applied loading. References [21, 22] deal with the Duhamel term using other methods, but it is still restricted by the inherent errors in matrix inversion. Reference [23] takes the idea of precise integration of exponential matrix into Duhamel integration to avoid the matrix inversion. Reference [24] reviews the precise integration method; it is not only used to solve time-invariant system, but also for time-variant, nonlinear system, and two-point boundary value problems. References [25–27] discuss the numerical stability and accuracy of precise time integration method in detail.Unfortunately, in the above research, precise time integration method is only used to calculate the dynamic response of system or further to calculate two-point boundary value problems. It is necessary to notice that there is only one term of matrix exponent function in the above integrands [18–24]; the way how to deal with the part of matrix exponent function is the difficulty of matrix integration methods. But for Gram matrix and its partial derivative matrix, there are two terms of matrix exponent functions multiplied and separated by a matrix. Considering that general matrix operations cannot be directly combined as they are not commutative, so existing precise integration method cannot be applied to solve Gram matrix and its partial derivative matrix directly. Therefore, based on the key ideas of precise integration, this paper gives the specific computing method and derives the incremental form of the additional theorem for the computation of Gram matrix and its partial derivative matrix.The rest of this paper is organized as follows: In Section2, the formulation of Gram matrix and its partial derivative matrix are stated, and then the precise integration method to compute these matrices is described in detail. In Section 3, some representative numerical examples are presented and simulation results are discussed. Finally, conclusions are presented in Section 4.


## 2. Materials and Methods

### 2.1. Gram Matrix

A linear time-invariant system can be given in matrix/vector form as(1)
x
˙
=
a
x
+
b
u
,
y
=
c
x
,in which a dot above(
)
· means the differentiation with respect to time t, x is an n-dimensional state vector, u is a p-dimensional input vector, and y is a q-dimensional output vector. a, b
, and c are n
×
n, n
×
p and q
×
n dimensional system matrix, input matrix, and output matrix, respectively. For any time t
>
0, the corresponding Gram matrix contains controllability matrix W
C
t and observability matrix W
O
t; they are defined as
(2)
W
C
t
=
∫
0
t
e
a
τ
b
b
T
e
a
T
τ
d
τ
,
(3)
W
O
t
=
∫
0
t
e
a
T
τ
c
T
c
e
a
τ
d
τ
.IfW
C
t and W
O
t are nonsingular separately, the relevant system is completely controllable and observable. Considering that W
C
t and W
O
t have the similar form, therefore take W
C
t as example to illustrate the computation of Gram matrix using precise integration method. To facilitate the derivation, supposing that A
1
=
a,  A
2
=
a
T,  B
=
b
b
T, then Gram matrix corresponding to (2) is equivalent to the following forms:
(4)
W
C
t
=
∫
0
t
e
A
1
τ
B
e
A
2
τ
d
τ
.In case the system corresponding to (1) is stable, then with the increasing of time t, W
C
t will converge to a constant value, that is to say lim
⁡
t
→
∞
∫
0
t
e
A
1
τ
B
e
A
2
τ
d
τ
=
constant; the built-in function gram () in MATLAB can be used to get this constant.


### 2.2.  Partial Derivative of Gram Matrix

If the elements of system matrixa are functions of a variable, the resulting Gram matrix W
C
t is also a function of this variable; then there is a partial derivative matrix to this variable, which is often required in some numerical optimization algorithm. It is also necessary to study the computation of this partial derivative matrix. Assume that the system matrix is a function of w (w and t are independent); that is to say(5)
W
C
t
=
∫
0
t
e
A
1
(
w
)
τ
B
e
A
2
(
w
)
τ
d
τ
.For a specific system, expressions of Gram matrix are generally complicated enough, so it is rather cumbersome to solve the partial derivatives matrix directly. Consider(6)
∂
W
C
t
∂
w
=
∂
(
∫
0
t
e
A
1
(
w
)
τ
B
e
A
2
(
w
)
τ
d
τ
)
∂
w
.
Therefore, make the following processing:
(7)
∂
W
C
t
∂
w
=
∫
0
t
∂
(
e
A
1
(
w
)
τ
B
e
A
2
(
w
)
τ
)
∂
w
d
τ
=
∫
0
t
(
∂
(
e
A
1
τ
)
∂
w
B
e
A
2
τ
+
e
A
1
τ
B
∂
(
e
A
2
τ
)
∂
w
)
d
τ
.According to the following relationship:(8)
∂
(
e
A
t
)
∂
w
=
t
e
A
t
∂
(
A
)
∂
w(6) is equivalent to
(9)
∂
W
C
t
∂
w
=
∫
0
t
(
τ
e
A
1
τ
∂
(
A
1
)
∂
w
B
e
A
2
τ
+
e
A
1
τ
B
τ
e
A
2
τ
∂
(
A
2
)
∂
w
)
d
τ
=
∫
0
t
τ
e
A
1
τ
(
∂
(
A
1
)
∂
w
B
)
e
A
2
τ
d
τ
+
∫
0
ρ
τ
e
A
1
τ
B
e
A
2
τ
d
τ
·
∂
(
A
2
)
∂
w
.Two different integration terms are contained in (9), and these two terms can be summarized to the computation of integration as follows:
(10)
W
C
1
t
=
∫
0
t
τ
e
A
1
τ
P
e
A
2
τ
d
τ
,in which the dimensions ofP and B are equivalent. As long as (10) is solved, the partial derivative of Gram matrix corresponding to (9) will be solved. Therefore, take (10) as example to illustrate the computation of partial derivative matrix in the following.


### 2.3. Precise Integration Method for Computation of Gram Matrix

Now the problem is to compute (4) using precise integration method. A basic time step, denoted as η, is necessary to be given for the numerical integration. The following relationship is satisfied:
(11)
t
0
=
0
,
t
1
=
η
,
…
,
t
k
=
k
η
,
t
k
+
1
=
(
k
+
1
)
η
,
…
.According to (4), it can be obtained that between two Gram matrices, at any time t
k
=
k
·
η  (
k
=
0,1
,
2
,
…
) and the next interval t
k
+
1
=
t
k
+
η, the following relationship is satisfied:
(12)
W
C
k
+
1
=
W
C
k
+
e
A
1
t
k
∫
0
η
e
A
1
τ
B
e
A
2
τ
d
τ
·
e
A
2
t
k
=
W
C
k
+
e
A
1
t
k
·
W
C
η
·
e
A
2
t
k
.Therefore, the problem is transformed to computeW
C
η. Next, the precise integration method for W
C
η will be given. According to the key point of precise integration method, the corresponding additional theorem is derived:
(13)
W
C
η
=
∫
0
η
e
A
1
τ
B
e
A
2
τ
d
τ
,
(14)
W
C
2
η
=
∫
0
2
η
e
A
1
τ
B
e
A
2
τ
d
τ
=
∫
0
η
e
A
1
τ
B
e
A
2
τ
d
τ
+
∫
η
2
η
e
A
1
τ
B
e
A
2
τ
d
τ
=
W
C
η
+
∫
0
η
e
A
1
η
e
A
1
τ
′
B
e
A
2
τ
′
e
A
2
η
d
τ
′
=
W
C
η
+
φ
1
(
η
)
∫
0
η
e
A
1
τ
′
B
e
A
2
τ
′
d
τ
′
·
φ
2
(
η
)
=
W
C
η
+
φ
1
(
η
)
W
C
η
φ
2
(
η
)
.Equation (14) is the main key point of precise integration method. According to this equation, take ρ as precise interval to divide the basic interval η:
(15)
ρ
=
η
2
N
.
N is the weighting coefficient of matrix A; generally the computational results are accurate enough when N
=
20 [18, 29]; that is to say ρ
=
η
/
1048576. η is a small time interval, and ρ is an extremely small time interval. Hence for the interval, the truncated Taylor expansion is applied with high precision:
(16)
W
C
ρ
=
∫
0
ρ
e
A
1
τ
B
e
A
2
τ
d
τ
=
∑
k
=
0
∞
∑
m
=
0
∞
∫
0
ρ
A
1
k
τ
k
B
A
2
m
τ
m
k
!
m
!
d
τ
=
∑
k
=
0
∞
∑
m
=
0
∞
A
1
k
B
A
2
m
ρ
k
+
m
+
1
k
!
m
!
(
k
+
m
+
1
)
≈
B
ρ
+
ρ
2
(
B
A
2
2
+
A
1
B
2
)
+
ρ
3
(
B
A
2
2
6
+
A
1
B
A
2
3
+
A
1
2
B
6
)
+
ρ
4
(
B
A
2
3
24
+
A
1
B
A
2
2
8
+
A
1
2
B
A
2
8
+
A
1
3
B
24
)
(17)
φ
1
(
2
)
(
ρ
)
=
exp
⁡
(
A
1
(
2
)
ρ
)
=
∑
k
=
0
∞
A
1
(
2
)
k
ρ
k
k
!
≈
I
+
(
A
1
(
2
)
ρ
)
+
(
A
1
(
2
)
ρ
)
2
2
+
(
A
1
(
2
)
ρ
)
3
6
+
(
A
1
(
2
)
ρ
)
4
24
=
I
+
φ
1
(
2
)
′
(
ρ
)
.Considering thatρ is very small, the first five term series expansion should be enough. Theoretically, the solution at basic interval will be obtained through merge operations N times as described by (14). But it can be seen from (17) that φ
1
(
ρ
) and φ
2
(
ρ
) both depart from the unit matrix I to a very small extent. And φ
1
(
2
)
′
(
ρ
) is extremely small; if it is added to the unit matrix I, it will become an appended part and its precision will be seriously dropped in the round-off operation in computer arithmetic. In order to avoid the resulting loss of accuracy, the increment φ
1
(
2
)
′
(
ρ
) and the unit matrix I should be separated, and φ
1
(
2
)
′
(
ρ
) is kept in the memory rather than the matrix φ
1
(
2
)
(
ρ
). So, (14) is rewritten into the following form of incremental part φ
1
(
2
)
′
(
ρ
):
(18)
W
C
2
ρ
=
W
C
ρ
+
(
I
+
φ
1
′
(
ρ
)
)
W
C
ρ
(
I
+
φ
2
′
(
ρ
)
)
.So at each step, attention will be focused on the incremental, rather than the whole amount; the precision loss caused by computer rounding operation will be avoided. And this is the second key point of precise integration method.


### 2.4. Precise Integration Method for Computation of Partial Derivative Matrix

The strategy of precise integration method will be used to deal withW
C
1
t. The corresponding additional theorem is derived firstly:
(19)
W
C
1
2
ρ
=
∫
0
2
ρ
τ
e
A
1
τ
P
e
A
2
τ
d
τ
=
∫
0
ρ
τ
e
A
1
τ
P
e
A
2
τ
d
τ
+
∫
ρ
2
ρ
τ
e
A
1
τ
P
e
A
2
τ
d
τ
=
W
C
1
ρ
+
∫
ρ
2
ρ
τ
e
A
1
τ
P
e
A
2
τ
d
τ
=
W
C
1
ρ
+
∫
0
ρ
τ
e
A
1
ρ
e
A
1
τ
P
e
A
2
τ
e
A
2
ρ
d
τ
+
∫
0
ρ
ρ
e
A
1
ρ
e
A
1
τ
P
e
A
2
τ
e
A
2
ρ
d
τ
=
W
C
1
ρ
+
φ
1
(
ρ
)
W
C
1
ρ
φ
2
(
ρ
)
+
ρ
φ
1
(
ρ
)
W
C
ρ
φ
2
(
ρ
)
.In the above expression,φ
1
(
ρ
),  W
C
(
ρ
), and φ
2
(
ρ
) can refer to the preview results. For W
C
1
(
ρ
), finite Taylor expansion can be used to approximate
(20)
W
C
1
ρ
=
∫
0
ρ
τ
e
A
1
τ
P
e
A
2
τ
d
τ
=
∑
k
=
0
∞
∑
m
=
0
∞
∫
0
ρ
τ
A
1
k
τ
k
P
A
2
m
τ
m
k
!
m
!
d
τ
=
∑
k
=
0
∞
∑
m
=
0
∞
A
1
k
P
A
2
m
ρ
k
+
m
+
2
k
!
m
!
(
k
+
m
+
2
)
≈
ρ
2
P
2
+
ρ
3
(
P
A
2
3
+
A
1
P
3
)
+
ρ
4
(
P
A
2
2
8
+
A
1
P
A
2
4
+
A
1
2
P
8
)
+
ρ
5
(
P
A
2
3
30
+
A
1
P
A
2
2
10
+
A
1
2
P
A
2
10
+
A
1
3
P
30
)
.
The incremental form of the additional theorem is
(21)
W
C
1
2
ρ
=
W
C
1
ρ
+
(
I
+
φ
1
′
(
ρ
)
)
W
C
1
ρ
(
I
+
φ
2
′
(
ρ
)
)
+
ρ
(
I
+
φ
1
′
(
ρ
)
)
W
C
ρ
(
I
+
φ
2
′
(
ρ
)
)
.Now, the numerical solution ofW
C
1
t is obtained using precise integration method according to (21); therefore, the exact numerical solution of partial derivatives of Gram matrix can be obtained. Since the dimensions of P and B are equivalent, their values do not affect the specific verification. Therefore, in the numerical examples of the next section, calculations are based on P
=
B.


### 2.5. Programming Flow Chart of the Method

Take the computation of Gram matrix at basic intervalη as example, the programming flow chart is given in Figure 1.Figure 1
The block diagram of the method.The amount of computation mainly focuses on matrix multiplication [29] and contains two parts: one is the computation of initial basic interval, and another isNtimes merging during the addition theorem. The amount of computation is about O
[
(
N
+
q
-
1
)
n
3
+
(
N
+
q
-
1
)
m
n
2
], in which N is the weighting coefficient of matrix A (see (15)),q represents the order of Taylor expansion series (see (16), (17)),m is number of columns of matrix B
, and n is order of matrix A.


## 2.1. Gram Matrix

A linear time-invariant system can be given in matrix/vector form as(1)
x
˙
=
a
x
+
b
u
,
y
=
c
x
,in which a dot above(
)
· means the differentiation with respect to time t, x is an n-dimensional state vector, u is a p-dimensional input vector, and y is a q-dimensional output vector. a, b
, and c are n
×
n, n
×
p and q
×
n dimensional system matrix, input matrix, and output matrix, respectively. For any time t
>
0, the corresponding Gram matrix contains controllability matrix W
C
t and observability matrix W
O
t; they are defined as
(2)
W
C
t
=
∫
0
t
e
a
τ
b
b
T
e
a
T
τ
d
τ
,
(3)
W
O
t
=
∫
0
t
e
a
T
τ
c
T
c
e
a
τ
d
τ
.IfW
C
t and W
O
t are nonsingular separately, the relevant system is completely controllable and observable. Considering that W
C
t and W
O
t have the similar form, therefore take W
C
t as example to illustrate the computation of Gram matrix using precise integration method. To facilitate the derivation, supposing that A
1
=
a,  A
2
=
a
T,  B
=
b
b
T, then Gram matrix corresponding to (2) is equivalent to the following forms:
(4)
W
C
t
=
∫
0
t
e
A
1
τ
B
e
A
2
τ
d
τ
.In case the system corresponding to (1) is stable, then with the increasing of time t, W
C
t will converge to a constant value, that is to say lim
⁡
t
→
∞
∫
0
t
e
A
1
τ
B
e
A
2
τ
d
τ
=
constant; the built-in function gram () in MATLAB can be used to get this constant.


## 2.2.  Partial Derivative of Gram Matrix

If the elements of system matrixa are functions of a variable, the resulting Gram matrix W
C
t is also a function of this variable; then there is a partial derivative matrix to this variable, which is often required in some numerical optimization algorithm. It is also necessary to study the computation of this partial derivative matrix. Assume that the system matrix is a function of w (w and t are independent); that is to say(5)
W
C
t
=
∫
0
t
e
A
1
(
w
)
τ
B
e
A
2
(
w
)
τ
d
τ
.For a specific system, expressions of Gram matrix are generally complicated enough, so it is rather cumbersome to solve the partial derivatives matrix directly. Consider(6)
∂
W
C
t
∂
w
=
∂
(
∫
0
t
e
A
1
(
w
)
τ
B
e
A
2
(
w
)
τ
d
τ
)
∂
w
.
Therefore, make the following processing:
(7)
∂
W
C
t
∂
w
=
∫
0
t
∂
(
e
A
1
(
w
)
τ
B
e
A
2
(
w
)
τ
)
∂
w
d
τ
=
∫
0
t
(
∂
(
e
A
1
τ
)
∂
w
B
e
A
2
τ
+
e
A
1
τ
B
∂
(
e
A
2
τ
)
∂
w
)
d
τ
.According to the following relationship:(8)
∂
(
e
A
t
)
∂
w
=
t
e
A
t
∂
(
A
)
∂
w(6) is equivalent to
(9)
∂
W
C
t
∂
w
=
∫
0
t
(
τ
e
A
1
τ
∂
(
A
1
)
∂
w
B
e
A
2
τ
+
e
A
1
τ
B
τ
e
A
2
τ
∂
(
A
2
)
∂
w
)
d
τ
=
∫
0
t
τ
e
A
1
τ
(
∂
(
A
1
)
∂
w
B
)
e
A
2
τ
d
τ
+
∫
0
ρ
τ
e
A
1
τ
B
e
A
2
τ
d
τ
·
∂
(
A
2
)
∂
w
.Two different integration terms are contained in (9), and these two terms can be summarized to the computation of integration as follows:
(10)
W
C
1
t
=
∫
0
t
τ
e
A
1
τ
P
e
A
2
τ
d
τ
,in which the dimensions ofP and B are equivalent. As long as (10) is solved, the partial derivative of Gram matrix corresponding to (9) will be solved. Therefore, take (10) as example to illustrate the computation of partial derivative matrix in the following.


## 2.3. Precise Integration Method for Computation of Gram Matrix

Now the problem is to compute (4) using precise integration method. A basic time step, denoted as η, is necessary to be given for the numerical integration. The following relationship is satisfied:
(11)
t
0
=
0
,
t
1
=
η
,
…
,
t
k
=
k
η
,
t
k
+
1
=
(
k
+
1
)
η
,
…
.According to (4), it can be obtained that between two Gram matrices, at any time t
k
=
k
·
η  (
k
=
0,1
,
2
,
…
) and the next interval t
k
+
1
=
t
k
+
η, the following relationship is satisfied:
(12)
W
C
k
+
1
=
W
C
k
+
e
A
1
t
k
∫
0
η
e
A
1
τ
B
e
A
2
τ
d
τ
·
e
A
2
t
k
=
W
C
k
+
e
A
1
t
k
·
W
C
η
·
e
A
2
t
k
.Therefore, the problem is transformed to computeW
C
η. Next, the precise integration method for W
C
η will be given. According to the key point of precise integration method, the corresponding additional theorem is derived:
(13)
W
C
η
=
∫
0
η
e
A
1
τ
B
e
A
2
τ
d
τ
,
(14)
W
C
2
η
=
∫
0
2
η
e
A
1
τ
B
e
A
2
τ
d
τ
=
∫
0
η
e
A
1
τ
B
e
A
2
τ
d
τ
+
∫
η
2
η
e
A
1
τ
B
e
A
2
τ
d
τ
=
W
C
η
+
∫
0
η
e
A
1
η
e
A
1
τ
′
B
e
A
2
τ
′
e
A
2
η
d
τ
′
=
W
C
η
+
φ
1
(
η
)
∫
0
η
e
A
1
τ
′
B
e
A
2
τ
′
d
τ
′
·
φ
2
(
η
)
=
W
C
η
+
φ
1
(
η
)
W
C
η
φ
2
(
η
)
.Equation (14) is the main key point of precise integration method. According to this equation, take ρ as precise interval to divide the basic interval η:
(15)
ρ
=
η
2
N
.
N is the weighting coefficient of matrix A; generally the computational results are accurate enough when N
=
20 [18, 29]; that is to say ρ
=
η
/
1048576. η is a small time interval, and ρ is an extremely small time interval. Hence for the interval, the truncated Taylor expansion is applied with high precision:
(16)
W
C
ρ
=
∫
0
ρ
e
A
1
τ
B
e
A
2
τ
d
τ
=
∑
k
=
0
∞
∑
m
=
0
∞
∫
0
ρ
A
1
k
τ
k
B
A
2
m
τ
m
k
!
m
!
d
τ
=
∑
k
=
0
∞
∑
m
=
0
∞
A
1
k
B
A
2
m
ρ
k
+
m
+
1
k
!
m
!
(
k
+
m
+
1
)
≈
B
ρ
+
ρ
2
(
B
A
2
2
+
A
1
B
2
)
+
ρ
3
(
B
A
2
2
6
+
A
1
B
A
2
3
+
A
1
2
B
6
)
+
ρ
4
(
B
A
2
3
24
+
A
1
B
A
2
2
8
+
A
1
2
B
A
2
8
+
A
1
3
B
24
)
(17)
φ
1
(
2
)
(
ρ
)
=
exp
⁡
(
A
1
(
2
)
ρ
)
=
∑
k
=
0
∞
A
1
(
2
)
k
ρ
k
k
!
≈
I
+
(
A
1
(
2
)
ρ
)
+
(
A
1
(
2
)
ρ
)
2
2
+
(
A
1
(
2
)
ρ
)
3
6
+
(
A
1
(
2
)
ρ
)
4
24
=
I
+
φ
1
(
2
)
′
(
ρ
)
.Considering thatρ is very small, the first five term series expansion should be enough. Theoretically, the solution at basic interval will be obtained through merge operations N times as described by (14). But it can be seen from (17) that φ
1
(
ρ
) and φ
2
(
ρ
) both depart from the unit matrix I to a very small extent. And φ
1
(
2
)
′
(
ρ
) is extremely small; if it is added to the unit matrix I, it will become an appended part and its precision will be seriously dropped in the round-off operation in computer arithmetic. In order to avoid the resulting loss of accuracy, the increment φ
1
(
2
)
′
(
ρ
) and the unit matrix I should be separated, and φ
1
(
2
)
′
(
ρ
) is kept in the memory rather than the matrix φ
1
(
2
)
(
ρ
). So, (14) is rewritten into the following form of incremental part φ
1
(
2
)
′
(
ρ
):
(18)
W
C
2
ρ
=
W
C
ρ
+
(
I
+
φ
1
′
(
ρ
)
)
W
C
ρ
(
I
+
φ
2
′
(
ρ
)
)
.So at each step, attention will be focused on the incremental, rather than the whole amount; the precision loss caused by computer rounding operation will be avoided. And this is the second key point of precise integration method.


## 2.4. Precise Integration Method for Computation of Partial Derivative Matrix

The strategy of precise integration method will be used to deal withW
C
1
t. The corresponding additional theorem is derived firstly:
(19)
W
C
1
2
ρ
=
∫
0
2
ρ
τ
e
A
1
τ
P
e
A
2
τ
d
τ
=
∫
0
ρ
τ
e
A
1
τ
P
e
A
2
τ
d
τ
+
∫
ρ
2
ρ
τ
e
A
1
τ
P
e
A
2
τ
d
τ
=
W
C
1
ρ
+
∫
ρ
2
ρ
τ
e
A
1
τ
P
e
A
2
τ
d
τ
=
W
C
1
ρ
+
∫
0
ρ
τ
e
A
1
ρ
e
A
1
τ
P
e
A
2
τ
e
A
2
ρ
d
τ
+
∫
0
ρ
ρ
e
A
1
ρ
e
A
1
τ
P
e
A
2
τ
e
A
2
ρ
d
τ
=
W
C
1
ρ
+
φ
1
(
ρ
)
W
C
1
ρ
φ
2
(
ρ
)
+
ρ
φ
1
(
ρ
)
W
C
ρ
φ
2
(
ρ
)
.In the above expression,φ
1
(
ρ
),  W
C
(
ρ
), and φ
2
(
ρ
) can refer to the preview results. For W
C
1
(
ρ
), finite Taylor expansion can be used to approximate
(20)
W
C
1
ρ
=
∫
0
ρ
τ
e
A
1
τ
P
e
A
2
τ
d
τ
=
∑
k
=
0
∞
∑
m
=
0
∞
∫
0
ρ
τ
A
1
k
τ
k
P
A
2
m
τ
m
k
!
m
!
d
τ
=
∑
k
=
0
∞
∑
m
=
0
∞
A
1
k
P
A
2
m
ρ
k
+
m
+
2
k
!
m
!
(
k
+
m
+
2
)
≈
ρ
2
P
2
+
ρ
3
(
P
A
2
3
+
A
1
P
3
)
+
ρ
4
(
P
A
2
2
8
+
A
1
P
A
2
4
+
A
1
2
P
8
)
+
ρ
5
(
P
A
2
3
30
+
A
1
P
A
2
2
10
+
A
1
2
P
A
2
10
+
A
1
3
P
30
)
.
The incremental form of the additional theorem is
(21)
W
C
1
2
ρ
=
W
C
1
ρ
+
(
I
+
φ
1
′
(
ρ
)
)
W
C
1
ρ
(
I
+
φ
2
′
(
ρ
)
)
+
ρ
(
I
+
φ
1
′
(
ρ
)
)
W
C
ρ
(
I
+
φ
2
′
(
ρ
)
)
.Now, the numerical solution ofW
C
1
t is obtained using precise integration method according to (21); therefore, the exact numerical solution of partial derivatives of Gram matrix can be obtained. Since the dimensions of P and B are equivalent, their values do not affect the specific verification. Therefore, in the numerical examples of the next section, calculations are based on P
=
B.


## 2.5. Programming Flow Chart of the Method

Take the computation of Gram matrix at basic intervalη as example, the programming flow chart is given in Figure 1.Figure 1
The block diagram of the method.The amount of computation mainly focuses on matrix multiplication [29] and contains two parts: one is the computation of initial basic interval, and another isNtimes merging during the addition theorem. The amount of computation is about O
[
(
N
+
q
-
1
)
n
3
+
(
N
+
q
-
1
)
m
n
2
], in which N is the weighting coefficient of matrix A (see (15)),q represents the order of Taylor expansion series (see (16), (17)),m is number of columns of matrix B
, and n is order of matrix A.


## 3. Numerical Examples

In this section, we verify the method presented in the preceding section with three numerical examples.Example 1.
The system matrix isa
=
[
-
1
],  b
=
[
1
]; the integration time gradually increases with increments of 0.2 s; compute Gram matrices W
C
t and W
C
1
t.
According to(22)
W
C
t
=
∫
0
t
e
A
1
τ
B
e
A
2
τ
d
τ
,
W
C
1
t
=
∫
0
t
τ
e
A
1
τ
B
e
A
2
τ
d
τ
,
A
1
=
[
-
1
],  A
2
=
[
-
1
],  B
=
[
1
]as these matrices are all of one-dimensional; the following results can be obtained using the analytical method:
(23)
W
C
t
=
1
-
e
-
2
t
2
,
W
C
1
t
=
1
4
-
2
t
+
1
4
e
2
t
.
Using the precise integration method above, takingN
=
20, numerical solutions of W
C
t and W
C
1
t can be obtained. Compared with the analytical solution and calculating the errors, the results are shown in Tables 1 and 2.
From the data of tables, it can be seen that the difference between the result using method described in this paper and using analytical method is very small, so the numerical solution can be seen as the exact solution on the computer. Meanwhile, as the system is stable (poles are in the left half-plane), the steady-state value of Gram matrix can be calculated by using built-in functions gram () in MATLAB. In this example, this steady state value is 0.5. From Table1, it can be seen that W
C
(
t
) is increasing with the increase of time t and gradually approaching to the steady state value. When the timet iterates to t = 10 s, W
C
(
t
) almost equals to the steady-state value. It also verifies the validity and effectiveness of the proposed method in this paper from another way.Table 1
Analytical solution and numerical solution using precise integration method ofW
C
t.
Time/s
t
=
0.2
t
=
0.4
t
=
0.6
t
=
0.8
t
=
1.0
t
=
10
Analytical solution
1
-
e
-
0.4
2
1
-
e
-
0.8
2
1
-
e
-
1.2
2
1
-
e
-
1.6
2
1
-
e
-
2.0
2
1
-
e
-
20
2
Numerical solution
0.1648399769821804
0.2753355179413893
0.3494028940438990
0.3990517410026724
0.4323323583816937
0.4999999989694231
Absolute error (×10−17)
4.211244565981330
6.964767980438173
6.327555838522091
8.193205378981371
0.5211907116443345
9.037574721516070Table 2
Analytical solution and numerical solution using precise integration method ofW
C
1
t.
Time/s
t
=
0.2
t
=
0.4
t
=
0.6
t
=
0.8
t
=
1.0
Analytical solution
1
4
-
7
20
e
0.4
1
4
-
9
20
e
0.8
1
4
-
11
20
e
1.2
1
4
-
13
20
e
1.6
1
4
-
15
20
e
2
Numerical solution
0.01538798388752625
0.04780196614725030
0.08434318344828887
0.1187672633034740
0.1484985375725405
Absolute error (×10−17)
0.6580362078975456
1.966176961971875
1.964307811561096
2.324494307987107
1.99377149409639Example 2.
The system matrix is=
[
0
0
0
1
],  b
=
[
1
1
]; the integration timetis taken as 0.2 s and 0.4 s, respectively, compute Gram matrixW
C
tandW
C
1
t.
According to(24)
W
C
t
=
∫
0
t
e
A
1
τ
B
e
A
2
τ
d
τ
,
W
C
1
t
=
∫
0
t
τ
e
A
1
τ
B
e
A
2
τ
d
τ
,
A
1
=
[
0
0
0
1
],  A
2
=
[
0
0
0
1
],  B
=
[
1
1
]; these matrix are of two-dimensional, and system matrix is singular that is different from the previous example. The following results can be obtained using analytical method:
(25)
W
C
t
=
[
t
e
t
-
1
e
t
-
1
e
2
t
-
1
2
]
,
W
C
1
t
=
[
t
2
2
e
t
(
t
-
1
)
+
1
e
t
(
t
-
1
)
+
1
e
2
t
(
2
t
-
1
)
-
1
4
]
.
With the precise integration method, takingN
=
20, numerical solutions of W
C
t and W
C
1
t can be obtained. Compared with the analytical solution, the results are shown in Tables 3 and 4.
System matrixa is singular and the corresponding system is also unstable (the corresponding poles are p
1
=
0 and p
2
=
1, resp., p
2 is in the right half-plane); built-in functions gram () in MATLAB cannot be used to calculate the steady value. However, from the data in Tables 3 and 4, it can be seen that in this case methods described herein can also obtain very favorable effect, compared with the analytical method, up to ten or more significant digits. Therefore, in many cases, when other methods are unable to solve, the advantages of the method proposed in this paper are very obvious.Table 3
Analytical solution and numerical solution using precise integration method ofW
C
t.
Time/s
t
=
0.2
t
=
0.4
Analytical solution
[
0.2000000000000000
0.2214027581601699
0.2214027581601699
0.2459123488206352
]
[
0.4000000000000000
0.4918246976412704
0.4918246976412704
0.6127704642462339
]
Numerical  solution
[
0.2000000000000000
0.2214027581601699
0.2214027581601699
0.2459123488206353
]
[
0.4000000000000000
0.4918246976412705
0.4918246976412705
0.6127704642462341
]
Absolute error (×10−16)
[
0
-
0.2775557561562891
-
0.2775557561562891
-
1.387778780781446
]
[
0
-
1.110223024625157
-
1.110223024625157
-
1.110223024625157
]Table 4
Analytical solution and numerical solution using precise integration method ofW
C
1
t.
Time/s
t
=
0.2
t
=
0.4
Analytical solution
[
0.02000000000000000
0.02287779347186403
0.02287779347186403
0.02622629535380947
]
[
0.8000000000000000
0.1049051814152379
0.1049051814152379
0.1387229535753766
]
Numerical solution
[
0.02000000000000000
0.02287779347186414
0.02287779347186414
0.02622629535380947
]
[
0.08000000000000000
0.1049051814152378
0.1049051814152378
0.1387229535753767
]
Absolute error (×10−16)
[
0
-
1.110223024625157
-
1.110223024625157
-
0.06938893903907228
]
[
0
0.2775557561562891
0.2775557561562891
-
0.8326672684688674
]Example 3.
In this example, the method is applied to a positioning gantry system, as shown in Figure2. The model specification and parameters described in the following refer to paper [28]. In this model, a mass M is connected to a fixed surface by a linear spring with constant K
s. A flexible inelastic belt is connected to the mass and wraps around a pulley with radius r, which is mounted on a DC motor with armature resistance R
a and motor constant K
t. It is assumed that the rotor inertia of the motor and the inertia of the pulley are negligible. The motor will be actuated by a voltage signal. The displacement of the mass from its original position is Z. The system can be modeled by the following equations [28]:
(26)
x
˙
=
a
x
+
b
u
,
a
=
[
0
1
-
k
m
-
b
m
]
,
b
=
[
0
1
m
]
,
where the terms m,  b, and k are given by [28]
(27)
m
=
M
r
R
a
K
t
,
b
=
K
t
r
,
k
=
K
s
r
R
a
K
t
.
According to (4), using the values shown in Table 2.1 in page 29 of [28], Gram matrix W
C
t can be calculated with the method proposed previews, and its results were also given by (3.21)–(3.25) in page 47-48 of [28]. Both of them are listed in Table 5.
From the data of Table5, it can be seen that for positioning gantry system, the difference between the results is very small. This indicates that this method is effective.Table 5
Comparison of the results.
t
=
0
.
5
Reference [28]
[
6.541649458854454
×
1
0
-
8
2.434956479172767
×
1
0
-
11
2.434956479172767
×
1
0
-
11
2.400278326897477
×
1
0
-
5
]
Method in this paper
[
6.542020950535066
×
1
0
-
8
2.434956479158631
×
1
0
-
11
2.434956479158631
×
1
0
-
11
2.455144469453847
×
1
0
-
5
]
Absolute error
[
3.714916806121008
×
1
0
-
12
-
1.413541806928020
×
1
0
-
22
-
1.413541806928020
×
1
0
-
22
5.486614255637052
×
1
0
-
7
]Figure 2
Configuration of positioning gantry [28].


## 4. Conclusions

This paper proposes a method using the key idea of precise integration for linear time-invariant systems to deal with the Gram matrix and its partial derivative matrix; accuracy can be compared with the exact solution in computer, the high efficiency due to making full use of the homogeneity of linear system to time, namely time-invariant properties of dynamic equation to the translation of time coordinate, and suitable for2
N algorithm. To achieve high accuracy of results, the time is divided as small as possible. And since the method focuses on calculating the part of incremental, avoid numerical morbidity caused by large number eating decimal value. Besides, this method does not require matrix inversion, so no matter the system is singular or unstable, it can also compute correctly and effectively.The approach is suitable for linear time-invariant system, but nonlinear and time-varying systems are much more in real life. The computation of Gram matrix and its partial derivative cannot be neglected in these cases. Methods described above bring a basis for these difficult tasks. Some kind of approximation needs to be introduced in precise integration method, such as perturbation method or making use of analytical functions to approximate. As some technique problems still remain, further research and discussions are needed on this issue.



---

*Source: 134604-2014-04-22.xml*