hide long namesshow long names
hide short namesshow short names
Integer type:  int32  int64  nag_int  show int32  show int32  show int64  show int64  show nag_int  show nag_int

PDF version (NAG web site, 64-bit version, 64-bit version)
Chapter Contents
Chapter Introduction
NAG Toolbox

NAG Toolbox: nag_matop_real_gen_matrix_actexp (f01ga)

Purpose

nag_matop_real_gen_matrix_actexp (f01ga) computes the action of the matrix exponential etAetA, on the matrix BB, where AA is a real nn by nn matrix, BB is a real nn by mm matrix and tt is a real scalar.

Syntax

[a, b, ifail] = f01ga(m, a, b, t, 'n', n)
[a, b, ifail] = nag_matop_real_gen_matrix_actexp(m, a, b, t, 'n', n)

Description

etABetAB is computed using the algorithm described in Al–Mohy and Higham (2011) which uses a truncated Taylor series to compute the product etABetAB without explicitly forming etAetA.

References

Al–Mohy A H and Higham N J (2011) Computing the action of the matrix exponential, with an application to exponential integrators SIAM J. Sci. Statist. Comput. 33(2) 488-511
Higham N J (2008) Functions of Matrices: Theory and Computation SIAM, Philadelphia, PA, USA

Parameters

Compulsory Input Parameters

1:     m – int64int32nag_int scalar
mm, the number of columns of the matrix BB.
Constraint: m0m0.
2:     a(lda, : :) – double array
The first dimension of the array a must be at least max (1,n)max(1,n)
The second dimension of the array must be at least nn
The nn by nn matrix AA.
3:     b(ldb, : :) – double array
The first dimension of the array b must be at least max (1,n)max(1,n)
The second dimension of the array must be at least mm
The nn by mm matrix BB.
4:     t – double scalar
The scalar tt.

Optional Input Parameters

1:     n – int64int32nag_int scalar
Default: The first dimension of the arrays a, b.
nn, the order of the matrix AA.
Constraint: n0n0.

Input Parameters Omitted from the MATLAB Interface

lda ldb

Output Parameters

1:     a(lda, : :) – double array
The first dimension of the array a will be max (1,n)max(1,n)
The second dimension of the array will be nn
ldamax (1,n)ldamax(1,n).
AA is overwritten during the computation.
2:     b(ldb, : :) – double array
The first dimension of the array b will be max (1,n)max(1,n)
The second dimension of the array will be mm
ldbmax (1,n)ldbmax(1,n).
The nn by mm matrix etABetAB.
3:     ifail – int64int32nag_int scalar
ifail = 0ifail=0 unless the function detects an error (see [Error Indicators and Warnings]).

Error Indicators and Warnings

Errors or warnings detected by the function:

Cases prefixed with W are classified as warnings and do not generate an error of type NAG:error_n. See nag_issue_warnings.

  ifail = 1ifail=1
Note:  this failure should not occur, and suggests that the function has been called incorrectly. An unexpected internal error occurred when trying to balance the matrix AA.
W ifail = 2ifail=2
etABetAB has been computed using an IEEE double precision Taylor series, although the arithmetic precision is higher than IEEE double precision.
  ifail = 1ifail=-1
Constraint: n0n0.
  ifail = 2ifail=-2
Constraint: m0m0.
  ifail = 4ifail=-4
Constraint: ldamax (1,n)ldamax(1,n).
  ifail = 6ifail=-6
Constraint: ldbmax (1,n)ldbmax(1,n).
  ifail = 999ifail=-999
Allocation of memory failed.

Accuracy

For a symmetric matrix AA (for which AT = AAT=A) the computed matrix etABetAB is guaranteed to be close to the exact matrix, that is, the method is forward stable. No such guarantee can be given for non-symmetric matrices. See Section 4 of Al–Mohy and Higham (2011) for details and further discussion.

Further Comments

The matrix etABetAB could be computed by explicitly forming etAetA using nag_matop_real_gen_matrix_exp (f01ec) and multiplying BB by the result. However, experiments show that it is usually both more accurate and quicker to use nag_matop_real_gen_matrix_actexp (f01ga).
The cost of the algorithm is O(n2m)O(n2m). The precise cost depends on AA since a combination of balancing, shifting and scaling is used prior to the Taylor series evaluation.
Approximately n2 + (2m + 8) n n2+ (2m+8) n  of real allocatable memory is required by nag_matop_real_gen_matrix_actexp (f01ga).
nag_matop_complex_gen_matrix_actexp (f01ha) can be used to compute etABetAB for complex AA, BB, and tt. nag_matop_real_gen_matrix_actexp_rcomm (f01gb) provides an implementation of the algorithm with a reverse communication interface, which returns control to the user when matrix multiplications are required. This should be used if AA is large and sparse.

Example

function nag_matop_real_gen_matrix_actexp_example
a = [0.7,-0.2, 1.0, 0.3;
     0.3, 0.7, 1.2, 1.0;
     0.9, 0.0, 0.2, 0.7;
     2.4, 0.1, 0.0, 0.2];
b = [0.1, 1.2;
     1.3, 0.2;
     0.0, 1.0;
     0.4, -0.9];
m = int64(2);
t = 1.2;
% Compute exp(ta)b
[a, b, ifail] = nag_matop_real_gen_matrix_actexp(m, a, b, t)
 

a =

    0.2500   -0.8000    2.0000    0.6000
    0.0750    0.2500    0.6000    0.5000
    0.4500         0   -0.2500    0.7000
    1.2000    0.2000         0   -0.2500


b =

    0.2138    7.6756
    4.9980   11.6051
    0.8307    7.5468
    1.2406    9.7261


ifail =

                    0


function f01ga_example
a = [0.7,-0.2, 1.0, 0.3;
     0.3, 0.7, 1.2, 1.0;
     0.9, 0.0, 0.2, 0.7;
     2.4, 0.1, 0.0, 0.2];
b = [0.1, 1.2;
     1.3, 0.2;
     0.0, 1.0;
     0.4, -0.9];
m = int64(2);
t = 1.2;
% Compute exp(ta)b
[a, b, ifail] = f01ga(m, a, b, t)
 

a =

    0.2500   -0.8000    2.0000    0.6000
    0.0750    0.2500    0.6000    0.5000
    0.4500         0   -0.2500    0.7000
    1.2000    0.2000         0   -0.2500


b =

    0.2138    7.6756
    4.9980   11.6051
    0.8307    7.5468
    1.2406    9.7261


ifail =

                    0



PDF version (NAG web site, 64-bit version, 64-bit version)
Chapter Contents
Chapter Introduction
NAG Toolbox

© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2013