This seems to work:
given a symbolic matrix P of dimension 2x2 do:

EVECP = maxima(P).eigenvectors()
EVEC1 = EVECP.part(2)
(first eigenvector)
EVEC2 = EVECP.part(3)
(second eigenvector)
EIGENVECT = (matrix(SR, 2,2, [EVEC1.sage(), EVEC2.sage()])).transpose
()                                            (matrix of eigenvectors)

for the inverse:
EIGENVECTINV = EIGENVECT.inverse()
(EIGENVECTINV * EIGENVECT).simplify_rational()
gives identity matrix.

the eigenvalues of P with multiplicity (!) can be read with
EVECP.part(1)

Is this correct ?

Is there a way to symbolically compute the matrix exponential
directly ?
THX !

On Mar 10, 4:05 pm, alex <alessandro.bernardini.1...@gmail.com> wrote:
> How can I collect the eigenvectors to form an eigenvector matrix ?
>
> I have tried all matrix commands and I always get some error !
>
> Sorry,
> THX
>
> On Mar 10, 3:27 pm, Jason Grout <jason-s...@creativetrax.com> wrote:
>
> > Iwan Lappo-Danilewski wrote:
> > > Why does a Matrix not possess the function full_simpify. I.e. why does
> > > P.full_simplify() not work?
>
> > It's probably because no one has written it yet.  I think it'd be great
> > to have.  We welcome any patches to do that.
>
> > You can do the same thing using the apply_map function, which applies a
> > function to each entry of a matrix.
>
> > sage: var('a,b,c,d')
> > (a, b, c, d)
> > sage: A=matrix([[sin(a+b), sin(c+d)],[cos(a+d),cos(b+d)]])
> > sage: A
>
> > [sin(b + a) sin(d + c)]
> > [cos(d + a) cos(d + b)]
> > sage: B=A.apply_map(lambda x: x.full_simplify())
> > sage: B
>
> > [cos(a)*sin(b) + sin(a)*cos(b) cos(c)*sin(d) + sin(c)*cos(d)]
> > [cos(a)*cos(d) - sin(a)*sin(d) cos(b)*cos(d) - sin(b)*sin(d)]
>
> > Jason
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to