<<

Balancing Skew-Hamiltonian/Hamiltonian Pencils With Applications in Control Engineering

Vasile Sima National Institute for Research & Development in Informatics, 8–10 Bd. Mares¸al Averescu, Bucharest, Romania

Keywords: Deflating Subspaces, Generalized Eigenvalues, Numerical Methods, Skew-Hamiltonian/Hamiltonian Pencil, Software, Structure-preservation.

Abstract: Badly-scaled matrix pencils could reduce the reliability and accuracy of computed results for many numeri- cal problems, including computation of eigenvalues and deflating subspaces, which are needed in many key procedures for optimal and H∞ control, model reduction, spectral factorization, and so on. Standard balancing techniques can improve the results in many cases, but there are situations when the solution of the scaled problem is much worse than that for the unscaled problem. This paper presents a new structure-preserving balancing technique for skew-Hamiltonian/Hamiltonian matrix pencils, and illustrates its good performance in solving eigenvalue problems and algebraic Riccati equations for large sets of examples from well-known benchmark collections with difficult examples.

1 INTRODUCTION Jiang and Voigt, 2013), and the references therein. Quite often, the pencil matrices have large norms Computing eigenvalues and bases of certain associ- and elements with highly different magnitude. Such ated invariant or deflating subspaces of matrices or pencils imply potential numerical difficulties for matrix pencils is central to various numerical tech- software implementations of eigensolvers, with niques in control engineering and other domains. negative consequences on the reliability and accuracy When the corresponding eigenproblems have special of the results, see, e.g., (Sima and Benner, 2015a). structure, implying structural properties of their spec- Balancing procedures can be used to improve the tra, it is important to use structure-preserving and/or numerical behavior. Ward (1981) proposed a bal- structure-exploiting algorithms. General numerical ancing technique for general matrix pencils, which algorithms cannot ensure that the theoretical prop- has been incorporated in state-of-the-art software erties are preserved during computations (Paige and packages, such as LAPACK (Anderson et al., 1999). Van Loan, 1981; Van Loan, 1984; Kressner, 2005). (This will be referred below as standard balancing.) Common special structures are Hamiltonian and sym- The data matrices are preprocessed by equivalence plectic matrices or matrix pencils, which are encoun- transformations, in two optional stages: the first tered in optimal or H∞ control (e.g., solution of alge- stage uses permutations to find isolated eigenvalues braic Riccati equations, or evaluation of the H∞- and (which are available by inspection, with no rounding L∞-norms of linear dynamic systems), spectral factor- errors), and the second stage uses diagonal scaling ization, model reduction, etc., see, for instance, (Bru- transformations to make the row and corresponding insma and Steinbuch, 1990; Laub, 1979; Mehrmann, column 1-norms as close as possible. Balancing 1991; Sima, 1996). While structured matrices are en- may reduce the 1-norm of the scaled matrices, but countered for standard linear dynamic systems, gen- there is no guarantee in general. This is the reason eralized and descriptor systems may involve struc- why full balancing is either avoided or provided as tured matrix pencils. Often such pencils can be re- an option in the LAPACK subroutines; some expert cast as skew-Hamiltonian/Hamiltonian pencils, for driver routines, such as DGEES, DGEESX, DGGES, which dedicated algorithms have been developed, see DGGESX, and DGGEV use permutations only, while e.g., (Benner et al., 2007; Benner et al., 2002; Ben- other drivers, e.g., DGEEVX and DGGEVX, have an ner et al., 2005; Benner et al., 2012a; Benner et al., input argument allowing either permutations, scaling, 2012b; Benner et al., 2013a; Benner et al., 2013b; both permutations and scaling, or no balancing at all.

177

Sima, V. Balancing Skew-Hamiltonian/Hamiltonian Pencils - With Applications in Control Engineering. DOI: 10.5220/0005981201770184 In Proceedings of the 13th International Conference on Informatics in Control, Automation and Robotics (ICINCO 2016) - Volume 1, pages 177-184 ISBN: 978-989-758-198-4 Copyright c 2016 by SCITEPRESS – Science and Technology Publications, Lda. All rights reserved

ICINCO 2016 - 13th International Conference on Informatics in Control, Automation and Robotics

A structure-preserving balancing technique for transformation to isolate eigenvalues in the elements Hamiltonian matrices has been developed in (Benner, 1 : ℓ 1 and n+1 : n+ℓ 1 on the diagonals of S and 2001), but no special procedure has been available H , and− in a second step,− applying a diagonal equiva- for skew-Hamiltonian/Hamiltonian matrix pencils. lence transformation to rows and columns ℓ : n and This paper presents a new, structure-preserving n + ℓ :2n, to make the rows and columns as close balancing procedure for skew-Hamiltonian/Hamil- in 1-norm as possible. (A MATLAB-style notation tonian pencils, and illustrates its performance for for array indexing (MATLAB, 2016) is used.) Both some control engineering applications, in comparison steps above are optional. Balancing may reduce the with the general approach, and with the case when 1-norms of the matrices S and H . no balancing is used. This procedure includes several Note that it is enough to equilibrate the 1-norms optional enhancements which allow to get meaning- of the rows and columns 1:n of the matrices S and H , ful results when standard balancing (possibly even a since Si+n,: p = S:,i p and S:,i+n p = Si,: p, for structured variant) fails, as shown for some numerical any p-norm,k k for p k 1,k and similarlyk k for H k(seek (Ben- examples. ner, 2001)). The≥ balancing procedure performs the following transformation:

2 BALANCING S = LSR , H = LHR , (3) where SKEW-HAMILTONIAN/ e e T T HAMILTONIAN PENCILS L = Ln LℓPℓ 1 P1 , R = P1 Pℓ 1Rℓ Rn, ··· − ··· ··· − ··· (4) α β Let S H be a complex skew-Hamiltonian/ where Pk, k = 1 : ℓ 1, are symplectic permutation or − α β 2n 2n − Hamiltonian pencil, with , C, S C × a J -permutation matrices (Benner, 2001), and Lk and ∈ 2n ∈2n skew-Hamiltonian matrix and H C × a Hamil- R are left and right diagonal scaling matrices (with ∈ k tonian matrix, i.e., Lk(k,k), Lk(k+n,k+n), Rk(k,k), and Rk(k+n,k+n) the only diagonal elements different from 1), chosen 0 In (SJ )H = SJ , (H J )H = H J , J := , to equilibrate the 1-norms of the k-th row and col- − In 0  −  umn of S and H , for k = ℓ, ,n. A permutation (1) ··· where MH denotes the conjugate of a ma- matrix has exactly one nonzero entry, which is 1, in J trix M, MH = M¯ T , the overbar denotes the complex each row and column. A - has a conjugate, MT denotes the transpose of M, and I is similar structure, but the nonzero entries may also be n 1. When possible, the permutations are chosen in the of order n. These definitions imply − the following structure for S and H : the form P 0 P = , (5) A D C V 0 P S = H , H = H , (2)   E A W C T    −  where P is an n n permutation matrix (hence, P P = T × T where D and E are skew-Hermitian, i.e., DH = D, PP = In). Clearly, P is symplectic, since PJ P = EH = E, and V and W are Hermitian matrices.− J . As shown in (Benner, 2001), it is generally not When S−and H are real matrices, then D and E are possible to preserve the (skew-)Hamiltonian structure skew-symmetric, V and W are symmetric, the H su- using symplectic permutations only, but symplectic perscript is replaced by T, and some derivations be- J -permutations are also needed. low simplify. Applying a permutation (5) in (3) is easy. Specifi- T T When the matrices S and H are badly scaled, e.g., cally, the transformed matrices become P AP, P DP, T T T T when their elements have moduli with highly differ- P EP, P CP, P VP, and P WP. ent magnitude, the accuracy of computed solutions of Consider applying a J -permutation, P , which has the following structure, defined by an index i, i n, related eigenproblemscan be very poor. The accuracy ≤ may be improved by using a balancing procedure, as Ii 1 0 0 000 described in (Ward, 1981) for general matrix pencils, 0− 0 0 010 and implemented in the LAPACK package (Anderson  0 0 In i 0 0 0  et al., 1999). Similarly to the techniques in (Anderson P = − , (6)  0 0 0 Ii 1 0 0  et al., 1999; Benner, 2001; Ward, 1981), a structure-  −   0 10 000  exploiting balancing procedure for the structured pen-  0− 0 0 00 I   n i  cil matrices in (2) would involve, in a first step,  −  permuting αS βH by a symplectic equivalence to the skew-Hamiltonian matrix S, and Hamiltonian −

178 Balancing Skew-Hamiltonian/Hamiltonian Pencils - With Applications in Control Engineering

matrix H . Using the partition of H in (2), the trans- Then, formed matrix P T H P is LAR LDL 0 In SJ = H RER RA L In 0 ⋆ v1:i 1,i ⋆   −  w − c¯− wH LDL LAR i,1:i 1 ii i+1:n,i e = = (SJ )H , (9)  − − −H − −RAH L RER T ⋆ vi,i+1:n ⋆ − P H P = −H  −   ⋆ ci,1:i 1 ⋆ H H  − since D = D , E = E . Similarly, e  ci,1:i 1 vii ci,i+1:n − −  − H−  ⋆ ci,i+1:n ⋆ LCR LVL 0 In  H J = H  RWR RC L In 0 ⋆ c1:i 1,i ⋆  −  −  H − H LVL LCR c1:i 1,i wii ci+1:n,i e H − −  = − H = (H J ) , (10) ⋆ ci+1:n,i ⋆ RC L RWR H , (7)   ⋆ wi,1:i 1 ⋆  H H e H −  since V = V and W = W . Therefore, the struc- v cii vi i 1:n  1:i 1,i , +  ture of S and H is preserved for the transformation ⋆− w ⋆  i+1:n,i  in (8). Note that the left and right transformations  1 are not symplectic if L = R− , but they are structure- where ⋆ denotes submatrices which do not change. preserving, for diagonal6 L and R. The permutations Matrix S is transformed similarly. used for isolating the eigenvalues must, however, be The permutation procedurefirst scans the columns symplectic. 1 : n and then the rows 1 : n of S and H , and uses As described above, the elementary scaling matri- row and column permutations with matrices of the ces in (4) are, for k = ℓ, ,n, ··· S H form (5) and (6) so that and finally have the Lk = bl diag(Ik 1,lk,In 1,rk,In k), first ℓ 1 columns upper triangular, i.e., with zeros − − − − Rk = bl diag(Ik 1,rk,In 1,lk,In k), (11) below the diagonals. Thise way, thee first ℓ 1 eigen- − − − − values of the pencil are defined by the diagonal ele- where bl diag(X,Y,...) denotes a bloc-diagonal ma- ments1: ℓ 1 in S and H . The upper triangular struc- trix with diagonal blocks X, Y, etc. Note that − ture is built column by column, starting from the first. 1 1 1 L− = P1 Pℓ 1L− Ln− . (12) Therefore, the permutationse e above can take advantage ··· − ℓ ··· of the zero subdiagonal part in the already processed Formula (12) can be used to apply, from the left, the columns. For instance, when a J -permutation (6) is back balancing transformations to a given 2n m ma- 1 × formed and applied, the vectors ci,1:i 1, and wi,1:i 1 trix. Since L− has a formula similar to R , to obtain − − in (7) (and similarly for ai,1:i 1, ei,1:i 1 in S), as well R , one can apply to I2n the transformations in (12), − − as all ⋆ vectors under the diagonals in the first i 1 with scaling factors lk and rk replaced by 1/rk and − columns are already zero. 1/lk, respectively. There is no need for an algorithm The balancing procedure for (skew-)Hamiltonian to apply the right back transformation. matrices must use symplectic scaling matrices as well, A special case of application of the balancing in order to preserve the structure (Benner, 2001). For- transformations appears when computing the solu- tunately, this is not needed for skew-Hamiltonian/Ha- tion of algebraic Riccati equations (AREs) using the miltonian pencils, if diagonal scaling is used, as men- skew-Hamiltonian/Hamiltonian approach, see (Ben- tioned above. Indeed, without loss of generality, con- ner et al., 2013a), and the references therein. This sider that permutations are not wanted, and only scal- approach uses a basis for the stable right deflating subspace of the matrix pencil αS βH , where S ing should be applied. Let L and R be the real diago- − nal matrices which scale the first n rows and the first and H are suitably defined in terms of the dynamic n columns, respectively, of S and H . Since R and L system and performance index matrices. For conve- will be the scaling matrices for the last n rows and nience, assume that S = I2n, whichis thecase forstan- columns, respectively, the global scaling transforma- dard continuous-time dynamic systems, e.g., when tion is the control weighting matrix of the performanceindex is well-conditioned. (The general case will be briefly T T T L 0 A D R 0 described below.) Let U = U1 U2 be a ba- S = H , 0 R E A 0 L sis of the stable right deflating subspace of αS βH ,       corresponding to the balancede pencil.e e The stabilizing− e L 0 C V R 0 H = H . (8) 1 0 R W C 0 L solution of the balanced ARE is given by X =eU2U1−e .   −   e e e e 179 ICINCO 2016 - 13th International Conference on Informatics in Control, Automation and Robotics

Note that U is related to a basis, U, of the stable right zero imaginary parts, but possibly nonzero real parts. deflating subspace of the original pencil, αS βH ,by The implementation takes care of the compact storage 1 1 − T T the transformatione U = bl diag(R− ,L− )U, hence scheme when computing P DP,..., P WP. T T T U1 U2 := U = bl diag(R,L)U. Therefore, Consider a structured pencil, (S,H ), and assume the stabilizing solutione of the original ARE can be that S = I2n. The order of magnitude of the dif-   computed as follows e ferences in size of the nonzero elements in the H 1 1 1 matrix can be huge. For instance, for the CM6 X = U2U − = LU2U − R− . (13) 1 1 and CM6 IS examples from the COMPleib collec- Formula (13) allows to represent and use the solution tion (Leibfritz and Lipinski, 2003), the maximum X in a factored form, whiche maye be useful for nu- and minimum absolute values of the nonzero en- 5 324 merical reasons. If balancing also involves symplec- tries are about 2.53 10 and 4.9407 10− , hence tic permutations of the form (5) only, then the right their ratio is not representable· in the· usual double 1 1 T representation, and it is evaluated as Inf hand side in (13) becomes PLU2U1− R− P , where P denotes here the product of the ℓ 1 permutations (∞). The standard balancing algorithm implemented − performed. Such factorization, is,e however,e not possi- in the LAPACK Library subroutine DGGBAL (for ma- ble if J -permutations are also needed, in which case trix pencils) returns scaling factors covering a very it is necessary to apply the balancing transformations large range of magnitudes, namely with maximum 159 47 before solving the set of linear systems giving X. and minimum values 10 and 10− , respectively, If S is a general matrix, the order of S and H is for both left and right scaling factors. No eigenvalue 2(n+ p), where n is the dimension of the state vector, can be isolated. The scaling transformation matrices, e 206 and p may be chosen as p = m/2 (i.e., p = m/2, if L and R , have condition numbers with values 10 . m is even, and p = (m + 1)/2,⌈ otherwise),⌉ with m the The 1-norms of scaled matrices, H and S, are about number of system inputs. In this case, the computa- 10228 and 10184, respectively, while the 1-norms of tions are similar, but U and U , i = 1,2, refer to the the original H and S are 6.9123e105 ande 1. Com- i i · lines 1 : n and n + p + 1:2n + p of the matrix bases puting the eigenvalues or deflating subspaces using U and U, respectively.e the balanced matrices would return results very far from the true ones. CM6 and CM6 IS are not the only e examples in the COMPleib collection which produce numerical troubles for eigenproblem-related compu- 3 IMPLEMENTATION ISSUES tations. The CM5 and CM5 IS examples have also a huge ratio, 10279, between the magnitudes of their The developed balancing algorithm operates only on elements. Other very large ratios are 10141, for CM4 the matrices A, D, E, C, V, and W, and preserves and CM4 IS, 1072, for CM3 and CM3 IS, or 1037, for the pencil structure. Moreover, the pairs of skew- CM2 and CM2 IS. Hermitian matrices, D and E, and Hermitian matri- ces, V and W , are stored compactly in two n (n+1) The proposed algorithm uses an adaptation of arrays, DE and VW. Specifically, the lower triangle× of the basic LAPACK procedure for finding the scaling E and the upper triangle of D are concatenated along factors, but optionally limits the range of their their main diagonals, and similarly for W and V : variation, possibly via an outer loop. Specifically, the user can set a threshold value, τ; if τ 0, DEi j = ei j, j = 1 : n, i j, ≥ ≥ the entries whose absolute values are smaller than DEi, j+1 = di j, j = 1 : n, i j, τM0, where M0 = max( H (s,s) 1, S(s,s) 1), with ≤ s := ℓ : n n + ℓ : 2n,k are consideredk k negligible,k VWi j = wi j, j = 1 : n, i j, ≥ and do not∪ count for computing the scaling factors. VWi, j+1 = vi j, j = 1 : n, i j. (14) ≤ (For the CM6 and CM6 IS examples, ℓ = 1, and 20 This way, the storage requirements are reduced by setting τ = 10− , all entries with magnitude less 2 15 4n 2n memory locations, in comparison with the than about 7 10− will be taken as zero by the general− algorithm in (Anderson et al., 1999), which procedure.) If·τ < 0 on entry, an outer loop over a set 2 needs 8n storage space for S and H . Note that in of values τi > 0 will enable to select a set of scaling the real case, the diagonal elements of D and E, dii factors which, if possible, ensure the reduction of a and eii, i = 1 : n, which should be zero, by definition, desired norm-related measure for the scaled matri- are not stored and not used. However, in the complex ces. For τ = 1, this measure is the minimum of − case, dii and eii, i = 1 : n, should have zero real parts, maxi( Hi(s,s) 1/ Si(s,s) 1, Si(s,s) 1/ Hi(s,s) 1) k k k k k k k k while the imaginary parts might be nonzero; more- where Hi(s,s) and Si(s,s) are the scaled submatrices over, the diagonal elements of V and W should have corresponding to the threshold τi. This strategy

180 Balancing Skew-Hamiltonian/Hamiltonian Pencils - With Applications in Control Engineering

tries to balance H and S, but also have comparable have been excluded, since eig(sym(H )) needed un- 1-norms. For τ = 2, the same measure is used, but if reasonably large CPU time.) However, the rela- − max( H (s,s) 1, S(s,s) 1) > cM0 and t > T , where tive errors of eig(H ,S), when S = I2n, compared c andkT are givenk k constantsk (c possibly larger than to eig(vpa(H )) and eig(sym(H )), for example PAS 6 6 1), and t is the maximum ratio of the scaling factors have been 1.2798 10− , and 1.4432 10− , respec- e e · · found (the maximum of the condition numbers of tively. Omitting PAS, the norm of the differences L and R ), then the scaling factors are set to 1 and between relative errors of eig(H ,S) compared to 25 a warning indicator is set; here, the matrices with eig(vpa(H )) and eig(sym(H )) was 5.8491 10− . · tilde accent are the solution of the above norm ratio There are 18 examples with ratios between the reduction problem. This approach avoids to obtain magnitude of the largest and smallest moduli of scaled matrices with too large norms, compared to their elements larger than 1016. Besides exam- the given ones, and also limits the range of the scaling ples CM2* – CM6*, this set also includes AC10, factors. For τ = 3, the measure used is the smallest BDT2, PAS, TL, CDP, NN16, ISS1, and ISS2 ex- − product of norms, mini( Hi(s,s) 1 Si(s,s) 1), over amples. Most of these are difficult examples for k k k k the sequence of τi values tried, while for τ = 4, any balancing algorithm, and for generalized eigen- the condition numbers of the scaling transformations− solvers using standard balancing. For instance, for are additionally supervised, and the scaling factors CDP example, even the structure-exploiting skew- are set to 1 if the “optimal” scaling has a condition Hamiltonian/Hamiltonian solver with standard bal- number larger than T . This tends to reduce the ancing, for S = I2n, returns eigenvalues with a relative 1-norms of both matrices. Finally, if τ = 10k, the error of 0.19172 (when compared to eig(H )), and condition numbers of the acceptable scaling− matrices of 0.24788 (when compared to eig(vpa(H )), while are bounded by 10k. the same solver without scaling delivers relative er- 14 14 rors 1.0476 10− and 1.3064 10− , respectively. These values· are close to the· error obtained using 15 4 NUMERICAL RESULTS eig(H ), 4.9248 10− , compared to eig(vpa(H )). The structure-exploiting· solver with balancing option 15 τ < 0 returns a relative error of 5.4838 10− (when An extensive testing has been performed to assess the · 15 compared to eig(H )), and of 3.9091 10− (when performance of the new balancing solver for skew- compared to eig(vpa(H )), even more· accurate than Hamiltonian/Hamiltonian matrix pencils. Computa- eig(H ). tion of eigenvalues, as well as solution of AREs, have Figure 1 shows the relative errors of eigenval- been considered as main applications. This section summarizes part of the results. ues computed using eig(Hl,Sl), where Hl := H , Sl The COMPleib collection (Leibfritz and Lipin- := S, with LAPACK balancing (using DGGBAL) ski, 2003) is taken here as a benchmark for eigen- and eig(H ,S), in comparison with eig(H ) fore 151 value computations. All 151 problems with n < 2000 COMPle eib examples. The error is infinite for CDP, have been tried. For testing purposes, the balancing CM3, CM4, CM3 IS, and CM4 IS examples. There algorithms have been used in combination with the are also several large errors using LAPACK balanc- MATLAB eigensolvers eig(H ), when S = I2n, and ing. However, for many examples, balancing im- eig(H ,S), when S is general, or, for small-size prob- proves the accuracy of the computed eigenvalues. lems, with the symbolic solvers eig(vpa(H )) (with Similar results have been obtained using the struc- default number of digits, i.e., 32), or eig(sym(H )). tured balancing solver with option τ = 0. Specifically, Usually, eig(vpa(H )) and eig(sym(H )) have been except for five examples, the differences between the used for examples with n 200 and n 30, respec- relative errors of eigenvalues computed using LA- tively. Examples with larger≤ orders need≤ significant PACK balancing and the new balancing solver with 3 CPU times for symbolic solvers, e.g., over one hour option τ = 0 have been less than about 3.64 10− . · for CM4 or CM4 IS(n = 240) using vpa, or much Figure 2 shows the relative errors of eigenvalues longer for sym. But a comparison between the eigen- computed using eig(Hl,Sl) with the new balancing values computed by eig(vpa(H )) and eig(sym(H )) solver with option τ = 1 and eig(H ,S), in compari- − has shown a very good agreement between their re- son with eig(H ) for 151 COMPleib examples. There sults. The maximum absolute difference between are no infinite errors. The errors are smaller for many the relative errors of eig(H ) in comparison with examples than when using LAPACK balancing. Note eig(vpa(H )) and eig(sym(H )) for 100 COMPleib that the ordinate axes have different scales. Note also 28 examples with n 30 is 3.0292 10− . (Examples that eig(H ,S) has often larger errors than eig(Hl,Sl) JE2 and JE3, with≤n = 21 and n·= 24, respectively, with the new solver. The behavior for τ = 3has been −

181 ICINCO 2016 - 13th International Conference on Informatics in Control, Automation and Robotics

eig(H,S) and eig(Hl,Sl), after LAPACK balancing compared to eig(H) Structured eigensolver on (H,S), no balancing, and eig(H,S) compared to eig(H) 105 100 eig(H,S) eig(H,S) eig(Hl,Sl) structured eigensolver

100 10-5

10-5

10-10

10-10 Relative errors Relative errors

10-15 10-15

10-20 10-20 0 20 40 60 80 100 120 140 160 0 20 40 60 80 100 120 140 160 Example # Example # Figure 1: Relative errors of eigenvalues computed using Figure 3: Relative errors of eigenvalues computed by eig(Hl,Sl) with LAPACK balancing and eig(H,S), com- SLICOT structured eigensolver without balancing and pared to eig(H), for COMPleib examples. eig(H,S), compared to eig(H), for COMPleib examples.

τ Structured eigensolver (τ = -1) and eig(H,S) compared to eig(H) Structured solver ( = -1) and eig(H,S) compared to eig(H) 0 100 10 eig(H,S) eig(H,S) new solver structured eigensolver

-5 10-5 10

-10 10-10 10 Relative errors Relative errors

-15 10-15 10

-20 10-20 10 0 20 40 60 80 100 120 140 160 0 20 40 60 80 100 120 140 160 Example # Example # Figure 2: Relative errors of eigenvalues computed us- Figure 4: Relative errors of eigenvalues computed by ing eig(Hl,Sl) with new balancing solver, τ = 1, and SLICOT structured eigensolver with balancing, τ = 1, and − − eig(H,S), compared to eig(H), for COMPleib examples. eig(H,S), compared to eig(H), for COMPleib examples.

Structured eigensolver (τ = 0) and eig(H,S) compared to eig(H) almost the same (the maximum differencebetween er- 105 9 eig(H,S) rors for the two options has been of order 10− ). structured eigensolver

Figure 3 illustrates the relative errors of eigen- 100 values of αS + βH , computed using eig and the SLICOT structured eigensolver MB04BD (see 10-5 www.slicot.org), without balancing, in comparison with eig(H ). The structured eigensolver is more ac- 10-10 curate than eig for almost all examples and compa- Relative errors rable with eig for the remaining examples. Figure 4 10-15 uses similarly the structured eigensolver applied to S τ and H , obtained with balancing option = 1. Itcan 10-20 eig− e 0 20 40 60 80 100 120 140 160 provide even more accurate results than (H ,S), Example # see Fig.e 2. For comparison, Fig. 5 shows results for τ Figure 5: Relative errors of eigenvalues computed by option = 0. Clearly, standard balancing does not SLICOT structured eigensolver with balancing, τ = 0, and provide good results in all cases, even using a struc- eig(H,S), compared to eig(H), for COMPleib examples. tured solver. The remaining of this section considers the per- from the SLICOT CAREX collection (Abels and formance of the new balancing solver, in combina- Benner, 1999). This combination is referred to as tion with the structured SLICOT routine MB03LD, skHH in the legends of the following figures. Both to compute the deflating subspaces of skew- pencils of order 2n (with S = I2n) and extended pen- Hamiltonian/Hamiltonian pencils, for solving AREs cils of order 2(n + p) have been tried. The com-

182 Balancing Skew-Hamiltonian/Hamiltonian Pencils - With Applications in Control Engineering

Relative errors to care solution using balancing 100 trices, instead of pencils, for all examples, except skHH for CAREX example 2.2 with default parameter, for which the control weighting matrix tends to be sin- 10-5 gular. This creates an advantage for care over the new solver. However, both solvers produce compa- τ -10 rable results, when the balancing option 1 is 10 = used. See (Sima and Benner, 2015b) for a compari-− Relative errors son between a Hamiltonian-based solver and care for 10-15 CAREX examples. Figure 6 shows the relative errors of the stabiliz- ing solution of the AREs computed using SLICOT 10-20 0 2 4 6 8 10 12 14 16 18 Example # structured eigensolver (for extended pencil), with bal- ancing option τ = 0, in comparison with care, while Figure 6: Relative errors of the stabilizing ARE solutions computed by SLICOT structured eigensolver (for extended Fig. 7 plots similarly the relative errors when option τ care τ = 1 is used. Moreover,Fig. 8 and Fig. 9 present in pencil), with balancing option = 0, compared to , for − examples from the SLICOT CAREX collection. the same manner the relative errors compared to the known, exact solutions. The balancing option τ = 1 Relative errors to care solution using balancing − 10-2 ensures better results than the standard balancing (for skHH τ = 0). Finally, Fig. 10 plots the relative residuals for 10-4 care and the structured solver.

-6 10 Relative errors using balancing 100 10-8

10-5 10-10 Relative errors

-10 -12 10 10

10-14 10-15

-16 Relative errors 10 -20 0 2 4 6 8 10 12 14 16 18 10 Example #

-25 Figure 7: Relative errors of the stabilizing ARE solutions 10 skHH computed by SLICOT structured eigensolver (for 2n-order care τ 10-30 pencil), with option = 1, compared to care, for exam- 0 5 10 15 ples from the SLICOT CAREX− collection. Example # Figure 9: Relative errors of the stabilizing ARE solutions Relative errors using balancing 100 computed by care and SLICOT structured eigensolver (for 2n-order pencil), with option τ = 1, compared to exact so- − 10-5 lution, for examples from the SLICOT CAREX collection.

10-10 Relative residuals using balancing 100

10-15 10-5 Relative errors 10-20

10-10 -25 10 skHH care 10-15 10-30 Relative errors 0 5 10 15 Example # 10-20 Figure 8: Relative errors of the stabilizing ARE solutions skHH computed by care and SLICOT structured eigensolver (for care τ 10-25 extended pencil), with option = 0, compared to exact so- 0 5 10 15 20 25 30 35 lution, for examples from the SLICOT CAREX collection. Example # Figure 10: Relative residuals of the stabilizing ARE so- puted solutions are compared with the exact ones, lutions computed by care and SLICOT structured eigen- when known, or with the solutions returned by the solver (for 2n-order pencil), with option τ = 1, for exam- − MATLAB function care. Note that care uses a ples from the SLICOT CAREX collection. special balancing procedure, and Hamiltonian ma-

183 ICINCO 2016 - 13th International Conference on Informatics in Control, Automation and Robotics

5 CONCLUSIONS Benner, P., Sima, V., and Voigt, M. (2013a). FOR- TRAN 77 subroutines for the solution of skew- Hamiltonian/Hamiltonian eigenproblems. Part I: Al- A new structure-preserving balancing technique for gorithms and applications. SLICOT Working Note skew-Hamiltonian/Hamiltonian matrix pencils is pre- 2013-1. sented. Symplectic (J -)permutations and equivalence Benner, P., Sima, V., and Voigt, M. (2013b). FOR- scaling transformations are used. Several enhance- TRAN 77 subroutines for the solution of skew- ments are described, which avoid a large increase of Hamiltonian/Hamiltonian eigenproblems. Part II: Im- the norms of the pencil matrices, and/or of the con- plementation and numerical results. SLICOT Working dition numbers of the scaling transformations, which Note 2013-2. can appear when using the standard balancing pro- Bruinsma, N. A. and Steinbuch, M. (1990). A fast algo- cedure. The numerical results show a good perfor- rithm to compute the H∞-norm of a transfer function. Systems Control Lett., 14(4):287–293. mance of the new technique in comparison with state- Jiang, P. and Voigt, M. (2013). MB04BV — A FOR- of-the-art solvers. Tens of examples from well-known TRAN 77 subroutine to compute the eigenvectors as- benchmark collections have been investigated. sociated to the purely imaginary eigenvalues of skew- Hamiltonian/Hamiltonian matrix pencils. SLICOT Working Note 2013-3. Kressner, D. (2005). Numerical Methods for General and ACKNOWLEDGEMENTS Structured Eigenvalue Problems. Springer-Verlag, Berlin. The NICONET support is highly acknowledged. Laub, A. J. (1979). A Schur method for solving algebraic Riccati equations. IEEE Trans. Automat. Contr., AC– 24(6):913–921. Leibfritz, F. and Lipinski, W. (2003). Description of the REFERENCES benchmark examples in COMPleib. Technical report, Department of Mathematics, University of Trier, D– 54286 Trier, Germany. Abels, J. and Benner, P. (1999). CAREX—A collection R of benchmark examples for continuous-time algebraic MATLAB (2016). MATLAB Primer. R2016a. The Math- Riccati equations (Version 2.0). SLICOT Working Works, Inc., 3 Apple Hill Drive, Natick, MA. Note 1999-14. Mehrmann, V. (1991). The Autonomous Linear Quadratic Control Problem. Theory and Numerical Solution. Anderson, E., Bai, Z., Bischof, C., Blackford, S., Dem- Springer-Verlag, Berlin. mel, J., Dongarra, J., Du Croz, J., Greenbaum, A., Hammarling, S., McKenney, A., and Sorensen, D. Paige, C. and Van Loan, C. F. (1981). A Schur decomposi- (1999). LAPACK Users’ Guide: Third Edition. SIAM, tion for Hamiltonian matrices. Lin. Alg. Appl., 41:11– Philadelphia. 32. Benner, P. (2001). Symplectic balancing of Hamiltonian Sima, V. (1996). Algorithms for Linear-Quadratic Opti- matrices. SIAM J. Sci. Comput., 22(5):1885–1904. mization. Marcel Dekker, Inc., New York. Sima, V. and Benner, P. (2015a). Pitfalls when solving Benner, P., Byers, R., Losse, P., Mehrmann, V., and eigenproblems with applications in control engineer- Xu, H. (2007). Numerical solution of real skew- ing. In Proceedings of the 12th International Con- Hamiltonian/Hamiltonian eigenproblems. Technical ference on Informatics in Control, Automation and report, Technische Universit¨at Chemnitz, Chemnitz. Robotics (ICINCO-2015), 21-23 July, 2015, Colmar, Benner, P., Byers, R., Mehrmann, V., and Xu, H. (2002). France, volume 1, 171–178. SciTePress. Numerical computation of deflating subspaces of Sima, V. and Benner, P. (2015b). Solving SLICOT bench- skew Hamiltonian/Hamiltonian pencils. SIAM J. Ma- marks for continuous-time algebraic Riccati equa- trix Anal. Appl., 24(1):165–190. tions by Hamiltonian solvers. In Proceedings of the Benner, P., Kressner, D., and Mehrmann, V. (2005). Skew- 2015 19th International Conference on System The- Hamiltonian and Hamiltonian eigenvalue problems: ory, Control and Computing (ICSTCC 2015), October Theory, algorithms and applications. In Proceedings 14-16, 2015, Cheile Gradistei, Romania, 1–6. IEEE. of the Conference on Applied Mathematics and Scien- Van Loan, C. F. (1984). A symplectic method for approx- tific Computing, 3–39. Springer-Verlag, Dordrecht. imating all the eigenvalues of a Hamiltonian matrix. Benner, P., Sima, V., and Voigt, M. (2012a). L∞-norm com- Lin. Alg. Appl., 61:233–251. putation for continuous-time descriptor systems us- Ward, R. C. (1981). Balancing the generalized eigenvalue ing structured matrix pencils. IEEE Trans. Automat. problem. SIAM J. Sci. Stat. Comput., 2:141–152. Contr., AC-57(1):233–238. Benner, P., Sima, V., and Voigt, M. (2012b). Robust and efficient algorithms for L∞-norm computations for de- scriptor systems. In 7th IFAC Symposium on Robust Control Design (ROCOND’12), 189–194. IFAC.

184