Skip to contents

For given polynomial matrices \(a(z), b(z)\) compute two matrices \(c(z), d(z)\) such that $$a(z) = c(z) b(z) + d(z)$$ where the degree of \(d(z)\) is smaller than the degree of \(b(z)\). The matrix \(b(z)\) must be square with a non singular leading coefficient matrix! The matrices must be compatible, i.e. the number of columns of \(a(z)\) must equal the number of rows (and columns) of \(b(z)\).

Usage

polm_div(a, b)

Arguments

a, b

Two compatible polynomial matrices.

Value

List with two slots

qu

contains the polynomial \(c(z)\)

rem

contains the polynomial \(d(z)\).

Examples

a = test_polm(dim = c(3,2), degree = 4, random = TRUE)
b = test_polm(dim = c(2,2), degree = 2, random = TRUE)
(out = polm_div(a, b))
#> $qu
#> ( 3 x 2 ) matrix polynomial with degree <= 2 
#>       z^0 [,1]      [,2]  z^1 [,1]      [,2]   z^2 [,1]       [,2]
#> [1,]  18.68698 -28.66855 11.811921 -6.802086  1.5890408 -1.0140667
#> [2,] -21.96966 -23.72738 -2.208808 -5.927850 -0.7701451 -0.7897131
#> [3,] -27.08619  27.68851 -8.125988  5.343696 -2.5676005  1.1403258
#> 
#> $rem
#> ( 3 x 2 ) matrix polynomial with degree <= 1 
#>       z^0 [,1]       [,2]  z^1 [,1]      [,2]
#> [1,]  2.726272 10.7819751  36.30246 -50.69354
#> [2,]  4.456630 44.0939329  57.51541 -28.67613
#> [3,] -4.718282 -0.9951711 -26.83745  47.16951
#> 
all.equal(a, out$qu %r% b + out$rem)
#> [1] TRUE