As far as I can tell, the problem is that you use the predefined i which is
a symbolic constant rather than a numerical one.  (Maybe someone else can
elaborate on this.)

Here are some ways you can get the right answer:

1. declare i explicitly to be a complex number:

sage: A=matrix([[-1,-1+CC(i)],[1,0]])
sage: A.eigenvalues()
[1.00000000000000*I, -1.00000000000000 - 1.00000000000000*I]

2. the above uses the predefined field of complex numbers CC, which has
precision 53 bits.  If you want a different precision, say 20 bits:

sage: C.<i> = ComplexField(20)
sage: A=matrix([[-1,-1+i],[1,0]])
sage: A.eigenvalues()
[1.0000*I, -1.0000 - 1.0000*I]

3. or, if you prefer to work with exact quantities:

sage: K.<i> = QuadraticField(-1)
sage: A=matrix([[-1,-1+i],[1,0]])
sage: A.eigenvalues()
[i, -i - 1]


Hope this helps,
Alex


On Fri, Nov 7, 2008 at 3:21 PM, DJDANG <[EMAIL PROTECTED]> wrote:

>
> Hi everyone, I'm having this problem finding the correct eigenvalues
> of a matrix. I've tried the code with other problems and worked, but
> It doesn't work with this one. The exercise is this one:
>
> -Find the eigenvalues and eigenvectors of the matrix
> A=(matrix[[-1,-1+i],[1,0]])
>
> When I do this problem on a paper the result shows both lambdas as
> lambda1=i and lambda2=-1-i; but when I try to do it in sage, it throws
> me this: labmda1=-(sqrt(4i-3)-1)/2 and lambda2=(sqrt(4i-3)-1)/2.
>
> I think it might be an equality in the results but i havent been able
> to prove it.
> If anybody can help me to find a way to solve this problem showing the
> lambdas I get when doing it on paper in sage, I'd be thankfull
>
> Thanks in advance,
> Daniel
> >
>


-- 
Alex Ghitza -- Lecturer in Mathematics -- The University of Melbourne --
Australia -- 
http://www.ms.unimelb.edu.au/~aghitza/<http://www.ms.unimelb.edu.au/%7Eaghitza/>

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to