Documentation

This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.

我们为许可用户提供了部分翻译好的中文文档。您只需登录便可查阅这些文档

Powers and Exponentials

Positive Integer Powers

If A is a square matrix and p is a positive integer, A^p effectively multiplies A by itself p-1 times. For example:

A = [1 1 1;1 2 3;1 3 6]

A =

     1     1     1
     1     2     3
     1     3     6

X = A^2

X =
     3     6    10
     6    14    25
    10    25    46

Inverse and Fractional Powers

If A is square and nonsingular, A^(-p) effectively multiplies inv(A) by itself p-1 times:

Y = A^(-3)

Y =

  145.0000 -207.0000   81.0000
 -207.0000  298.0000 -117.0000
   81.0000 -117.0000   46.0000

Fractional powers, like A^(2/3), are also permitted; the results depend upon the distribution of the eigenvalues of the matrix.

Element-by-Element Powers

The .^ operator produces element-by-element powers. For example:

X = A.^2

A =
     1     1     1
     1     4     9
     1     9    36

Exponentials

The function

sqrtm(A)

computes A^(1/2) by a more accurate algorithm. The m in sqrtm distinguishes this function from sqrt(A), which, like A.^(1/2), does its job element-by-element.

A system of linear, constant coefficient, ordinary differential equations can be written

$$ dx/dt = Ax, $$

where x = x(t) is a vector of functions of t and A is a matrix independent of t. The solution can be expressed in terms of the matrix exponential

$$ x(t) = e^{tA} x(0) $$.

The function

expm(A)

computes the matrix exponential. An example is provided by the 3-by-3 coefficient matrix,

A = [0 -6 -1; 6 2 -16; -5 20 -10]
A =

     0    -6    -1
     6     2   -16
    -5    20   -10

and the initial condition, x(0).

x0 = [1 1 1]'
x0 =

     1
     1
     1

The matrix exponential is used to compute the solution, x(t), to the differential equation at 101 points on the interval $0 \le t \le 1$.

X = [];
for t = 0:.01:1
   X = [X expm(t*A)*x0];
end

A three-dimensional phase plane plot shows the solution spiraling in towards the origin. This behavior is related to the eigenvalues of the coefficient matrix.

plot3(X(1,:),X(2,:),X(3,:),'-o')

Was this topic helpful?