help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sqrt() of a Matrix in a DLD


From: Henry F. Mollet
Subject: Re: sqrt() of a Matrix in a DLD
Date: Fri, 05 Mar 2004 10:32:05 -0800
User-agent: Microsoft-Entourage/10.1.1.2418

on 3/5/04 9:09 AM, Al Niessner at address@hidden wrote:

> 
> I did a 'grep -i sqrt' in include/octave-2.1.52/octave and did not find
> anything that would indicate how to take the square root of a matrix. My
> m-file has sqrt(m) where m is a diagonal matrix. I could not find a
> similar function in the header files. Anyone know the correct syntax?

Below is from my "Interpreter" which is on my desktop.
Henry


20.3 Functions of a Matrix

Loadable Function: expm (a)
Return the exponential of a matrix, defined as the infinite Taylor series

 
expm(a) = I + a + a^2/2! + a^3/3! + ...

The Taylor series is not the way to compute the matrix exponential; see
Moler and Van Loan, Nineteen Dubious Ways to Compute the Exponential of a
Matrix , SIAM Review, 1978.  This routine uses Ward's diagonal Pade'
approximation method with three step preconditioning (SIAM Journal on
Numerical Analysis, 1977).  Diagonal Pade'  approximations are rational
polynomials of matrices

 
-1
D (a)   N (a) 

whose Taylor series matches the first 2q+1 terms of the Taylor series above;
direct evaluation of the Taylor series (with the same preconditioning steps)
may be desirable in lieu of the Pade' approximation when Dq(a) is
ill-conditioned. 

Loadable Function: logm (a)
Compute the matrix logarithm of the square matrix a.  Note that this is
currently implemented in terms of an eigenvalue expansion and needs to be
improved to be more robust.

Loadable Function: sqrtm (a)
Compute the matrix square root of the square matrix a.  Note that this is
currently implemented in terms of an eigenvalue expansion and needs to be
improved to be more robust.

Function File: kron (a,b)
Form the kronecker product of two matrices, defined block by block as

 
x = [a(i, j) b] 

For example, 

 
kron (1:4, ones (3, 1))
      =>  1  2  3  4
          1  2  3  4
          1  2  3  4

Loadable Function: x=syl (a,b,c)
Solve the Sylvester equation

 
A X + X B + C = 0 
using standard LAPACK subroutines.  For example,

 
syl ([1, 2; 3, 4], [5, 6; 7, 8], [9, 10; 11, 12])
     => [ -0.50000, -0.66667; -0.66667, -0.50000 ] 




-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]