f01fc computes the matrix exponential, eA, of a complex n by n matrix A.

Syntax

C#
public static void f01fc(
	int n,
	Complex[,] a,
	out int ifail
)
Visual Basic
Public Shared Sub f01fc ( _
	n As Integer, _
	a As Complex(,), _
	<OutAttribute> ByRef ifail As Integer _
)
Visual C++
public:
static void f01fc(
	int n, 
	array<Complex,2>^ a, 
	[OutAttribute] int% ifail
)
F#
static member f01fc : 
        n : int * 
        a : Complex[,] * 
        ifail : int byref -> unit 

Parameters

n
Type: System..::..Int32
On entry: n, the order of the matrix A.
Constraint: n0.
a
Type: array<NagLibrary..::..Complex,2>[,](,)[,][,]
An array of size [dim1, dim2]
Note: dim1 must satisfy the constraint: dim1n
Note: the second dimension of the array a must be at least n.
On entry: the n by n matrix A.
On exit: with ifail=0, the n by n matrix exponential eA.
ifail
Type: System..::..Int32%
On exit: ifail=0 unless the method detects an error or a warning has been flagged (see [Error Indicators and Warnings]).

Description

eA is computed using a Padé approximant and the scaling and squaring method described in Al–Mohy and Higham (2009).

References

Al–Mohy A H and Higham N J (2009) A new scaling and squaring algorithm for the matrix exponential SIAM J. Matrix Anal. 31(3) 970–989
Higham N J (2005) The scaling and squaring method for the matrix exponential revisited SIAM J. Matrix Anal. Appl. 26(4) 1179–1193
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

Error Indicators and Warnings

Errors or warnings detected by the method:
Some error messages may refer to parameters that are dropped from this interface (LDA) In these cases, an error in another parameter has usually caused an incorrect value to be inferred.
ifail=1
The linear equations to be solved for the Padé approximant are singular; it is likely that this method has been called incorrectly.
ifail=2
The linear equations to be solved are nearly singular and the Padé approximant probably has no correct figures; it is likely that this method has been called incorrectly.
ifail=3
eA has been computed using an IEEE double precision Padé approximant, although the arithmetic precision is higher than IEEE double precision.
ifail=4
An unexpected internal error has occurred. Please contact NAG.
ifail=-1
On entry, n=value.
Constraint: n0.
ifail=-3
On entry, lda=value and n=value.
Constraint: ldan.
ifail=-999
Dynamic memory allocation failed.
ifail=-9000
An error occured, see message report.
ifail=-6000
Invalid Parameters value
ifail=-4000
Invalid dimension for array value
ifail=-8000
Negative dimension for array value
ifail=-6000
Invalid Parameters value

Accuracy

For a normal matrix A (for which AHA=AAH) the computed matrix, eA, is guaranteed to be close to the exact matrix, that is, the method is forward stable. No such guarantee can be given for non-normal matrices. See Al–Mohy and Higham (2009) and Section 10.3 of Higham (2008) for details and further discussion.
If estimates of the condition number of the matrix exponential are required then (F01KGF not in this release) should be used.

Parallelism and Performance

None.

Further Comments

The cost of the algorithm is On3; see Section 5 of Al–Mohy and Higham (2009). The complex allocatable memory required is approximately 6×n2.
If the Fréchet derivative of the matrix exponential is required then (F01KHF not in this release) should be used.
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 matrix
A=1+2i2+2i2+2i2+i3+2i112+i3+2i2+2i12+i3+2i3+2i3+2i1+i.

Example program (C#): f01fce.cs

Example program data: f01fce.d

Example program results: f01fce.r

See Also