I want to get (estimates of) the eigenvalues of a 10x10 matrix of floats: fricas (1) -> m := matrix([[random(1000)$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 )set output tex off fricas )set output algebra on fricas Time: 0.04 (OT) = 0.04 sec solve(rhs(eigen.1), Type: List(Equation(Polynomial(Float)))
fricas Time: 0.01 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. To recover characteristic polynomial one needs good precision, which means very small second argument to solve. 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(40) Type: PositiveInteger?
fricas Time: 0 sec ev:= solve(rhs(eigen.1), Type: List(Equation(Polynomial(Float)))
fricas Time: 0 sec cp:= reduce(*, Type: Polynomial(Float)
fricas Time: 0 sec rhs(eigen.1) - cp Type: Polynomial(Float)
fricas Time: 0 sec fricas )set output algebra off fricas )set output tex on For matrices of expressions one has to explicitly specify package: fricas A:=matrix[[cos(x),
Type: Matrix(Expression(Integer))
fricas Time: 0.01 (OT) = 0.01 sec A(1,
Type: Expression(Integer)
fricas Time: 0 sec eigen:=eigenvalues(A)$InnerEigenPackage(EXPR(INT))
Type: List(Union(Expression(Integer),
fricas Time: 0 sec Unfortunatly, result is unsimplified, siplification is separate, for example fricas map(simplify,
Type: SparseUnivariatePolynomial?(Expression(Integer))
fricas Time: 0 sec test --unknown, Fri, 24 Jun 2005 08:05:16 -0500 reply 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 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 sec sqrt(2)
Type: AlgebraicNumber?
fricas Time: 0 sec solve(x^2=4,
Type: List(Equation(Fraction(Polynomial(Integer))))
fricas Time: 0 sec fricas P:=matrix[[a,
Type: Matrix(Polynomial(Float))
fricas Time: 0 sec eigenvectors(P) |