Tue Oct 19 17:25:04 2021 test_matrix_exponential_test(): Python version: 3.6.9 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: 0 1 Row 0 : 1 0 1 : 0 2 Exact Exponential exp(A): Col: 0 1 Row 0 : 2.71828 0 1 : 0 7.38906 Test # 2 This matrix is symmetric. The calculation of the matrix exponential is straightforward. Matrix order N = 2 Matrix A: Col: 0 1 Row 0 : 1 3 1 : 3 2 Exact Exponential exp(A): Col: 0 1 Row 0 : 39.3228 46.1663 1 : 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: 0 1 Row 0 : 0 -39 1 : 1 -40 Exact Exponential exp(A): Col: 0 1 Row 0 : 0.37756 -0.37756 1 : 0.00968104 -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: 0 1 Row 0 : -49 -64 1 : 24 31 Exact Exponential exp(A): Col: 0 1 Row 0 : -0.735759 -1.47152 1 : 0.551819 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: 0 1 2 3 Row 0 : 0 0 0 0 1 : 6 0 0 0 2 : 0 6 0 0 3 : 0 0 6 0 Exact Exponential exp(A): Col: 0 1 2 3 Row 0 : 1 0 0 0 1 : 6 1 0 0 2 : 18 6 1 0 3 : 36 18 6 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: 0 1 Row 0 : 1 0 1 : 1 1 Exact Exponential exp(A): Col: 0 1 Row 0 : 2.71828 0 1 : 2.71828 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: 0 1 Row 0 : 1 0 1 : 1 1 Exact Exponential exp(A): Col: 0 1 Row 0 : 2.71828 0 1 : 2.71828 2.71828 Test # 8 This matrix was an example in Wikipedia. Matrix order N = 3 Matrix A: Col: 0 1 2 Row 0 : 21 -5 4 1 : 17 -1 4 2 : 6 -6 16 Exact Exponential exp(A): Col: 0 1 2 Row 0 : 2.88798e+07 -1.99937e+07 3.55444e+07 1 : 2.88798e+07 -1.99937e+07 3.55444e+07 2 : 4.44303e+06 -4.44303e+06 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: 0 1 2 3 Row 0 : 1 3 3 3 1 : 2 1 2 3 2 : 2 1 1 3 3 : 2 2 2 1 Exact Exponential exp(A): Col: 0 1 2 3 Row 0 : 740.704 731.251 823.763 998.436 1 : 610.85 603.552 679.426 823.763 2 : 542.274 535.088 603.552 731.251 3 : 549.175 542.274 610.85 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: 0 1 2 Row 0 : 4 1 1 1 : 2 4 1 2 : 0 1 4 Exact Exponential exp(A): Col: 0 1 2 Row 0 : 147.867 127.781 127.781 1 : 183.765 183.765 163.68 2 : 71.797 91.8826 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: 0 1 2 Row 0 : 29.8794 0.781575 -2.28952 1 : 0.781575 25.7266 8.68074 2 : -2.28952 8.68074 34.394 Exact Exponential exp(A): Col: 0 1 2 Row 0 : 5.49631e+15 -1.82319e+16 -3.04758e+16 1 : -1.82319e+16 6.06052e+16 1.01292e+17 2 : -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: 0 1 2 Row 0 : -131 -390 -387 1 : 19 56 57 2 : 18 54 52 Exact Exponential exp(A): Col: 0 1 2 Row 0 : -1.50964 -5.63257 -4.93494 1 : 0.367879 1.47152 1.10364 2 : 0.135335 0.406006 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: 0 1 2 3 4 Row 0 : 0 1 0 0 0 1 : 0 0 1 0 0 2 : 0 0 0 1 0 3 : 0 0 0 0 1 4 : 0 0 0 0 0 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 : 1e-10 0 0 0 0 Col: 5 6 7 8 9 Row 0 : 0 0 0 0 0 1 : 0 0 0 0 0 2 : 0 0 0 0 0 3 : 0 0 0 0 0 4 : 1 0 0 0 0 5 : 0 1 0 0 0 6 : 0 0 1 0 0 7 : 0 0 0 1 0 8 : 0 0 0 0 1 9 : 0 0 0 0 0 Exact Exponential exp(A): Col: 0 1 2 3 4 Row 0 : 1 1 0.5 0.166667 0.0416667 1 : 2.75573e-16 1 1 0.5 0.166667 2 : 2.48016e-15 2.75573e-16 1 1 0.5 3 : 1.98413e-14 2.48016e-15 2.75573e-16 1 1 4 : 1.38889e-13 1.98413e-14 2.48016e-15 2.75573e-16 1 5 : 8.33333e-13 1.38889e-13 1.98413e-14 2.48016e-15 2.75573e-16 6 : 4.16667e-12 8.33333e-13 1.38889e-13 1.98413e-14 2.48016e-15 7 : 1.66667e-11 4.16667e-12 8.33333e-13 1.38889e-13 1.98413e-14 8 : 5e-11 1.66667e-11 4.16667e-12 8.33333e-13 1.38889e-13 9 : 1e-10 5e-11 1.66667e-11 4.16667e-12 8.33333e-13 Col: 5 6 7 8 9 Row 0 : 0.00833333 0.00138889 0.000198413 2.48016e-05 2.75573e-06 1 : 0.0416667 0.00833333 0.00138889 0.000198413 2.48016e-05 2 : 0.166667 0.0416667 0.00833333 0.00138889 0.000198413 3 : 0.5 0.166667 0.0416667 0.00833333 0.00138889 4 : 1 0.5 0.166667 0.0416667 0.00833333 5 : 1 1 0.5 0.166667 0.0416667 6 : 2.75573e-16 1 1 0.5 0.166667 7 : 2.48016e-15 2.75573e-16 1 1 0.5 8 : 1.98413e-14 2.48016e-15 2.75573e-16 1 1 9 : 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 MATLABs expm(). Matrix order N = 3 Matrix A: Col: 0 1 2 Row 0 : 0 -2.00667e+10 66.6667 1 : 1e-08 -3 0 2 : 0 2e+10 -66.6667 Exact Exponential exp(A): Col: 0 1 2 Row 0 : 0.446849 -5.74307e+06 0.447723 1 : 1.54044e-09 -0.015283 1.5427e-09 2 : 0.462811 -4.52654e+06 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: 0 1 Row 0 : 1 0i 0 0i 1 : 0 0i 2 0i Exact Exponential exp(A): Col: 0 1 Row 0 : 2.71828 0i 0 0i 1 : 0 0i 7.38906 0i Test # 2 This matrix is diagonal. The diagonal entries are pure imaginary. Matrix order N = 2 Matrix A: Col: 0 1 Row 0 : 0 3i 0 0i 1 : 0 0i -0 -4i Exact Exponential exp(A): Col: 0 1 Row 0 : -0.989992 0.14112i 0 0i 1 : 0 0i -0.653644 0.756802i Test # 3 This matrix is diagonal. The diagonal entries are complex. Matrix order N = 2 Matrix A: Col: 0 1 Row 0 : 5 6i 0 0i 1 : 0 0i 7 -8i Exact Exponential exp(A): Col: 0 1 Row 0 : 142.502 -41.4689i 0 0i 1 : 0 0i -159.56 -1084.96i test_matrix_exponential_test(): Normal end of execution. Tue Oct 19 17:25:04 2021