Subject: How can I calculate the matrix's exponential?
From: Barton Willis
Date: Fri, 1 Apr 2005 08:06:29 -0600
maxima-admin@math.utexas.edu wrote on 04/01/2005 04:33:53 AM:
> By using
> a:Matrix([b,c],[0,d]);
> e^a;
>
> I cannot get the wanted result, Please tell me how to get its result?
There are at least three packages for matrix exponentiation.
I'll describe the one I wrote. Get the file 'matrixexp-1.0.tar.gz' from
http://www.unk.edu/acad/math/people/willisb/ and unpack it.
(%i1) load("l:/matrixexp-1.0/matrixexp");
(%O1) l:/matrixexp-1.0/matrixexp.lisp
(%i2) m : matrix([b,c],[0,d])$
To exponentiate a matrix, use 'matrixexp.'
(%i3) matrixexp(m);
Proviso: assuming d-b # 0
(%O3) matrix([%e^B,(C*%e^D-%e^B*C)/(D-B)],[0,%e^D])
The proviso message tells us that d-b = 0 is a special
case. Let's substitute d -> b
(%i4) subst(d=b,m);
(%O4) matrix([B,C],[0,B])
(%i5) matrixexp(%);
(%O5) matrix([%e^B,%e^B*C],[0,%e^B])
To compute exp(m z), where z is a scalar, use an
optional second argument
(%i6) matrixexp(m,z);
Proviso: assuming d-b # 0
(%O6) matrix([%e^(B*Z),(C*%e^(D*Z)-C*%e^(B*Z))/(D-B)],[0,%e^(D*Z)])
To find log(m),
(%i9) matrixfun(lambda([x],log(x)),m);
Proviso: assuming d-b # 0
(%O9) matrix([log(B),(C*log(D)-log(B)*C)/(D-B)],[0,log(D)])
Finally, the spectral representation (linear combination
of projections plus a nilpotent)
(%i12) spectral_rep(m);
Proviso: assuming d-b # 0
(%O12)
[[D,B],[matrix([0,C/(D-B)],[0,1]),matrix([1,-C/(D-B)],[0,0])],matrix([0,0],[0,0])]
(%i13) spectral_rep(subst(d=b,m));
(%O13) [[B],[matrix([1,0],[0,1])],matrix([0,C],[0,0])]
See the file 'matrixexp.usage' for more information.
Barton