# naginterfaces.library.matop.real_​gen_​matrix_​fun_​std¶

naginterfaces.library.matop.real_gen_matrix_fun_std(fun, a)[source]

real_gen_matrix_fun_std computes the matrix exponential, sine, cosine, sinh or cosh, of a real matrix using the Schur–Parlett algorithm.

For full information please refer to the NAG Library document for f01ek

https://www.nag.com/numeric/nl/nagdoc_28.4/flhtml/f01/f01ekf.html

Parameters
funstr

Indicates which matrix function will be computed.

The matrix exponential, , will be computed.

The matrix sine, , will be computed.

The matrix cosine, , will be computed.

The hyperbolic matrix sine, , will be computed.

The hyperbolic matrix cosine, , will be computed.

afloat, array-like, shape

The matrix .

Returns
afloat, ndarray, shape

The matrix, .

imnormfloat

If has complex eigenvalues, real_gen_matrix_fun_std will use complex arithmetic to compute the matrix function. The imaginary part is discarded at the end of the computation, because it will theoretically vanish. contains the -norm of the imaginary part, which should be used to check that the routine has given a reliable answer.

If has real eigenvalues, real_gen_matrix_fun_std uses real arithmetic and .

Raises
NagValueError
(errno )

On entry, .

Constraint: .

(errno )

Input argument is invalid.

(errno )

A Taylor series failed to converge.

(errno )

(errno )

There was an error whilst reordering the Schur form of .

Note: this failure should not occur and suggests that the function has been called incorrectly.

(errno )

The function was unable to compute the Schur decomposition of .

Note: this failure should not occur and suggests that the function has been called incorrectly.

(errno )

(errno )

The linear equations to be solved are nearly singular and the Padé approximant used to compute the exponential may have no correct figures.

Note: this failure should not occur and suggests that the function has been called incorrectly.

Notes

, where is either the exponential, sine, cosine, sinh or cosh, is computed using the Schur–Parlett algorithm described in Higham (2008) and Davies and Higham (2003).

References

Davies, P I and Higham, N J, 2003, A Schur–Parlett algorithm for computing matrix functions, SIAM J. Matrix Anal. Appl. (25(2)), 464–485

Higham, N J, 2008, Functions of Matrices: Theory and Computation, SIAM, Philadelphia, PA, USA