31-Mar-2024 23:30:44 companion_matrix_test(): MATLAB/Octave version 6.4.0 companion_matrix() computes the companion matrix of a polynomial, in various bases. companion_chebyshev_test(): companion_chebyshev() computes the companion matrix of a polynomial p(x) in the Chebyshev basis. p(x) = +1.000000 * T5(x) +2.000000 * T4(x) +3.000000 * T3(x) +4.000000 * T2(x) +5.000000 * T1(x) +6.000000 * T0(x) Monomial q(x) = +16.000000 * x^5 +16.000000 * x^4 -8.000000 * x^3 -8.000000 * x^2 +1.000000 * x +4.000000 Roots of q(x): -1.1577 + 0i -0.5206 + 0.4699i -0.5206 - 0.4699i 0.5995 + 0.2823i 0.5995 - 0.2823i Chebyshev companion matrix A(p): 0 1.0000 0 0 0 0.5000 0 0.5000 0 0 0 0.5000 0 0.5000 0 0 0 0.5000 0 0.5000 -3.0000 -2.5000 -2.0000 -1.0000 -1.0000 Eigenvalues of A(p): -1.1577 + 0i -0.5206 + 0.4699i -0.5206 - 0.4699i 0.5995 + 0.2823i 0.5995 - 0.2823i companion_gegenbauer_test(): companion_gegenbauer() computes the companion matrix of a polynomial p(x) in the Gegenbauer basis. p(x) = +1.000000 * C5(x) +2.000000 * C4(x) +3.000000 * C3(x) +4.000000 * C2(x) +5.000000 * C1(x) +6.000000 * C0(x) Gegenbauer parameter alpha will be 0.5 Monomial q(x) = +7.875000 * x^5 +8.750000 * x^4 -10.950000 * x^3 -11.166667 * x^2 +1.475000 * x +3.750000 Roots of q(x): -1.4410 + 0i 1.0123 + 0i 0.5997 + 0i -0.6410 + 0.3654i -0.6410 - 0.3654i Gegenbauer companion matrix A(p), alpha = 0.5: 0 1.0000 0 0 0 0.3333 0 0.6667 0 0 0 0.4000 0 0.6000 0 0 0 0.4286 0 0.5714 -3.3333 -2.7778 -2.2222 -1.2222 -1.1111 Eigenvalues of A(p): -1.2196 + 0i -0.5724 + 0.6408i -0.5724 - 0.6408i 0.6266 + 0.5266i 0.6266 - 0.5266i Gegenbauer parameter alpha will be 1 Monomial q(x) = +32.000000 * x^5 +32.000000 * x^4 -28.533333 * x^3 -25.333333 * x^2 +4.266667 * x +4.000000 Roots of q(x): -1.1659 + 0i 0.7953 + 0i 0.4553 + 0i -0.5423 + 0.0447i -0.5423 - 0.0447i Gegenbauer companion matrix A(p), alpha = 1: 0 0.5000 0 0 0 0.5000 0 0.5000 0 0 0 0.5000 0 0.5000 0 0 0 0.5000 0 0.5000 -3.0000 -2.5000 -2.0000 -1.0000 -1.0000 Eigenvalues of A(p): -1.0000 + 0i 0.4892 + 0.3380i 0.4892 - 0.3380i -0.4892 + 0.3380i -0.4892 - 0.3380i companion_hermite_test(): companion_hermite() computes the companion matrix of a polynomial p(x) in the Hermite basis. Hermite p(x) = +1.000000 * H5(x) +2.000000 * H4(x) +3.000000 * H3(x) +4.000000 * H2(x) +5.000000 * H1(x) +6.000000 * H0(x) Monomial q(x) = +32.000000 * x^5 +32.000000 * x^4 -136.000000 * x^3 -80.000000 * x^2 +94.000000 * x +22.000000 Roots of q(x): -2.1711 1.6932 -1.1116 0.7998 -0.2104 Hermite companion matrix A(p): 0 0.5000 0 0 0 1.0000 0 0.5000 0 0 0 2.0000 0 0.5000 0 0 0 3.0000 0 0.5000 -3.0000 -2.5000 -2.0000 2.5000 -1.0000 Eigenvalues of A(p): -2.1711 1.6932 -1.1116 0.7998 -0.2104 companion_laguerre_test(): companion_laguerre() computes the companion matrix of a polynomial p(x) in the Laguerre basis. Laguerre p(x) = +1.000000 * L5(x) +2.000000 * L4(x) +3.000000 * L3(x) +4.000000 * L2(x) +5.000000 * L1(x) +6.000000 * L0(x) Monomial q(x) = -0.008333 * x^5 +0.291667 * x^4 -3.500000 * x^3 +17.500000 * x^2 -35.000000 * x +21.000000 Roots of q(x): 15.8285 9.6829 5.6203 2.8372 1.0311 Laguerre companion matrix A(p): 1 -1 0 0 0 -1 3 -2 0 0 0 -2 5 -3 0 0 0 -3 7 -4 30 25 20 11 19 Eigenvalues of A(p): 15.8285 9.6829 5.6203 2.8372 1.0311 companion_legendre_test(): companion_legendre() computes the companion matrix of a polynomial p(x) in the Legendre basis. Legendre p(x) = +1.000000 * P5(x) +2.000000 * P4(x) +3.000000 * P3(x) +4.000000 * P2(x) +5.000000 * P1(x) +6.000000 * P0(x) Monomial q(x) = +7.875000 * x^5 +8.750000 * x^4 -1.250000 * x^3 -1.500000 * x^2 +2.375000 * x +4.750000 Roots of q(x): 0.6266 + 0.5266i 0.6266 - 0.5266i -1.2196 + 0i -0.5724 + 0.6408i -0.5724 - 0.6408i Legendre companion matrix A(p): 0 1.0000 0 0 0 0.3333 0 0.6667 0 0 0 0.4000 0 0.6000 0 0 0 0.4286 0 0.5714 -3.3333 -2.7778 -2.2222 -1.2222 -1.1111 Eigenvalues of A(p): -1.2196 + 0i -0.5724 + 0.6408i -0.5724 - 0.6408i 0.6266 + 0.5266i 0.6266 - 0.5266i companion_monomial_test(): companion_monomial() computes the companion matrix of a polynomial p(x) in the monomial basis. p(x) = +1.000000 * x^5 +2.000000 * x^4 +3.000000 * x^3 +4.000000 * x^2 +5.000000 * x +6.000000 Roots of p(x): 0.5517 + 1.2533i 0.5517 - 1.2533i -1.4918 + 0i -0.8058 + 1.2229i -0.8058 - 1.2229i Monomial companion matrix A(p): 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 -6 -5 -4 -3 -2 Eigenvalues of A(p): -1.4918 + 0i -0.8058 + 1.2229i -0.8058 - 1.2229i 0.5517 + 1.2533i 0.5517 - 1.2533i companion_matrix_test(): Normal end of execution. 31-Mar-2024 23:30:44