Monday, August 3, 2009

exp

Exponential

Syntax

  • Y = exp(X)

Description

The exp function is an elementary function that operates element-wise on arrays. Its domain includes complex numbers.

Y = exp(X) returns the exponential for each element of X. For complex , it returns the complex exponential

.

Remark

Use expm for matrix exponentials.





expint

Exponential integral

Syntax

  • Y = expint(X)

Definitions

The exponential integral computed by this function is defined as

Another common definition of the exponential integral function is the Cauchy principal value integral

which, for real positive x, is related to expint as

Description

Y = expint(X) evaluates the exponential integral for each element of X.




expm

Matrix exponential

Syntax

  • Y = expm(X)

Description

Y = expm(X) raises the constant to the matrix power X. The expm function produces complex results if X has nonpositive eigenvalues.

Use exp for the element-by-element exponential.

Algorithm

expm is a built-in function that uses the Padé approximation with scaling and squaring. You can see the coding of this algorithm in the expm1 demo.

    Note The expm1, expm2, and expm3 demos illustrate the use of Padé approximation, Taylor series approximation, and eigenvalues and eigenvectors, respectively, to compute the matrix exponential.

    References [1] and [2] describe and compare many algorithms for computing a matrix exponential. The built-in method, expm, is essentially method 3 of [2].

Examples

This example computes and compares the matrix exponential of A and the exponential of A.

  • A = [1        1        0
    0 0 2
    0 0 -1 ];

    expm(A)
    ans =
    2.7183 1.7183 1.0862
    0 1.0000 1.2642
    0 0 0.3679

    exp(A)
    ans =
    2.7183 2.7183 1.0000
    1.0000 1.0000 7.3891
    1.0000 1.0000 0.3679

Notice that the diagonal elements of the two results are equal. This would be true for any triangular matrix. But the off-diagonal elements, including those below the diagonal, are different.

No comments:

Post a Comment