clyap: Solve continuous-time Lyapunov equations

View source: R/gclm.R

clyapR Documentation

Solve continuous-time Lyapunov equations

Description

clyap solve the continuous-time Lyapunov equations

BX + XB' + C=0

Using the Bartels-Stewart algorithm with Hessenberg–Schur decomposition. Optionally the Hessenberg-Schur decomposition can be returned.

Usage

clyap(B, C, Q = NULL, all = FALSE)

Arguments

B

Square matrix

C

Square matrix

Q

Square matrix, the orthogonal matrix used to transform the original equation

all

logical

Details

If the matrix Q is set then the matrix B is assumed to be in upper quasi-triangular form (Hessenberg-Schur canonical form), as required by LAPACK subroutine DTRSYL and Q is the orthogonal matrix associated with the Hessenberg-Schur form of B. Usually the matrix Q and the appropriate form of B are obtained by a first call to clyap(B, C, all = TRUE)

clyap uses lapack subroutines:

  • DGEES

  • DTRSYL

  • DGEMM

Value

The solution matrix X if all = FALSE. If all = TRUE a list with components X, B and Q. Where B and Q are the Hessenberg-Schur form of the original matrix B and the orthogonal matrix that performed the transformation.

Examples

B <- matrix(data = rnorm(9), nrow = 3)
## make B negative diagonally dominant, thus stable:
diag(B) <- - 3 * max(B) 
C <- diag(runif(3))
X <- clyap(B, C)
## check X is a solution:
max(abs(B %*% X + X %*% t(B) + C)) 

gherardovarando/clggm documentation built on April 17, 2023, 10:04 a.m.