MatrixExponential

About the MatrixExponential functions

The WaveBlocks Project

@author: R. Bourquin @copyright: Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015, 2016 R. Bourquin @license: Modified BSD License

Class documentation

The WaveBlocks Project

This file contains several different algorithms to compute the matrix exponential. Currently we have an exponential based on Pade approximations and an Arnoldi iteration method.

@author: R. Bourquin @copyright: Copyright (C) 2007 V. Gradinaru @copyright: Copyright (C) 2010, 2011, 2012, 2015 R. Bourquin @license: Modified BSD License

MatrixExponential.arnoldi(A, v0, k)[source]

Arnoldi algorithm to compute the Krylov approximation H of a matrix A.

Parameters:
  • A – The matrix A of shape N \times N to approximate.
  • v0 – The initial vector v_0 of length N.
  • k – The number k of Krylov steps performed.
Returns:

A tuple (V, H) where V is the large matrix of shape N \times (k+1) containing the orthogonal vectors and H is the small matrix of shape (k+1) \times k containing the Krylov approximation of A.

MatrixExponential.matrix_exp_arnoldi(A, v, factor, k)[source]

Compute the solution of v' = A v via k steps of a the Arnoldi krylov method.

Parameters:
  • A – The matrix A of shape N \times N.
  • v – The vector v of length N.
  • factor – An additional scalar factor \alpha.
  • k – The number k of Krylov steps performed.
Returns:

The (approximate) value of \exp\left(\alpha A\right) v.

MatrixExponential.matrix_exp_pade(A, v, factor)[source]

Compute the solution of v' = A v with a full matrix exponential via Pade approximation.

Parameters:
  • A – The matrix A of shape N \times N.
  • v – The vector v of length N.
  • factor – An additional scalar factor \alpha.
Returns:

The (approximate) value of \exp\left(\alpha A\right) v