axiom-math
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Axiom-math] numerical roots for polynom and eigenvalues for matrix


From: Vanuxem Grégory
Subject: Re: [Axiom-math] numerical roots for polynom and eigenvalues for matrix float
Date: Mon, 13 Mar 2006 19:40:07 +0100

Le lundi 13 mars 2006 à 11:37 +0100, Francois Maltey a écrit : 
> Hello,
> 
> I continue to test my classical exercices with axiom.
> 
> I can't play with eigenvalue / eigenvector for Matrix Float.

It's not possible, you have to coerce your Matrix Float to Matrix
Fraction Integer. The '::' operator will call rationalApproximation in
the Float package (see src/algebra/float.spad.pamphlet). After you can
obtain Float results. For example if A is a Float Matrix:

complexEigenvectors(A::MATRIX FRAC INT,1.e-20) returns all (Complex
Float) eigenvalues and eigenvectors.

realEigenvectors(a::MATRIX FRAC INT,1.e-20) returns real (Float)
eigenvalues and eigenvectors

> 
> I can compute det (M - x (1)_n), 
> but I can't find root of a Polynomial Float, is it possible ?

I assume you want the numerical roots (mail subject).
It's possible to use the computationally expensive algorithm in the 
ComplexRootFindingPackage, so if pol is a polynomial Float:

complexZeros(pol,1.e-15)$ComplexRootFindingPackage(FLOAT,UP(x, COMPLEX
FLOAT))

It's also possible if you coerce your Polynomial Float to FRAC POLY INT.
To do so, you have to initially coerce it to POLY FRAC INT (it will
call, as above, rationalApproximation) and after to FRAC POLY INT.
This coercion involves a "commutation" coded in the interpreter (in
src/interp,i-coerfn.boot.pamphlet) that coerces for example POLY FRAC
INT to FRAC POLY INT or COMPLEX FRAC INT to FRAC COMPLEX INT.
So

qpol := pol::POLY FRAC INT::FRAC POLY INT
realRoots(qpol,1.e-20) returns real (Float) roots.
and 
complexRoots(qpol,1.e-20) returns all the roots (Complex Float)



In these examples the results are computed to precision eps=1.e-20. You
can change its type (to rational, the result will be expressed as
rational number) or its value, see src/algebra/numeigen.spad.pamphlet
and src/algebra/numsolve.spad.pamphlet.

Cheers,

Greg

PS: The attachement contains an axiom session (with ')set output length
110) with all the examples above.

> Have a good day !
> 
> François.
> 
> 
> _______________________________________________
> Axiom-math mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/axiom-math
> 






reply via email to

[Prev in Thread] Current Thread [Next in Thread]