08-Jan-2022 10:27:52 test_matrix_exponential_test(): MATLAB/Octave version 9.8.0.1380330 (R2020a) Update 2 Test test_matrix_exponential(). TEST_MATRIX_EXPONENTIAL_TEST01: Retrieve the data for each matrix exponential test. Test #1 This matrix is diagonal. The calculation of the matrix exponential is simple. Matrix order N = 2 Matrix A: Col: 1 2 Row 1 : 1 0 2 : 0 2 Exact Exponential exp(A): Col: 1 2 Row 1 : 2.71828 0 2 : 0 7.38906 Test #2 This matrix is symmetric. The calculation of the matrix exponential is straightforward. Matrix order N = 2 Matrix A: Col: 1 2 Row 1 : 1 3 2 : 3 2 Exact Exponential exp(A): Col: 1 2 Row 1 : 39.3228 46.1663 2 : 46.1663 54.7116 Test #3 This example is due to Laub. This matrix is ill-suited for the Taylor series approach. As powers of A are computed, the entries blow up too quickly. Matrix order N = 2 Matrix A: Col: 1 2 Row 1 : 0 1 2 : -39 -40 Exact Exponential exp(A): Col: 1 2 Row 1 : 0.37756 0.00968104 2 : -0.37756 -0.00968104 Test #4 This example is due to Moler and Van Loan. The example will cause problems for the series summation approach, as well as for diagonal Pade approximations. Matrix order N = 2 Matrix A: Col: 1 2 Row 1 : -49 24 2 : -64 31 Exact Exponential exp(A): Col: 1 2 Row 1 : -0.735759 0.551819 2 : -1.47152 1.10364 Test #5 This example is due to Moler and Van Loan. This matrix is strictly upper triangular All powers of A are zero beyond some (low) limit. This example will cause problems for Pade approximations. Matrix order N = 4 Matrix A: Col: 1 2 3 4 Row 1 : 0 6 0 0 2 : 0 0 6 0 3 : 0 0 0 6 4 : 0 0 0 0 Exact Exponential exp(A): Col: 1 2 3 4 Row 1 : 1 6 18 36 2 : 0 1 6 18 3 : 0 0 1 6 4 : 0 0 0 1 Test #6 This example is due to Moler and Van Loan. This matrix does not have a complete set of eigenvectors. That means the eigenvector approach will fail. Matrix order N = 2 Matrix A: Col: 1 2 Row 1 : 1 1 2 : 0 1 Exact Exponential exp(A): Col: 1 2 Row 1 : 2.71828 2.71828 2 : 0 2.71828 Test #7 This example is due to Moler and Van Loan. This matrix is very close to example 5. Mathematically, it has a complete set of eigenvectors. Numerically, however, the calculation will be suspect. Matrix order N = 2 Matrix A: Col: 1 2 Row 1 : 1 1 2 : 0 1 Exact Exponential exp(A): Col: 1 2 Row 1 : 2.71828 2.71828 2 : 0 2.71828 Test #8 This matrix was an example in Wikipedia. Matrix order N = 3 Matrix A: Col: 1 2 3 Row 1 : 21 17 6 2 : -5 -1 -6 3 : 4 4 16 Exact Exponential exp(A): Col: 1 2 3 Row 1 : 2.88798e+07 2.88798e+07 4.44303e+06 2 :-1.99937e+07 -1.99937e+07 -4.44303e+06 3 : 3.55444e+07 3.55444e+07 8.88611e+06 Test #9 This example is due to the NAG Library. It is an example for function F01ECF. Matrix order N = 4 Matrix A: Col: 1 2 3 4 Row 1 : 1 2 2 2 2 : 3 1 1 2 3 : 3 2 1 2 4 : 3 3 3 1 Exact Exponential exp(A): Col: 1 2 3 4 Row 1 : 740.704 610.85 542.274 549.175 2 : 731.251 603.552 535.088 542.274 3 : 823.763 679.426 603.552 610.85 4 : 998.436 823.763 731.251 740.704 Test #10 This is Ward's example #1. It is defective and nonderogatory. The eigenvalues are 3, 3 and 6. Matrix order N = 3 Matrix A: Col: 1 2 3 Row 1 : 4 2 0 2 : 1 4 1 3 : 1 1 4 Exact Exponential exp(A): Col: 1 2 3 Row 1 : 147.867 183.765 71.797 2 : 127.781 183.765 91.8826 3 : 127.781 163.68 111.968 Test #11 This is Ward's example #2. It is a symmetric matrix. The eigenvalues are 20, 30, 40. Matrix order N = 3 Matrix A: Col: 1 2 3 Row 1 : 29.8794 0.781575 -2.28952 2 : 0.781575 25.7266 8.68074 3 : -2.28952 8.68074 34.394 Exact Exponential exp(A): Col: 1 2 3 Row 1 : 5.49631e+15 -1.82319e+16 -3.04758e+16 2 :-1.82319e+16 6.06052e+16 1.01292e+17 3 :-3.04758e+16 1.01292e+17 1.69294e+17 Test #12 This is Ward's example #3. Ward's algorithm has difficulty estimating the accuracy of its results. The eigenvalues are -1, -2, -20. Matrix order N = 3 Matrix A: Col: 1 2 3 Row 1 : -131 19 18 2 : -390 56 54 3 : -387 57 52 Exact Exponential exp(A): Col: 1 2 3 Row 1 : -1.50964 0.367879 0.135335 2 : -5.63257 1.47152 0.406006 3 : -4.93494 1.10364 0.541341 Test #13 This is Ward's example #4. This is a version of the Forsythe matrix. The eigenvector problem is badly conditioned. Ward's algorithm has difficulty estimating the accuracy of its results for this problem. Matrix order N = 10 Matrix A: Col: 1 2 3 4 5 Row 1 : 0 1 0 0 0 2 : 0 0 1 0 0 3 : 0 0 0 1 0 4 : 0 0 0 0 1 5 : 0 0 0 0 0 6 : 0 0 0 0 0 7 : 0 0 0 0 0 8 : 0 0 0 0 0 9 : 0 0 0 0 0 10 : 1e-10 0 0 0 0 Col: 6 7 8 9 10 Row 1 : 0 0 0 0 0 2 : 0 0 0 0 0 3 : 0 0 0 0 0 4 : 0 0 0 0 0 5 : 1 0 0 0 0 6 : 0 1 0 0 0 7 : 0 0 1 0 0 8 : 0 0 0 1 0 9 : 0 0 0 0 1 10 : 0 0 0 0 0 Exact Exponential exp(A): Col: 1 2 3 4 5 Row 1 : 1 1 0.5 0.166667 0.0416667 2 : 2.75573e-16 1 1 0.5 0.166667 3 : 2.48016e-15 2.75573e-16 1 1 0.5 4 : 1.98413e-14 2.48016e-15 2.75573e-16 1 1 5 : 1.38889e-13 1.98413e-14 2.48016e-15 2.75573e-16 1 6 : 8.33333e-13 1.38889e-13 1.98413e-14 2.48016e-15 2.75573e-16 7 : 4.16667e-12 8.33333e-13 1.38889e-13 1.98413e-14 2.48016e-15 8 : 1.66667e-11 4.16667e-12 8.33333e-13 1.38889e-13 1.98413e-14 9 : 5e-11 1.66667e-11 4.16667e-12 8.33333e-13 1.38889e-13 10 : 1e-10 5e-11 1.66667e-11 4.16667e-12 8.33333e-13 Col: 6 7 8 9 10 Row 1 : 0.00833333 0.00138889 0.000198413 2.48016e-05 2.75573e-06 2 : 0.0416667 0.00833333 0.00138889 0.000198413 2.48016e-05 3 : 0.166667 0.0416667 0.00833333 0.00138889 0.000198413 4 : 0.5 0.166667 0.0416667 0.00833333 0.00138889 5 : 1 0.5 0.166667 0.0416667 0.00833333 6 : 1 1 0.5 0.166667 0.0416667 7 : 2.75573e-16 1 1 0.5 0.166667 8 : 2.48016e-15 2.75573e-16 1 1 0.5 9 : 1.98413e-14 2.48016e-15 2.75573e-16 1 1 10 : 1.38889e-13 1.98413e-14 2.48016e-15 2.75573e-16 1 Test #14 This is Moler's example. This badly scaled matrix caused problems for MATLAB's expm(). Matrix order N = 3 Matrix A: Col: 1 2 3 Row 1 : 0 1e-08 0 2 :-2.00667e+10 -3 2e+10 3 : 66.6667 0 -66.6667 Exact Exponential exp(A): Col: 1 2 3 Row 1 : 0.446849 1.54044e-09 0.462811 2 :-5.74307e+06 -0.015283 -4.52654e+06 3 : 0.447723 1.5427e-09 0.463481 TEST_MATRIX_EXPONENTIAL_TEST02: Retrieve the data for each matrix exponential test. Test #1 This matrix is diagonal. The diagonal entries are real. Matrix order N = 2 Matrix A: Col: 1 2 Row --- 1: 1.000000 0.0 2: 0.0 2.000000 Exact Exponential exp(A): Col: 1 2 Row --- 1: 2.718282 0.0 2: 0.0 7.389056 Test #2 This matrix is diagonal. The diagonal entries are pure imaginary. Matrix order N = 2 Matrix A: Col: 1 2 Row --- 1: 0.000000 3.000000 0.0 2: 0.0 -0.000000 -4.000000 Exact Exponential exp(A): Col: 1 2 Row --- 1: -0.989992 0.141120 0.0 2: 0.0 -0.653644 0.756802 Test #3 This matrix is diagonal. The diagonal entries are complex. Matrix order N = 2 Matrix A: Col: 1 2 Row --- 1: 5.000000 6.000000 0.0 2: 0.0 7.000000 -8.000000 Exact Exponential exp(A): Col: 1 2 Row --- 1: 142.501906 -41.468937 0.0 2: 0.0 -159.560162 -1084.963059 test_matrix_exponential_test(): Normal end of execution. 08-Jan-2022 10:27:52