I'm new to Axiom, so maybe I'm doing things in a stupid way. I want to get (estimates of) the eigenvalues of a 10x10 matrix of floats: fricas m := matrix([[random()$Integer for i in 1..10] for j in 1..10]); sm := m + transpose(m); smf:Matrix Float := sm
Type: Matrix(Float)
The problem is: If I now call eigenvalues(smf) on the symmetric float matrix smf Axiom 3.0 Beta (February 2005) runs for a very long time (uncomment code if you want to try it): fricas )set messages time on Try this:: fricas eigen:=eigenvalues(sm)
fricas Time: 0.01 (IN) + 0.01 (EV) + 0.07 (OT) = 0.09 sec solve(rhs(eigen.1),
Type: List(Equation(Polynomial(Float)))
fricas Time: 0.03 (EV) + 0.01 (OT) = 0.04 sec Thank you! This helps, but doesn't answer everything. Since interestingly: fricas charpol := reduce(*,
Type: Polynomial(Float)
fricas Time: 0 sec we cannot recover the characteristic polynomial from this solution: Even if a large number is passed to solve, accuracy does not increase. To recover characteristic polynomial one needs good precision, which means very small second argument to solve. Giving large second arguments means very poor accuracy: fricas solve(x+11/10,
Type: List(Equation(Polynomial(Fraction(Integer))))
fricas Time: 0.01 (IN) = 0.01 sec To have use of precise solution we also need to increase precision of other floating point computations using digits. Unfortunately, this leads to ugly display, so we only show final result: fricas digits(120)
Type: PositiveInteger?
fricas Time: 0 sec ev:= solve(rhs(eigen.1), Type: List(Equation(Polynomial(Float)))
fricas Time: 0.09 (EV) = 0.09 sec cp:= reduce(*, Type: Polynomial(Float)
fricas Time: 0 sec rhs(eigen.1) - cp
Type: Polynomial(Float)
fricas Time: 0 sec test --unknown, Fri, 24 Jun 2005 04:48:11 -0500 reply fricas A:=[[a,
Type: List(List(Symbol))
fricas Time: 0.01 (OT) = 0.01 sec fricas A:=matrix[[cos(x),
Type: Matrix(Expression(Integer))
fricas Time: 0.04 (OT) = 0.04 sec A(1,
Type: Expression(Integer)
fricas Time: 0 sec eigen:=eigenvalues(A) Unfortunately, currently eigenvalues does not work for general expressions, which causes the failure above. fricas A:=matrix[[cos(x)-L,
Type: Matrix(Expression(Integer))
fricas Time: 0 sec A(1,
Type: Expression(Integer)
fricas Time: 0 sec A(2,
Type: Expression(Integer)
fricas Time: 0 sec A(1,
Type: Expression(Integer)
fricas Time: 0 sec B := solve(A(1,
Type: List(Equation(Expression(Integer)))
fricas Time: 0.01 (IN) + 0.01 (EV) + 0.01 (OT) = 0.03 sec B(1)
Type: Equation(Expression(Integer))
fricas Time: 0 sec fricas solve(x^2 - 2,
Type: List(Equation(Fraction(Polynomial(Integer))))
fricas Time: 0.01 (EV) = 0.01 sec sqrt(2)
Type: AlgebraicNumber?
fricas Time: 0 sec solve(x^2=4,
Type: List(Equation(Fraction(Polynomial(Integer))))
fricas Time: 0.01 (IN) = 0.01 sec fricas P:=matrix[[a,
Type: Matrix(Polynomial(Float))
fricas Time: 0 sec eigenvectors(P) |