In this paper, we develop an iterative method, based on the Bartels-Stewart algorithm to solve $N$-dimensional matrix equations, that relies on the Schur decomposition of the matrices involved. We remark that, unlike other possible implementations of that algorithm, ours avoids recursivity, and makes an efficient use of the available computational resources, which enables considering arbitrarily large problems, up to the size of the available memory. In this respect, we have successfully solved matrix equations in up to $N = 29$ dimensions. We explain carefully all the steps, and calculate accurately the computational cost required. Furthermore, in order to ease the understanding, we offer both pseudocodes and full Matlab codes, and special emphasis is put on making the implementation of the method completely independent from the number of dimensions. As an important application, the method allows to compute the solution of linear $N$-dimensional systems of ODEs of constant coefficients at any time $t$, and, hence, of evolutionary PDEs, after discretizing the spatial derivatives by means of matrices. In this regard, we are able to compute with great accuracy the solution of an advection-diffusion equation on $\mathbb R^N$.
翻译:本文基于Bartels-Stewart算法,提出了一种求解$N$维矩阵方程的迭代方法,该方法依赖于所涉及矩阵的Schur分解。我们指出,与其他可能的算法实现不同,我们的方法避免了递归,并有效利用了可用的计算资源,从而能够处理任意大规模的问题,直至达到可用内存的极限。在这方面,我们已成功求解了维度高达$N = 29$的矩阵方程。我们详细解释了所有步骤,并精确计算了所需的计算成本。此外,为便于理解,我们同时提供了伪代码和完整的Matlab代码,并特别强调使该方法的实现完全独立于维度数量。作为一个重要应用,该方法能够计算任意时刻$t$下常系数线性$N$维ODE系统的解,进而通过矩阵离散空间导数,求解演化型PDE。在这方面,我们能够以高精度计算$\mathbb R^N$上对流-扩散方程的解。