|
| 1 | +% HAEIGZ.F - Gateway function for computing a balancing transformation |
| 2 | +% or the eigenvalues of a complex Hamiltonian matrix, using |
| 3 | +% SLICOT Library routines MB04DZ and MB03XZ. |
| 4 | +% The gateway accepts real or complex input matrices. |
| 5 | +% |
| 6 | +% Matlab call: |
| 7 | +% [W(,Ao,Go(,U1,U2(,l,scal)))] = HaeigZ(A,QG(,job,jobu,balanc)) |
| 8 | +% [W(,Se,De(,Ue1,Ue2(,l,scal)))] = HaeigZ(A,QG(,job,jobu,balanc)) |
| 9 | +% [l,scal(,Ab,QGb)] = HaeigZ(A,QG,job,balanc) |
| 10 | +% |
| 11 | +% [l,scal] = HaeigZ(A,QG,-1,balanc) |
| 12 | +% [l,scal,Ab,QGb] = HaeigZ(A,QG,-1,balanc) |
| 13 | +% [W] = HaeigZ(A,QG) |
| 14 | +% [W,Se,De] = HaeigZ(A,QG) |
| 15 | +% [W,Se,De,Ue1,Ue2] = HaeigZ(A,QG,0,1) |
| 16 | +% [W,Se,De,Ue1,Ue2,l,scal] = HaeigZ(A,QG,0,1,balanc) |
| 17 | +% [W,Ao] = HaeigZ(A,QG,1) |
| 18 | +% [W,Ao,U1,U2] = HaeigZ(A,QG,1,1) |
| 19 | +% [W,Ao,Go] = HaeigZ(A,QG,2) |
| 20 | +% [W,Ao,Go,U1,U2] = HaeigZ(A,QG,2,1) |
| 21 | +% [W,Ao,Go,U1,U2,l,scal] = HaeigZ(A,QG,2,1,balanc) |
| 22 | +% |
| 23 | +% HAEIGZ computes the eigenvalues of a complex n-by-n Hamiltonian matrix H, |
| 24 | +% with |
| 25 | +% |
| 26 | +% [ A G ] H H |
| 27 | +% H = [ H ], G = G , Q = Q , (1) |
| 28 | +% [ Q -A ] |
| 29 | +% |
| 30 | +% where A, G and Q are complex n-by-n matrices. |
| 31 | +% |
| 32 | +% Due to the structure of H, if lambda is an eigenvalue, then |
| 33 | +% -conjugate(lambda) is also an eigenvalue. This does not mean that |
| 34 | +% purely imaginary eigenvalues are necessarily multiple. The function |
| 35 | +% computes the eigenvalues of H using an embedding to a skew- |
| 36 | +% Hamiltonian matrix He, |
| 37 | +% |
| 38 | +% [ Ae Ge ] T T |
| 39 | +% He = [ T ], Ge = -Ge , Qe = -Qe , (2) |
| 40 | +% [ Qe Ae ] |
| 41 | +% |
| 42 | +% where Ae, Ge, and Qe are real 2*n-by-2*n matrices. Then, an |
| 43 | +% orthogonal symplectic matrix Ue is used to reduce He to the |
| 44 | +% structured real Schur form, |
| 45 | +% |
| 46 | +% T [ Se De ] T |
| 47 | +% Ue He Ue = [ T ], De = -De , (3) |
| 48 | +% [ 0 Se ] |
| 49 | +% |
| 50 | +% where Ue is a 4n-by-4n real symplectic matrix, and Se is upper |
| 51 | +% quasi-triangular (real Schur form). |
| 52 | +% |
| 53 | +% Optionally, if job > 0, the matrix i*He is further transformed to |
| 54 | +% the structured complex Schur form |
| 55 | +% |
| 56 | +% H [ Ao Go ] H |
| 57 | +% U (i*He) U = [ H ], Go = Go , (4) |
| 58 | +% [ 0 -Ao ] |
| 59 | +% |
| 60 | +% where U is a 4n-by-4n unitary symplectic matrix, and Ao is upper |
| 61 | +% triangular (Schur form). Optionally, if jobu = 1, the unitary |
| 62 | +% symplectic transformation matrix |
| 63 | +% |
| 64 | +% ( U1 U2 ) |
| 65 | +% U = ( ) |
| 66 | +% ( -U2 U1 ) |
| 67 | +% |
| 68 | +% is computed. |
| 69 | +% |
| 70 | +% If job = -1, an accurate similarity transformation T such that |
| 71 | +% Hb = T\H*T has, as nearly as possible, approximately equal row and |
| 72 | +% column norms. T is a permutation of a diagonal matrix and |
| 73 | +% symplectic. T is stored in an n-vector scal as described in MB04DZ. |
| 74 | +% |
| 75 | +% Description of input parameters: |
| 76 | +% A - the n-by-n matrix A. |
| 77 | +% QG - an n-by-(n+1) matrix containing the triangles of the |
| 78 | +% Hermitian matrices G and Q, as follows: |
| 79 | +% the leading n-by-n lower triangular part contains the |
| 80 | +% lower triangle of the matrix Q, and the n-by-n upper |
| 81 | +% triangular part of the submatrix in the columns 2 to n+1 |
| 82 | +% contains the upper triangle of the matrix G of H in (1). |
| 83 | +% So, if i >= j, then Q(i,j) = conj(Q(j,i)) is stored in |
| 84 | +% QG(i,j) and G(j,i) = conj(G(i,j)) is stored in QG(j,i+1). |
| 85 | +% QG is an empty matrix if n = 0. |
| 86 | +% job - (optional) scalar indicating the computation to be |
| 87 | +% performed, as follows: |
| 88 | +% = -1 : compute a balancing transformation only; |
| 89 | +% = 0 : compute the eigenvalues only (default); |
| 90 | +% = 1 : compute the eigenvalues and the matrix Ao in (4); |
| 91 | +% = 2 : compute the eigenvalues and the matrices Ao and Go |
| 92 | +% in (4). |
| 93 | +% jobu - (optional) if job > 0, scalar indicating whether the |
| 94 | +% unitary transformation matrix U is returned, as follows: |
| 95 | +% = 0 : U is not required (default); |
| 96 | +% = 1 : on exit, U contains the unitary transformation |
| 97 | +% matrix. |
| 98 | +% balanc - determines whether H should be permuted (balanc = 1), |
| 99 | +% scaled (balanc = 2), or permuted and scaled (balanc = 3) |
| 100 | +% prior to eigenvalue computations. Otherwise balanc = 0 |
| 101 | +% (default). This parameter is optional if job >= 0, but |
| 102 | +% compulsory if job < 0. |
| 103 | +% |
| 104 | +% Description of output parameters: |
| 105 | +% l - if job = -1 or balanc > 0, an integer determined when H was |
| 106 | +% balanced. The balanced A(I,J) = 0 if I > J and J = 1:l-1. |
| 107 | +% The balanced Q(I,J) = 0 if J = 1:l-1 or I = 1:l-1. |
| 108 | +% scal - if job = -1 or balanc > 0, an n-vector containing details |
| 109 | +% of the permutation and/or scaling factors applied when |
| 110 | +% balancing. See MB04DZ, for details. |
| 111 | +% Ab - if job = -1, the matrix A of the balanced Hamiltonian Hb. |
| 112 | +% The lower triangular part of the first l-1 columns of A is |
| 113 | +% zero. |
| 114 | +% QGb - if job = -1, the matrices Q and G of the balanced |
| 115 | +% Hamiltonian Hb, stored compactly. The lower triangular and |
| 116 | +% diagonal part of the first l-1 columns of QGb is zero. |
| 117 | +% W - the 2n-vector of the eigenvalues of the matrix H. |
| 118 | +% Se - if job = 0, the computed 2n-by-2n upper real Schur |
| 119 | +% submatrix Se in (3). |
| 120 | +% De - if job = 0, the computed 2n-by-2n skew-symmetric submatrix |
| 121 | +% De in (3). |
| 122 | +% Ue1 - if job = 0, the computed 2n-by-2n (1,1) block of the matrix |
| 123 | +% Ue in (3). |
| 124 | +% Ue2 - if job = 0, the computed 2n-by-2n (2,1) block of the matrix |
| 125 | +% Ue in (3). |
| 126 | +% Ao - if job > 0, the computed 2n-by-2n upper triangular |
| 127 | +% submatrix Ao in (4). |
| 128 | +% Go - if job = 2, the computed 2n-by-2n Hermitian matrix Go |
| 129 | +% in (4). |
| 130 | +% U1 - if jobu = 1, a 2n-by-2n matrix containing the computed |
| 131 | +% matrix U1. |
| 132 | +% U2 - if jobu = 1, an 2n-by-2n matrix containing the computed |
| 133 | +% matrix U2. |
| 134 | +% |
| 135 | +% Contributors: |
| 136 | +% V. Sima, Research Institute for Informatics, Bucharest, Nov. 2011. |
| 137 | +% |
| 138 | + |
| 139 | +% RELEASE 2.0 of SLICOT Basic Systems and Control Toolbox. |
| 140 | +% Based on SLICOT RELEASE 5.7, Copyright (c) 2002-2020 NICONET e.V. |
| 141 | +% |
| 142 | +% Contributor: |
| 143 | +% V. Sima, Research Institute for Informatics, Bucharest, July 2012. |
| 144 | +% |
| 145 | +% Revisions: |
| 146 | +% V. Sima, Nov. 2012. |
| 147 | +% |
0 commit comments