PDF version (NAG web site
, 64-bit version, 64-bit version)
NAG Toolbox: nag_matop_real_symm_matrix_exp (f01ed)
Purpose
nag_matop_real_symm_matrix_exp (f01ed) computes the matrix exponential, , of a real symmetric by matrix .
Syntax
[
a,
ifail] = nag_matop_real_symm_matrix_exp(
uplo,
a, 'n',
n)
Description
is computed using a spectral factorization of
where
is the diagonal matrix whose diagonal elements,
, are the eigenvalues of
, and
is an orthogonal matrix whose columns are the eigenvectors of
.
is then given by
where
is the diagonal matrix whose
th diagonal element is
. See for example Section 4.5 of
Higham (2008).
References
Higham N J (2008) Functions of Matrices: Theory and Computation SIAM, Philadelphia, PA, USA
Moler C B and Van Loan C F (2003) Nineteen dubious ways to compute the exponential of a matrix, twenty-five years later SIAM Rev. 45 3–49
Parameters
Compulsory Input Parameters
- 1:
– string (length ≥ 1)
-
Indicates whether the upper or lower triangular part of
is stored.
- The upper triangular part of is stored.
- The lower triangular part of is stored.
Constraint:
or .
- 2:
– double array
-
The first dimension of the array
a must be at least
.
The second dimension of the array
a must be at least
.
The
by
symmetric matrix
.
- If , the upper triangular part of must be stored and the elements of the array below the diagonal are not referenced.
- If , the lower triangular part of must be stored and the elements of the array above the diagonal are not referenced.
Optional Input Parameters
- 1:
– int64int32nag_int scalar
-
Default:
the first dimension of the array
a.
, the order of the matrix .
Constraint:
.
Output Parameters
- 1:
– double array
-
The first dimension of the array
a will be
.
The second dimension of the array
a will be
.
If , the upper or lower triangular part of the by matrix exponential, .
- 2:
– int64int32nag_int scalar
unless the function detects an error (see
Error Indicators and Warnings).
Error Indicators and Warnings
Errors or warnings detected by the function:
-
-
The computation of the spectral factorization failed to converge.
-
-
Constraint: or .
-
-
Constraint: .
-
-
An internal error occurred when computing the spectral factorization. Please contact
NAG.
-
-
Constraint: .
-
An unexpected error has been triggered by this routine. Please
contact
NAG.
-
Your licence key may have expired or may not have been installed correctly.
-
Dynamic memory allocation failed.
Accuracy
For a symmetric matrix
, the matrix
, has the relative condition number
which is the minimum possible for the matrix exponential and so the computed matrix exponential is guaranteed to be close to the exact matrix. See Section 10.2 of
Higham (2008) for details and further discussion.
Further Comments
The integer allocatable memory required is
n, and the double allocatable memory required is approximately
, where
nb is the block size required by
nag_lapack_dsyev (f08fa).
The cost of the algorithm is .
As well as the excellent book cited above, the classic reference for the computation of the matrix exponential is
Moler and Van Loan (2003).
Example
This example finds the matrix exponential of the symmetric matrix
Open in the MATLAB editor:
f01ed_example
function f01ed_example
fprintf('f01ed example results\n\n');
uplo = 'u';
a = [1, 2, 3, 4;
0, 1, 2, 3;
0, 0, 1, 2;
0, 0, 0, 1];
[expa, ifail] = f01ed(uplo, a);
[ifail] = x04ca(uplo, 'n', expa, 'Symmetric Exp(a)');
f01ed example results
Symmetric Exp(a)
1 2 3 4
1 2675.3899 2193.0210 2193.2062 2675.2803
2 1798.3297 1797.8497 2193.2062
3 1798.3297 2193.0210
4 2675.3899
PDF version (NAG web site
, 64-bit version, 64-bit version)
© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2015