Constructor for Left Matrix Fraction Descriptions (LMFDs)
lmfd.Rd
A Left Matrix Fraction Description (LMFD) of a rational matrix, \(x(z)\) say, is a pair \((a(z),b(z))\) of polynomial matrices, such that \(x(z) = a^{-1}(z) b(z)\). The polynomial matrix \(a(z)\) must be square and invertible.
Details
Suppose that \(x(z)=a^{-1}(z) b(z)\) is an \((m,n)\)-dimensional matrix and that
\(a(z)\) and \(b(z)\) have degrees \(p\) and \(q\) respectively.
The corresponding lmfd
object stores the coefficients of the polynomials \(a(z), b(z)\) in
an \((m,m(p+1)+n(q+1))\) dimensional (real or complex valued) matrix together with an
attribute order = c(m,n,p,q)
and a class attribute c("lmfd", "ratm")
.
For a valid LMFD we require \(m>0\) and \(p\geq 0\).
Examples
### (1 x 1) rational matrix x(z) = (1+z+z^2)^(-1) (3+2z+z^2)
lmfd(c(1,1,1), c(3,2,1)) %>% print(format = 'c')
#> ( 1 x 1 ) left matrix fraction description a^(-1)(z) b(z) with degrees (p = 2, q = 2)
#> left factor a(z):
#> [,1]
#> [1,] 1 + z + z^2
#> right factor b(z):
#> [,1]
#> [1,] 3 + 2z + z^2
### (1 x 1) rational matrix x(z) = (3+2z+z^2)
lmfd(b = c(3,2,1)) %>% print(format = 'c')
#> ( 1 x 1 ) left matrix fraction description a^(-1)(z) b(z) with degrees (p = 0, q = 2)
#> left factor a(z):
#> [,1]
#> [1,] 1
#> right factor b(z):
#> [,1]
#> [1,] 3 + 2z + z^2
### (1 x 1) rational matrix x(z) = (1+z+z^2)^(-1)
lmfd(c(1,1,1)) %>% print(format = 'c')
#> ( 1 x 1 ) left matrix fraction description a^(-1)(z) b(z) with degrees (p = 2, q = 0)
#> left factor a(z):
#> [,1]
#> [1,] 1 + z + z^2
#> right factor b(z):
#> [,1]
#> [1,] 1
### (2 x 3) rational matrix with degrees p=1, q=1
x = lmfd(array(rnorm(2*2*2), dim = c(2,2,2)),
array(rnorm(2*3*2), dim = c(2,3,2)))
is.lmfd(x)
#> [1] TRUE
dim(x)
#> m n p q
#> 2 3 1 1
str(x)
#> ( 2 x 3 ) left matrix fraction description with degrees (p = 1, q = 1)
print(x, digits = 2)
#> ( 2 x 3 ) left matrix fraction description a^(-1)(z) b(z) with degrees (p = 1, q = 1)
#> left factor a(z):
#> z^0 [,1] [,2] z^1 [,1] [,2]
#> [1,] 0.72 0.43 1.12 -0.15
#> [2,] -0.93 1.65 0.48 0.31
#> right factor b(z):
#> z^0 [,1] [,2] [,3] z^1 [,1] [,2] [,3]
#> [1,] 1.54 1.04 -0.03 -0.71 2.25 1.81
#> [2,] -1.80 -0.22 -1.34 0.29 0.35 1.39
if (FALSE) {
### the following calls to lmfd() throw an error
lmfd() # no arguments!
lmfd(a = test_polm(dim = c(2,3), degree = 1)) # a(z) must be square
lmfd(a = test_polm(dim = c(2,2), degree = -1)) # a(z) must have degree >= 0
}