Accurate Approximation of the Matrix Hyperbolic Cosine Using Bernoulli Polynomials
Abstract
:1. Introduction
2. The Proposed Algorithms
2.1. Algorithms Based on the Bernoulli Series of the Matrix Hyperbolic Cosine
Algorithm 1: Given a matrix , a minimum order and a maximum order , this algorithm computes with the Bernoulli series (10) |
1 Select suitable values of , , and for the Bernoulli approximation (10) of (see Section 2.3) 2 3 /* Compute in (10) by (13) */ 4 for to s do /* Recover */ 5 6 end |
Algorithm 2: Given a matrix , a minimum order and a maximum order , this algorithm computes with the Bernoulli series (11) |
1 2 Select suitable values of , , and , to approximate using (see Section 2.3) 3 4 /* Compute in (12) by (13) */ 5 for to s do /* Recover */ 6 7 end |
2.2. Algorithm Based on the Bernoulli Series of the Matrix Exponential
Algorithm 3: Given a matrix , a minimum order and a maximum order , this algorithm computes with the Bernoulli series of the matrix exponential using the formula |
1 Select suitable values of , , and for the Bernoulli approximation of (see Section 2.3) 2 3 and by using (8) from [30] and (13) 4 for to s do /* Recover and */ 5 6 7 end 8 |
2.3. Selecting the Order of Polynomials and the Scaling Factor
Algorithm 4: Given a matrix , a minimum order and a maximum order , this algorithm provides an order , , a scaling factor s and the necessary powers of A to compute or |
1 ; ; 2 for to do 3 4 end 5 while and do 6 ; 7 if then 8 Compute from , and maybe from A /* (relative backward error) or (absolute / relative forward error or absolute backward error) */ 9 10 if then 11 else 12 end 13 if then 14 else 15 16 /* for Algorithms 1 and 3, for Algorithm 2 */ 17 while do 18 if and then /* (Algorithms 1 or 3) or (Algorithm 2) */ 19 else 20 end 21 end 22 |
3. Computational Experiments
- coshmber_ataf and coshmber_atrf: They correspond to the coding of Algorithm 1, using the absolute or relative forward error, respectively. Polynomial degree m takes values from the set .
- coshmber_etaf and coshmber_etrf: They are implementations of Algorithm 2, after considering the absolute or relative forward error. The values of .
- coshm_expmber_af and coshm_expmber_rf: These functions include the implementation of Algorithm 3, where the absolute or relative forward error is correspondingly taken into account. Again, the values of .
- coshm_expm: This code also employs formula (14), but alternatively to the above ones (coshm_expmber_af and coshm_expmber_rf), the matrix exponential is computed by means of the code of MATLAB built-in function expm. Recall that function expm works out the matrix exponential combining the scaling and squaring technique with the Padé approximation [32,39].
- funmcosh: It consists of a short function that invokes the MATLAB built-in function funm to compute the matrix hyperbolic cosine. Function funm employs a Schur decomposition with reordering and blocking, and a block recurrence of Parlett [34]. It supports the matrix cosine, sine, hyperbolic cosine and hyperbolic sine. The derivatives of the matrix function to be approximated are also needed and computed.
- funmcosh_nd_inf: As in the previous case, it is just a simple code that calls function funm_nd_inf, implemented in [40], to calculate the hyperbolic cosine. More specifically, function funm_nd_inf is based on a multi-precision Schur–Parlett algorithm ([40] Algorithm 5.1) that does not require the matrix function derivatives. As blocking parameter is set to ∞ (no blocking), the whole Schur factor T is computed by [40]’s Algorithm 4.1.It is worth noting that, although function funm_nd, which is also implemented in [40] and which employs a value of , could have been used instead of function funm_nd_inf, the latter was finally chosen because it provided more accurate results in the different numerical experiments performed.
- Set 1: A total of 100 diagonalizable square complex matrices of order 128, generated as . V is an orthogonal matrix such that , with H being a Hadamard matrix and n its number of rows or columns, while D is a random diagonal matrix with complex eigenvalues. The 2-norm of the matrices varied from 0.1 to 350. The “exact" matrix hyperbolic cosine was computed as using the vpa function.
- Set 2: A total of 100 non-diagonalizable square complex matrices of size 128 and generated as . V is a matrix determined in exactly the same way as in the case of the previous set. However, J is a Jordan matrix with complex eigenvalues whose modules are less than five and with random algebraic multiplicity from 1 to 3. The 2-norm varied from 3.76 to 339.11. The matrix hyperbolic cosine was also “exactly" computed by means of the vpa function as .
- Set 3: A total of 72 square matrices of dimension 128, 52 of which are from Matrix Computation Toolbox (MCT) [41] and 20 from Eigtool MATLAB Package (EMP) [42]. Unfortunately, only 44 of these matrices (36 of MCT and 8 of EMP) could be successfully employed. The remaining matrices had to be excluded owing to the following reasons:
- -
- Their “exact" solution could not be computed: matrices 4, 5, 10, 16, 17, 18, 21, 25, 26, 35, 40, 42, 43, 44 and 49 from MCT and matrices 1, 5, 6, 7, 9 and 15 from EMP.
- -
- The relative error made by all the codes was too high due to their ill conditioning: matrix 2 from MCT and matrices 3 and 10 from EMP.
- -
- They were repetitive (already present in MCT): matrices 8, 11, 13 and 16 from EMP.
The “exact" calculation of the hyperbolic cosine of these matrices was performed in the following way:- -
- First, from initial matrix A and by means of the eig MATLAB function, a diagonal matrix D of eigenvalues and a matrix V whose columns were the corresponding eigenvectors were provided, such that . Thus, matrix was worked out.
- -
- Second, matrix was computed as the approximation to the hyperbolic cosine of matrix A through the scaling and squaring algorithm and Taylor polynomials using the vpa function.
- -
- Finally, matrix was accepted as the “exact" solution in the calculation of the hyperbolic cosine of A if it was satisfied thatOtherwise, matrix A was not part of the matrices of set 3.
4. Conclusions
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
Appendix A
References
- Druskin, V.; Mamonov, A.V.; Zaslavsky, M. Multiscale S-fraction reduced-order models for massive wavefield simulations. Multiscale Model. Simul. 2017, 15, 445–475. [Google Scholar] [CrossRef] [Green Version]
- Frommer, A.; Simoncini, V. Matrix Functions. In Model Order Reduction: Theory, Research Aspects and Applications. Mathematics in Industry. The European Consortium for Mathematics in Industry; Springer: Berlin/Heidelberg, Germany, 2008; Volume 13, pp. 275–303. [Google Scholar]
- May, V.; Keller, Y.; Sharon, N.; Shkolnisky, Y. An algorithm for improving non-local means operators via low-rank approximation. IEEE Trans. Image Process. 2016, 25, 1340–1353. [Google Scholar] [CrossRef] [Green Version]
- Levie, R.; Monti, F.; Bresson, X.; Bronstein, M.M. Cayleynets: Graph convolutional neural networks with complex rational spectral filters. IEEE Trans. Signal Process. 2018, 67, 97–109. [Google Scholar] [CrossRef] [Green Version]
- Higham, N.J. Functions of Matrices: Theory and Computation; Society for Industrial and Applied Mathematics: Philadelphia, PA, USA, 2008. [Google Scholar]
- Defez, E.; Sastre, J.; Ibánez, J.; Peinado, J.; Tung, M.M. On the computation of the hyperbolic sine and cosine matrix functions. Model. Eng. Hum. Behav. 2013, 2013, 46. [Google Scholar]
- Defez, E.; Sastre, J.; Ibáñez, J.; Peinado, J.; Tung, M.M. A method to approximate the hyperbolic sine of a matrix. Int. J. Complex Syst. Sci. 2014, 4, 41–45. [Google Scholar]
- Defez, E.; Sastre, J.; Ibáñez, J.; Ruiz, P. Computing hyperbolic matrix functions using orthogonal matrix polynomials. In Progress in Industrial Mathematics at ECMI 2012. Mathematics in Industry. The European Consortium for Mathematics in Industry; Springer International Publishing: Cham, Switzerland, 2014; Volume 19, pp. 403–407. [Google Scholar]
- Defez, E.; Sastre, J.; Ibáñez, J.; Peinado, J. Solving engineering models using hyperbolic matrix functions. Appl. Math. Model. 2016, 40, 2837–2844. [Google Scholar] [CrossRef]
- Defez, E.; Ibáñez, J.; Peinado, J.; Alonso-Jordá, P.; Alonso, J.M. New Hermite series expansion for computing the matrix hyperbolic cosine. J. Comput. Appl. Math. 2022, 408, 114084. [Google Scholar] [CrossRef]
- Bahşi, M.; Solak, S. On the hyperbolic Fibonacci matrix functions. Twms J. Appl. Eng. Math. 2018, 8, 454–465. [Google Scholar]
- Bahşi, M.; Mersin, E.Ö. On the hyperbolic Horadam matrix functions. Hacet. J. Math. Stat. 2022, 51, 1550–1562. [Google Scholar] [CrossRef]
- Estrada, E.; Higham, D.J.; Hatano, N. Communicability and multipartite structures in complex networks at negative absolute temperatures. Phys. Rev. E 2008, 78, 026102. [Google Scholar] [CrossRef] [Green Version]
- Tseng, C.C.; Lee, S.L. Identification of Station Importance of Taipei Metro Network Using Subgraph Centrality. In Proceedings of the 2021 International Symposium on Intelligent Signal Processing and Communication Systems (ISPACS), Hualien, Taiwan, 16–19 November 2021; pp. 1–2. [Google Scholar]
- Jódar, L.; Navarro, E.; Martin, J.A. Exact and analytic-numerical solutions of strongly coupled mixed diffusion problems. Proc. Edinb. Math. Soc. 2000, 43, 269–293. [Google Scholar] [CrossRef] [Green Version]
- Jódar, L.; Navarro, E.; Posso, A.; Casabán, M. Constructive solution of strongly coupled continuous hyperbolic mixed problems. Appl. Numer. Math. 2003, 47, 477–492. [Google Scholar] [CrossRef]
- Aprahamian, M.; Higham, N.J. Matrix inverse trigonometric and inverse hyperbolic functions: Theory and algorithms. SIAM J. Matrix Anal. Appl. 2016, 37, 1453–1477. [Google Scholar] [CrossRef]
- Higham, N.J.; Kandolf, P. Computing the action of trigonometric and hyperbolic matrix functions. SIAM J. Sci. Comput. 2017, 39, A613–A627. [Google Scholar] [CrossRef] [Green Version]
- Al-Mohy, A.H. A Truncated Taylor Series Algorithm for Computing the Action of Trigonometric and Hyperbolic Matrix Functions. SIAM J. Sci. Comput. 2018, 40, A1696–A1713. [Google Scholar] [CrossRef]
- Ibáñez, J.; Alonso, J.M.; Sastre, J.; Defez, E.; Alonso-Jordá, P. Advances in the Approximation of the Matrix Hyperbolic Tangent. Mathematics 2021, 9, 1219. [Google Scholar] [CrossRef]
- Efimov, G.V.; Von Waldenfels, W.; Wehrse, R. Analytical solution of the non-discretized radiative transfer equation for a slab of finite optical depth. J. Quant. Spectrosc. Radiat. Transf. 1995, 53, 59–74. [Google Scholar] [CrossRef]
- Lehtinen, A. Analytical Treatment of Heat Sinks Cooled by Forced Convection. Ph.D. Thesis, Tampere University of Technology, Tampere, Finland, 2005. [Google Scholar]
- Lampio, K. Optimization of Fin Arrays Cooled by Forced or Natural Convection. Ph.D. Thesis, Tampere University of Technology, Tampere, Finland, 2018. [Google Scholar]
- Hilscher, R.; Zemánek, P. Trigonometric and hyperbolic systems on time scales. Dyn. Syst. Appl. 2009, 18, 483. [Google Scholar]
- Zemánek, P. New Results in Theory of Symplectic Systems on Time Scales. Ph.D. Thesis, Masarykova Univerzita, Brno, Czech Republic, 2011. [Google Scholar]
- Estrada, E.; Silver, G. Accounting for the role of long walks on networks via a new matrix function. J. Math. Anal. Appl. 2017, 449, 1581–1600. [Google Scholar] [CrossRef] [Green Version]
- Cieśliński, J.L. Locally exact modifications of numerical schemes. Comput. Math. Appl. 2013, 65, 1920–1938. [Google Scholar] [CrossRef]
- Cieśliński, J.L.; Kobus, A. Locally Exact Integrators for the Duffing Equation. Mathematics 2020, 8, 231. [Google Scholar] [CrossRef] [Green Version]
- Olver, F.W.; Lozier, D.W.; Boisvert, R.F.; Clark, C.W. NIST Handbook of Mathematical Functions Hardback and CD-ROM; Cambridge University Press: Cambridge, UK, 2010. [Google Scholar]
- Defez, E.; Ibáñez, J.; Alonso-Jordá, P.; Alonso, J.M.; Peinado, J. On Bernoulli matrix polynomials and matrix exponential approximation. J. Comput. Appl. Math. 2022, 404, 113207. [Google Scholar] [CrossRef]
- Higham, N.J. The Scaling and Squaring Method for the Matrix Exponential Revisited; Technical Report 452; Manchester Centre for Computational Mathematics: Manchester, UK, 2004. [Google Scholar]
- Al-Mohy, A.H.; Higham, N.J. A New Scaling and Squaring Algorithm for the Matrix Exponential. SIAM J. Matrix Anal. Appl. 2009, 31, 970–989. [Google Scholar] [CrossRef] [Green Version]
- Higham, N.J.; Hopkins, E. A Catalogue of Software for Matrix Functions; Version 3.0; MIMS EPrint 2020.7; Manchester Institute for Mathematical Sciences, The University of Manchester: Manchester, UK, 2020. [Google Scholar]
- Davies, P.I.; Higham, N.J. A Schur–Parlett Algorithm for Computing Matrix Functions. SIAM J. Matrix Anal. Appl. 2003, 25, 464–485. [Google Scholar] [CrossRef]
- Paterson, M.S.; Stockmeyer, L.J. On the Number of Nonscalar Multiplications Necessary to Evaluate Polynomials. SIAM J. Comput. 1973, 2, 60–66. [Google Scholar] [CrossRef] [Green Version]
- Sastre, J. Efficient evaluation of matrix polynomials. Linear Algebra Appl. 2018, 539, 229–250. [Google Scholar] [CrossRef]
- Sastre, J.; Ibáñez, J.; Ruiz, P.; Defez, E. Accurate and efficient matrix exponential computation. Int. J. Comput. Math. 2013, 91, 97–112. [Google Scholar] [CrossRef]
- Defez, E.; Ibáñez, J.; Alonso, J.M.; Alonso-Jordá, P. On Bernoulli series approximation for the matrix cosine. Math. Methods Appl. Sci. 2022, 45, 3239–3253. [Google Scholar] [CrossRef]
- Higham, N.J. The scaling and squaring method for the matrix exponential revisited. SIAM J. Matrix Anal. Appl. 2005, 26, 1179–1193. [Google Scholar] [CrossRef] [Green Version]
- Higham, N.J.; Liu, X. A multiprecision derivative-free Schur– algorithm for computing matrix functions. SIAM J. Matrix Anal. Appl. 2021, 42, 1401–1422. [Google Scholar] [CrossRef]
- Higham, N.J. The Matrix Computation Toolbox. 2002. Available online: http://www.ma.man.ac.uk/~higham/mctoolbox (accessed on 16 January 2023).
- Wright, T.G. Eigtool, Version 2.1. 2009. Available online: http://www.comlab.ox.ac.uk/pseudospectra/eigtool (accessed on 16 January 2023).
- Higham, N.J. The Matrix Function Toolbox. Available online: http://www.ma.man.ac.uk/~higham/mftoolbox (accessed on 16 January 2023).
1 | ||
2 | ||
4 | ||
6 | ||
9 | ||
12 | ||
16 | ||
20 | ||
25 | ||
30 | ||
36 | ||
42 | ||
49 | ||
56 | ||
64 |
1 | ||
2 | ||
4 | ||
6 | ||
9 | ||
12 | ||
16 | ||
20 | ||
25 | ||
30 | ||
36 | ||
42 | ||
49 | ||
56 | ||
64 |
1 | ||
2 | ||
4 | ||
6 | ||
9 | ||
12 | ||
16 | ||
20 | ||
25 | ||
30 | ||
36 | ||
42 | ||
49 | ||
56 | ||
64 |
Code | Set 1 | Set 2 | Set 3 |
---|---|---|---|
coshmber_etrf | 1306 | 1303 | 424 |
coshmber_etaf | 1276 | 1273 | 388 |
coshmber_atrf | 1638 | 1637 | 563 |
coshmber_ataf | 1622 | 1623 | 527 |
Code | Set 1 | Set 2 | Set 3 |
---|---|---|---|
coshm_expmber_af | 2649 | 2651 | 776 |
coshm_expmber_rf | 2697 | 2693 | 790 |
coshmber_etrf | 1306 | 1303 | 411 |
coshmber_ataf | 1622 | 1623 | 497 |
coshm_expm | 2894 | 2891 | 645 |
funmcosh_nd_inf | 1433 | 1433 | 616 |
funmcosh | 1400–2233 | 1400–2233 | 602–917 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Alonso, J.M.; Ibáñez, J.; Defez, E.; Alvarruiz, F. Accurate Approximation of the Matrix Hyperbolic Cosine Using Bernoulli Polynomials. Mathematics 2023, 11, 520. https://doi.org/10.3390/math11030520
Alonso JM, Ibáñez J, Defez E, Alvarruiz F. Accurate Approximation of the Matrix Hyperbolic Cosine Using Bernoulli Polynomials. Mathematics. 2023; 11(3):520. https://doi.org/10.3390/math11030520
Chicago/Turabian StyleAlonso, José M., Javier Ibáñez, Emilio Defez, and Fernando Alvarruiz. 2023. "Accurate Approximation of the Matrix Hyperbolic Cosine Using Bernoulli Polynomials" Mathematics 11, no. 3: 520. https://doi.org/10.3390/math11030520
APA StyleAlonso, J. M., Ibáñez, J., Defez, E., & Alvarruiz, F. (2023). Accurate Approximation of the Matrix Hyperbolic Cosine Using Bernoulli Polynomials. Mathematics, 11(3), 520. https://doi.org/10.3390/math11030520