eigenvalues problem




On Tue, 25 Aug 2009, Bernhard Stoevesandt wrote:

< Hi, hm no. It doesn't work. Now i get:
< (%i1)
< A:2*matrix([(2*m1^2+2*m2*m4+2*m3*m7),m3*m8+m6*m7+m4*m5+m2*m5+m1*m4+m1*m2,m1*m3+m1*m7+m2*m6+m4*m8+m3*m9+m7*m9],[m3*m8+m6*m7+m4*m5+m2*m5+m1*m4+m1*m2,
< 2*m5^2+2*m2*m4+2*m6*m8,
< m2*m7+m4*m3+m5*m6+m5*m8+m6*m9+m8*m9],[m1*m3+m1*m7+m2*m6+m4*m8+m3*m9+m7*m9,m2*m7+m4*m3+m5*m6+m5*m8+m6*m9+m8*m9,
< 2*m9^2+2*m3*m7+2*m6*m8]);
<                [                                      2            ]
<                [           2 (2 m3 m7 + 2 m2 m4 + 2 m1 )           ]
< (%o1)  Col 1 = [                                                   ]
<                [ 2 (m3 m8 + m6 m7 + m4 m5 + m2 m5 + m1 m4 + m1 m2) ]
<                [                                                   ]
<                [ 2 (m7 m9 + m3 m9 + m4 m8 + m1 m7 + m2 m6 + m1 m3) ]
<          [ 2 (m3 m8 + m6 m7 + m4 m5 + m2 m5 + m1 m4 + m1 m2) ]
<          [                                                   ]
<  Col 2 = [                            2                      ]
<          [           2 (2 m6 m8 + 2 m5  + 2 m2 m4)           ]
<          [                                                   ]
<          [ 2 (m8 m9 + m6 m9 + m5 m8 + m2 m7 + m5 m6 + m3 m4) ]
<          [ 2 (m7 m9 + m3 m9 + m4 m8 + m1 m7 + m2 m6 + m1 m3) ]
<          [                                                   ]
<  Col 3 = [ 2 (m8 m9 + m6 m9 + m5 m8 + m2 m7 + m5 m6 + m3 m4) ]
<          [                                                   ]
<          [                  2                                ]
<          [           2 (2 m9  + 2 m6 m8 + 2 m3 m7)           ]
< (%i2) eigenvalues(A)$
< Maxima encountered a Lisp error:
< 
<  Error in CONDITIONS::CLCS-UNIVERSAL-ERROR-HANDLER [or a callee]:
< Couldn't protect
< 
< Automatically continuing.
< To reenable the Lisp debugger set *debugger-hook* to nil
< 
< 
< The version is for Ubuntu 8.10
< Maxima version: 5.13.0
< Maxima build date: 3:56 12/15/2007
< host type: x86_64-unknown-linux-gnu
< lisp-implementation-type: GNU Common Lisp (GCL)
< lisp-implementation-version: GCL 2.6.8
 
Bernhard,
I think that you will have fewer problems if you solve for the
eigenvalues of a 3x3 matrix, and then substitute your coefficients into
the answer. For example:


evsfn(X) := block(
  [A,a,p,x,evs,s,i,j],
  A : genmatrix(a,3,3),
  p : charpoly(A,x),
  evs : solve(p,x),
  s : flatten(makelist(makelist(a[i,j]=X[i,j],i,1,3),j,1,3)),
  subst(s,evs))$

(%i3) B : matrix([1,0,3],[0,2,3],[0,0,3]);

(%o3) matrix([1,0,3],[0,2,3],[0,0,3])
(%i4) evsfn(B);

(%o4) [x = (sqrt(3)*%i/2-1/2)/((-1)^(1/6)*sqrt(3))
         +(-1)^(1/6)*(-sqrt(3)*%i/2-1/2)/sqrt(3)+2,
       x = (-1)^(1/6)*(sqrt(3)*%i/2-1/2)/sqrt(3)
         +(-sqrt(3)*%i/2-1/2)/((-1)^(1/6)*sqrt(3))+2,
       x = (-1)^(1/6)/sqrt(3)+1/((-1)^(1/6)*sqrt(3))+2]
(%i5) rectform(%);

(%o5) [x = 2,x = 1,x = 3]

Note that your matrix depends on a large number of parameters, so your
answer is unlikely to be enlightening.

Also, note that the version of maxima you are using is 5.13.0 while the
current release is 5.19.1.

Leo

-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.