comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: matrix log and exp
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: matrix log and exp [message #30289 is a reply to message #30276] Wed, 17 April 2002 14:52 Go to previous messageGo to previous message
James Kuyper is currently offline  James Kuyper
Messages: 425
Registered: March 2000
Senior Member
Paul Van Delst wrote:

> G Karas wrote:
>
>> Hi group,
>> one quickie and possibly difficult:
>>
>> IDL does not have a matrix logarithm logm and matrix
>> exponent expm function. I was thinking of calling lapack
>> routines which do it, but have no experience with lapack
>> or FORTRAN. Anyone with any tips on this one?
>
>
> Yes. Use ALOG() and EXP().
>
> paulv

He's talking about matrix logarithm and exponent, not the
element-by-element logarithm and exponent. When you calculate
exp(matrix), it produces a new matrix, each of whos elements is exp() of
the corresponding element of the input matrix.

That's very different from the matrix exponential function of x, which
is defined only for square matrices. It uses the same Taylor series
expansion:

1 + x + x^2/2! + x^3/3! + x^4/4! ...

but interprets '1' as the identity matrix of the appropriate size, and
x^n as the matrix multiplication of x by itself n times.

For instance:

IDL> A = [[0,1],[1,0]]
IDL> print, exp(A)
1.00000 2.71828
2.71828 1.00000

Since, for matrix multiplication, A^n = A if n is odd, and
A^n=[[1,0],[0,1]] if n is even, the diagonal elements pick up the even
terms of the exponential series, and the off-diagonal terms pick up odd
terms. Those series are easily summed analytically, giving a matrix
exponential of A as:

IDL> print, [[cosh(1),sinh(1)],[sinh(1),cosh(1)]]
1.54308 1.17520
1.17520 1.54308

Which is quite a bit different from exp(A).
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Finding all angles within a range of directions; an algorithm question
Next Topic: need IDL/visual basic programmer for 1 year contract

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 03:46:25 PDT 2025

Total time taken to generate the page: 0.24351 seconds