Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
17
Добавлен:
09.02.2015
Размер:
239.1 Кб
Скачать

Matrix functions

<expm> - Matrix exponential.

EXPM Matrix exponential.

EXPM(X) is the matrix exponential of X. EXPM is computed using

a scaling and squaring algorithm with a Pade approximation.

Although it is not computed this way, if X has a full set

of eigenvectors V with corresponding eigenvalues D, then

[V,D] = EIG(X) and EXPM(X) = V*diag(exp(diag(D)))/V.

EXP(X) computes the exponential of X element-by-element.

See also logm, sqrtm, funm.

Reference page in Help browser

doc expm

<logm> - Matrix logarithm.

LOGM Matrix logarithm.

L = LOGM(A) is the principal matrix logarithm of A, the inverse of EXPM(A).

L is the unique logarithm for which every eigenvalue has imaginary part

lying strictly between -PI and PI. If A is singular or has any eigenvalues

on the negative real axis, then the principal logarithm is undefined,

a non-principal logarithm is computed, and a warning message is printed.

[L,EXITFLAG] = LOGM(A) returns a scalar EXITFLAG that describes

the exit condition of LOGM:

EXITFLAG = 0: successful completion of algorithm.

EXITFLAG = 1: too many matrix square roots needed.

Computed L may still be accurate, however.

Note: this is different from R13 and earlier versions, which returned as

second output argument an expensive and often inaccurate error estimate.

Class support for input A:

float: double, single

See also expm, sqrtm, funm.

Reference page in Help browser

doc logm

<sqrtm> - Matrix square root.

SQRTM Matrix square root.

X = SQRTM(A) is the principal square root of the matrix A, i.e. X*X = A.

X is the unique square root for which every eigenvalue has nonnegative

real part. If A has any real, negative eigenvalues then a complex

result is produced. If A is singular then A may not have a

square root. A warning is printed if exact singularity is detected.

With two output arguments, [X, RESNORM] = SQRTM(A) does not print any

warning, and returns the residual, norm(A-X^2,'fro')/norm(A,'fro').

With three output arguments, [X, ALPHA, CONDEST] = SQRTM(A) returns a

stability factor ALPHA and an estimate CONDEST of the matrix square root

condition number of X. The residual NORM(A-X^2,'fro')/NORM(A,'fro') is

bounded approximately by N*ALPHA*EPS and the Frobenius norm relative

error in X is bounded approximately by N*ALPHA*CONDEST*EPS, where

N = MAX(SIZE(A)).

See also expm, logm, funm.

Overloaded methods:

lti/sqrtm

frd/sqrtm

Reference page in Help browser

doc sqrtm

<funm> - Evaluate general matrix function.

FUNM Evaluate general matrix function.

F = FUNM(A,FUN) evaluates the function_handle FUN at the square

matrix A. FUN(X,K) must return the K'th derivative of the function

represented by FUN evaluated at the vector X.

The MATLAB functions EXP, LOG, COS, SIN, COSH, SINH can be passed

as FUN, i.e., FUNM(A,@EXP), FUNM(A,@LOG), FUNM(A,@COS), FUNM(A,@SIN),

FUNM(A,@COSH), FUNM(A,@SINH) are all allowed.

For matrix square roots use SQRTM(A) instead.

For matrix exponentials, either of EXPM(A) and FUNM(A,@EXP) may be

the more accurate, depending on A.

The function represented by FUN must have a Taylor series with an

infinite radius of convergence, except for FUN = @LOG,

which is treated as a special case.

Example:

To compute the function EXP(X)+COS(X) at A with one call to FUNM, use

F = funm(A,@fun_expcos)

where

function f = fun_expcos(x,k)

% Return k'th derivative of EXP+COS at X.

g = mod(ceil(k/2),2);

if mod(k,2)

f = exp(x) + sin(x)*(-1)^g;

else

f = exp(x) + cos(x)*(-1)^g;

end

F = FUNM(A,FUN,options) sets the algorithm's parameters to the

values in the structure options.

options.Display: Level of display

[ {off} | on | verbose ]

options.TolBlk: Tolerance for blocking Schur form

[ positive scalar {0.1} ]

options.TolTay: Termination tolerance for evaluating Taylor

series of diagonal blocks

[ positive scalar {eps} ]

options.MaxTerms: Maximum number of Taylor series terms

[ positive integer {100} ]

options.MaxSqrt: When computing logarithm, maximum number of

matrix square roots computed in inverse scaling

and squaring method

[ positive integer {100} ]

options.Ord: A specified ordering of the Schur form, T.

A vector of length LENGTH(A), with options.Ord(i)

the index of the block into which T(i,i)

should be placed,

[ integer vector {[]} ]

F = FUNM(A,FUN,options,P1,P2,...) passes extra inputs

P1,P2,... to the function: FUN(X,K,P1,P2,...).

Use options = [] as a place holder if no options are set.

[F,EXITFLAG] = FUNM(...) returns a scalar EXITFLAG that describes

the exit condition of FUNM:

EXITFLAG = 0: successful completion of algorithm.

EXITFLAG = 1: one or more Taylor series evaluations did not converge

or, for logarithm, too many matrix square roots

needed. Computed F may still be accurate, however.

Note: this is different from R13 and earlier versions, which returned as

second output argument an expensive and often inaccurate error estimate.

[F,EXITFLAG,output] = FUNM(...) returns a structure output with

output.terms(i): the number of Taylor series terms used

when evaluating the i'th block, or the number of

square roots of matrices of dimension > 2

in the case of the logarithm,

output.ind(i): cell array specifying the blocking: the (i,j)

block of the re-ordered Schur factor T is

T(output.ind{i},output.ind{j}),

output.ord: the ordering, as passed to ORDSCHUR,

output.T: the re-ordered Schur form.

If the Schur form is diagonal then

output = struct('terms',ones(n,1),'ind',{1:n})

See also expm, sqrtm, logm, function_handle.

Reference page in Help browser

doc funm

Соседние файлы в папке Библиотеки Matlab