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.
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 Section 2, 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˙=ax+bu,y=cx,
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 WCt and observability matrix WOt; they are defined as
(2)WCt=∫0teaτbbTeaTτdτ,(3)WOt=∫0teaTτcTceaτdτ.
If WCt and WOt are nonsingular separately, the relevant system is completely controllable and observable. Considering that WCt and WOt have the similar form, therefore take WCt as example to illustrate the computation of Gram matrix using precise integration method. To facilitate the derivation, supposing that A1=a, A2=aT, B=bbT, then Gram matrix corresponding to (2) is equivalent to the following forms:
(4)WCt=∫0teA1τBeA2τdτ.
In case the system corresponding to (1) is stable, then with the increasing of time t, WCt will converge to a constant value, that is to say limt→∞∫0teA1τBeA2τ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 matrix a are functions of a variable, the resulting Gram matrix WCt 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)WCt=∫0teA1(w)τBeA2(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)∂WCt∂w=∂(∫0teA1(w)τBeA2(w)τdτ)∂w.
Therefore, make the following processing:
(7)∂WCt∂w=∫0t∂(eA1(w)τBeA2(w)τ)∂wdτ=∫0t(∂(eA1τ)∂wBeA2τ+eA1τB∂(eA2τ)∂w)dτ.
According to the following relationship:
(8)∂(eAt)∂w=teAt∂(A)∂w
(6) is equivalent to
(9)∂WCt∂w=∫0t(τeA1τ∂(A1)∂wBeA2τ+eA1τBτeA2τ∂(A2)∂w)dτ=∫0tτeA1τ(∂(A1)∂wB)eA2τdτ+∫0ρτeA1τBeA2τdτ·∂(A2)∂w.
Two different integration terms are contained in (9), and these two terms can be summarized to the computation of integration as follows:
(10)WC1t=∫0tτeA1τPeA2τdτ,
in which the dimensions of P 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)t0=0,t1=η,…,tk=kη,tk+1=(k+1)η,….
According to (4), it can be obtained that between two Gram matrices, at any time tk=k·η(k=0,1,2,…) and the next interval tk+1=tk+η, the following relationship is satisfied:
(12)WCk+1=WCk+eA1tk∫0ηeA1τBeA2τdτ·eA2tk=WCk+eA1tk·WCη·eA2tk.
Therefore, the problem is transformed to compute WCη. Next, the precise integration method for WCη will be given. According to the key point of precise integration method, the corresponding additional theorem is derived:
(13)WCη=∫0ηeA1τBeA2τdτ,(14)WC2η=∫02ηeA1τBeA2τdτ=∫0ηeA1τBeA2τdτ+∫η2ηeA1τBeA2τdτ=WCη+∫0ηeA1ηeA1τ′BeA2τ′eA2ηdτ′=WCη+φ1(η)∫0ηeA1τ′BeA2τ′dτ′·φ2(η)=WCη+φ1(η)WCηφ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)ρ=η2N.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)WCρ=∫0ρeA1τBeA2τdτ=∑k=0∞∑m=0∞∫0ρA1kτkBA2mτmk!m!dτ=∑k=0∞∑m=0∞A1kBA2mρk+m+1k!m!(k+m+1)≈Bρ+ρ2(BA22+A1B2)+ρ3(BA226+A1BA23+A12B6)+ρ4(BA2324+A1BA228+A12BA28+A13B24)(17)φ1(2)(ρ)=exp(A1(2)ρ)=∑k=0∞A1(2)kρkk!≈I+(A1(2)ρ)+(A1(2)ρ)22+(A1(2)ρ)36+(A1(2)ρ)424=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)WC2ρ=WCρ+(I+φ1′(ρ))WCρ(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 with WC1t. The corresponding additional theorem is derived firstly:
(19)WC12ρ=∫02ρτeA1τPeA2τdτ=∫0ρτeA1τPeA2τdτ+∫ρ2ρτeA1τPeA2τdτ=WC1ρ+∫ρ2ρτeA1τPeA2τdτ=WC1ρ+∫0ρτeA1ρeA1τPeA2τeA2ρdτ+∫0ρρeA1ρeA1τPeA2τeA2ρdτ=WC1ρ+φ1(ρ)WC1ρφ2(ρ)+ρφ1(ρ)WCρφ2(ρ).
In the above expression, φ1(ρ), WC(ρ), and φ2(ρ) can refer to the preview results. For WC1(ρ), finite Taylor expansion can be used to approximate
(20)WC1ρ=∫0ρτeA1τPeA2τdτ=∑k=0∞∑m=0∞∫0ρτA1kτkPA2mτmk!m!dτ=∑k=0∞∑m=0∞A1kPA2mρk+m+2k!m!(k+m+2)≈ρ2P2+ρ3(PA23+A1P3)+ρ4(PA228+A1PA24+A12P8)+ρ5(PA2330+A1PA2210+A12PA210+A13P30).
The incremental form of the additional theorem is
(21)WC12ρ=WC1ρ+(I+φ1′(ρ))WC1ρ(I+φ2′(ρ))+ρ(I+φ1′(ρ))WCρ(I+φ2′(ρ)).
Now, the numerical solution of WC1t 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.
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)n3+(N+q-1)mn2], 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 is a=[-1], b=[1]; the integration time gradually increases with increments of 0.2 s; compute Gram matrices WCt and WC1t.
According to
(22)WCt=∫0teA1τBeA2τdτ,WC1t=∫0tτeA1τBeA2τdτ,A1=[-1], A2=[-1], B=[1]as these matrices are all of one-dimensional; the following results can be obtained using the analytical method:
(23)WCt=1-e-2t2,WC1t=14-2t+14e2t.
Using the precise integration method above, taking N=20, numerical solutions of WCt and WC1t 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 Table 1, it can be seen that WC(t) is increasing with the increase of time t and gradually approaching to the steady state value. When the time t iterates to t = 10 s, WC(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.
Analytical solution and numerical solution using precise integration method of WCt.
Time/s
t=0.2
t=0.4
t=0.6
t=0.8
t=1.0
t=10
Analytical solution
1-e-0.42
1-e-0.82
1-e-1.22
1-e-1.62
1-e-2.02
1-e-202
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.037574721516070
Analytical solution and numerical solution using precise integration method of WC1t.
Time/s
t=0.2
t=0.4
t=0.6
t=0.8
t=1.0
Analytical solution
14-720e0.4
14-920e0.8
14-1120e1.2
14-1320e1.6
14-1520e2
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.99377149409639
Example 2.
The system matrix is =[0001], b=[11]; the integration timetis taken as 0.2 s and 0.4 s, respectively, compute Gram matrixWCtandWC1t.
According to
(24)WCt=∫0teA1τBeA2τdτ,WC1t=∫0tτeA1τBeA2τdτ,A1=[0001], A2=[0001], B=[11]; 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)WCt=[tet-1et-1e2t-12],WC1t=[t22et(t-1)+1et(t-1)+1e2t(2t-1)-14].
With the precise integration method, taking N=20, numerical solutions of WCt and WC1t can be obtained. Compared with the analytical solution, the results are shown in Tables 3 and 4.
System matrix a is singular and the corresponding system is also unstable (the corresponding poles are p1=0 and p2=1, resp., p2 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.
Analytical solution and numerical solution using precise integration method of WCt.
In this example, the method is applied to a positioning gantry system, as shown in Figure 2. 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 Ks. 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 Ra and motor constant Kt. 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˙=ax+bu,a=[01-km-bm],b=[01m],
where the terms m, b, and k are given by [28]
(27)m=MrRaKt,b=Ktr,k=KsrRaKt.
According to (4), using the values shown in Table 2.1 in page 29 of [28], Gram matrix WCt 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 Table 5, it can be seen that for positioning gantry system, the difference between the results is very small. This indicates that this method is effective.
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 for 2N 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.
Conflict of Interests
The authors declare that there is no conflict of interests regarding the publication of this paper.
Acknowledgments
This project is supported by National Natural Science Foundation of China (nos. 51305321 and 51035006) and the Fundamental Research Funds for the Central Universities (nos. K5051304021 and K5051304026). These supports are gratefully acknowledged. Many thanks are due to the editor, associate editor, and reviewers for their informative, valuable, and constructive comments.
SkogestadS.PostlethwaiteI.JainV. K.GuptaR. D.Identification of linear systems through a Grammian techniqueKorresG. N.A gram matrix-based method for observability restorationde AlmeidaM. C.GarciaA. V.AsadaE. N.Active and reactive observability restoration subproblems in generalized power system state estimationProceedings of the 6th Power Systems Computation Conference (PSCC '08)July 2008Glasgow, UK18KorresG. N.A numerical algorithm for observability analysis based on Gram matrixProceedings of the 7th Mediterranean Conference and Exhibition on Power Generation, Transmission, Distribution and Energy ConversionNovember 2010Ayia Napa, Cyprus133138KorresG. N.ManousakisN. M.State estimation and observability analysis for phasor measurement unit measured systemsde AlmeidaM. C.AsadaE. N.GarciaA. V.A numerical method for finding spanning trees in power system state estimationProceedings of the International Conference on Power System Technology (PowerCon '06)October 2006Chongqing, China162-s2.0-4354911140610.1109/ICPST.2006.321731de AlmeidaM. C.AsadaE. N.GarciaA. V.On the use of Gram matrix in observability analysisde AlmeidaM. C.AsadaE. N.GarciaA. V.Power system observability analysis based on gram matrix and minimum norm solutionde AlmeidaM. C.AsadaE. N.GarciaA. V.Identifying critical sets in state estimation using Gram matrixProceedings of the IEEE Bucharest PowerTechJuly 2009Bucharest, Romania152-s2.0-7494910069810.1109/PTC.2009.5282077SreeramV.YongK. S.Evaluation of Gram matrix diagonal elements using inners techniqueSreeramV.AgathoklisP.On the computation of the Gram matrix in time domain and its applicationSreeramV.AgathoklisP.The computation of Gram matrix via impulse-response GrammiansProceedings of the American Control ConferenceJune 1991Boston, Mass, USA7277282-s2.0-0026397979SreeramV.AgathoklisP.The computation of Gram matrix via the solution of Lyapunov equationProceedings of the 30th IEEE Conference on Decision and ControlDecember 1991Brighten, UK209220932-s2.0-0026399358TelescuM.TanguyN.BréhonnetP.VilbéP.Efficient Gram-matrix computation for irrational resonant systems using Kautz modelsTelescuM.BréhonnetP.TanguyN.VilbéP.CalvezL. C.Orthogonal decomposition of derivatives and antiderivatives for easy evaluation of extended Gram matrixPangJ.DuY.HuP.LiW.MaZ. D.An energy conservation algorithm for nonlinear dynamic equationZhongW. X.WilliamsF. W.Precise time step integration methodWanxieZ.Precise computation for transient analysisLinJ. H.ShenW. P.WilliamsF. W.Accurate high-speed computation of non-stationary random structural responseLinJ. H.ShenW. P.WilliamsF. W.A high precision direct integration scheme for structures subjected to transient dynamic loadingGuY. X.ChenB. S.ZhangH. W.Precise time integration with dimension expanding methodShujunT.WanxieZ.Precise integration method for Duhamel terms arising from non-homogenous dynamic systemsWan-XieZ.On precise integration methodWangM.AuF. T. K.Assessment and improvement of precise time step integration methodWangM. F.AuF. T. K.On the precise integration methods based on Padé approximationsLiuQ.ZhangJ.YanL.A numerical method of calculating first and second derivatives of dynamic response based on Gauss precise time step integration methodPetersD. L.ShujuT.