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:
axiom
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):
axiom
)set messages time on
Try this::
axiom
eigen:=eigenvalues(sm)
Type: List Union(Fraction Polynomial Integer,SuchThat
?(Symbol,Polynomial Integer))
axiom
Time: 0.55 (EV) + 0.15 (OT) + 0.30 (GC) = 1.00 sec
solve(rhs(eigen.1),15)
Type: List Equation Polynomial Fraction Integer
axiom
Time: 0.02 (IN) + 0.48 (EV) + 0.02 (OT) + 0.35 (GC) = 0.87 sec
Thank you! This helps, but doesn't answer everything. Since interestingly:
axiom
charpol := reduce(*, [ rhs(x) - lhs(x) for x in % ])
Type: Polynomial Fraction Integer
we cannot recover the characteristic polynomial from this solution: Even if a large number is passed to solve, accuracy does not increase.
Why would you expect to be able to recover the characteristic polynomial? There is always round off error for finite precision arithmetic. For integer approximations, it would be worse.
The command solve: (Polynomial Fraction Integer, PositiveInteger)->List Equation Polynomial Integer
solves the equation over the integers, so it is {\it not} accurate. For example:
Type: List Equation Polynomial Fraction Integer
axiom
Time: 0.02 (IN) + 0.01 (EV) + 0.01 (OT) = 0.04 sec
ev:= solve(rhs(eigen.1),1.0*10^(-50))
Type: List Equation Polynomial Float
axiom
Time: 0.01 (IN) + 0.49 (EV) + 0.07 (OT) + 0.28 (GC) = 0.85 sec
cp:= reduce(*, [rhs(x)-lhs(x) for x in ev])
Type: Polynomial Float
axiom
A:=[[cos(x),-sin(x)],[sin(x),cos(x)]]
Type: List List Expression Integer
axiom
Time: 0.02 (IN) + 0.02 (EV) + 0.08 (OT) = 0.12 sec
Type: List List Symbol
axiom
Time: 0.01 (OT) = 0.01 sec
axiom
A:=matrix[[cos(x),-sin(x)],[sin(x),cos(x)]]
Type: Matrix Expression Integer
axiom
Time: 0.01 (EV) = 0.01 sec
axiom
A:=matrix[[cos(x),-sin(x)],[sin(x),cos(x)]]
Type: Matrix Expression Integer
axiom
Time: 0 sec
eigen:=eigenvalues(A)
There are 1 exposed and 0 unexposed library operations named
eigenvalues having 1 argument(s) but none was determined to be
applicable. Use HyperDoc Browse, or issue
)display op eigenvalues
to learn more about the available operations. Perhaps
package-calling the operation or using coercions on the arguments
will allow you to apply the operation.
Cannot find a definition or applicable library operation named
eigenvalues with argument type(s)
Matrix Expression Integer
Perhaps you should use "@" to indicate the required return type,
or "$" to specify which version of the function you need.
axiom
A:=matrix[[cos(x),-sin(x)],[sin(x),cos(x)]]
Type: Matrix Expression Integer
axiom
Time: 0 sec
\end{axiom
Line 2: \end{axiom
....AB
Error A: Missing mate.
Error B: syntax error at top level
Error B: Possibly missing a }
3 error(s) parsing
<div class="commentsheading"><a name="msg20050624075917-0500@page.axiom-developer.org"></a><b>test</b> --unknown, <a href="http://axiom-wiki.newsynthesis.org/NumericalLinearAlgebra#msg20050624075917-0500@page.axiom-developer.org">Fri, 24 Jun 2005 07:59:17 -0500</a> <a href="http://axiom-wiki.newsynthesis.org/NumericalLinearAlgebra?subject=test&in_reply_to=%3C20050624075917-0500%40page.axiom-developer.org%3E#bottom">reply</a></div>\begin{axiom}
There are no library operations named < having 1 argument(s) though
there are 4 exposed operation(s) and 1 unexposed operation(s)
having a different number of arguments. Use HyperDoc Browse, or
issue
)what op <
to learn what operations contain " < " in their names, or issue
)display op <
to learn more about the available operations.
Cannot find a definition or applicable library operation named <
with argument type(s)
Variable b
Perhaps you should use "@" to indicate the required return type,
or "$" to specify which version of the function you need.
A:=matrix[[cos(x),-sin(x)],[sin(x),cos(x)]]
Type: Matrix Expression Integer
axiom
Time: 0.01 (IN) = 0.01 sec
axiom
A:=matrix[[cos(x),-sin(x)],[sin(x),cos(x)]]
Type: Matrix Expression Integer
axiom
Time: 0.01 (OT) = 0.01 sec
A(1,1)
Type: Expression Integer
axiom
A:=matrix[[cos(x)-L,-sin(x)],[sin(x),cos(x)-L]]
Type: Matrix Expression Integer
axiom
Time: 0.01 (IN) = 0.01 sec
A(1,1)*A(2,2)-A(2,1)*A(1,2)
Type: Expression Integer
axiom
A:=matrix[[cos(x)-L,-sin(x)],[sin(x),cos(x)-L]]
Type: Matrix Expression Integer
axiom
Time: 0 sec
A(1,1)*A(2,2)
Type: Expression Integer
axiom
Time: 0 sec
A(2,1)*A(1,2)
Type: Expression Integer
axiom
A:=matrix[[cos(x)-L,-sin(x)],[sin(x),cos(x)-L]]
Type: Matrix Expression Integer
axiom
Time: 0.01 (OT) = 0.01 sec
solve(A(1,1)*A(2,2)-A(2,1)*A(1,2)=0,L)
Type: List Equation Expression Integer
axiom
Time: 0.02 (IN) + 0.10 (EV) + 0.03 (OT) + 0.07 (GC) = 0.22 sec
axiom
A:=matrix[[cos(x)-L,-sin(x)],[sin(x),cos(x)-L]]
Type: Matrix Expression Integer
axiom
Time: 0 sec
solve(A(1,1)*A(2,2)-A(2,1)*A(1,2)=0,L)
Type: List Equation Expression Integer
axiom
Time: 0.01 (IN) = 0.01 sec
L
Type: Variable L
axiom
A:=matrix[[cos(x)-L,-sin(x)],[sin(x),cos(x)-L]]
Type: Matrix Expression Integer
axiom
Time: 0.01 (OT) = 0.01 sec
B=solve(A(1,1)*A(2,2)-A(2,1)*A(1,2)=0,L)
There are 3 exposed and 0 unexposed library operations named
equation having 2 argument(s) but none was determined to be
applicable. Use HyperDoc Browse, or issue
)display op equation
to learn more about the available operations. Perhaps
package-calling the operation or using coercions on the arguments
will allow you to apply the operation.
Cannot find a definition or applicable library operation named
equation with argument type(s)
Variable B
List Equation Expression Integer
Perhaps you should use "@" to indicate the required return type,
or "$" to specify which version of the function you need.
axiom
A:=matrix[[cos(x)-L,-sin(x)],[sin(x),cos(x)-L]]
Type: Matrix Expression Integer
axiom
Time: 0.01 (OT) = 0.01 sec
solve(A(1,1)*A(2,2)-A(2,1)*A(1,2)=0,L)
Type: List Equation Expression Integer
axiom
Time: 0 sec
L(1)
There are no library operations named L
Use HyperDoc Browse or issue
)what op L
to learn if there is any operation containing " L " in its name.
Cannot find a definition or applicable library operation named L
with argument type(s)
PositiveInteger
Perhaps you should use "@" to indicate the required return type,
or "$" to specify which version of the function you need.
axiom
A:=matrix[[cos(x)-L,-sin(x)],[sin(x),cos(x)-L]]
Type: Matrix Expression Integer
axiom
Time: 0 sec
solve(A(1,1)*A(2,2)-A(2,1)*A(1,2)=0,L)
Type: List Equation Expression Integer
axiom
Time: 0.01 (OT) = 0.01 sec
L.1
There are no library operations named L
Use HyperDoc Browse or issue
)what op L
to learn if there is any operation containing " L " in its name.
Cannot find a definition or applicable library operation named L
with argument type(s)
PositiveInteger
Perhaps you should use "@" to indicate the required return type,
or "$" to specify which version of the function you need.
Type: List Equation Fraction Polynomial Integer
axiom
Time: 0.01 (IN) = 0.01 sec
Type: List Equation Fraction Polynomial Integer
axiom
Time: 0.02 (IN) + 0.01 (OT) = 0.03 sec
Type: List Equation Fraction Polynomial Integer
Type: Variable x
axiom
e=vector[1,2]
There are 3 exposed and 0 unexposed library operations named
equation having 2 argument(s) but none was determined to be
applicable. Use HyperDoc Browse, or issue
)display op equation
to learn more about the available operations. Perhaps
package-calling the operation or using coercions on the arguments
will allow you to apply the operation.
Cannot find a definition or applicable library operation named
equation with argument type(s)
Variable e
Vector PositiveInteger
Perhaps you should use "@" to indicate the required return type,
or "$" to specify which version of the function you need.
e=solve(x^2=4,x)
There are 3 exposed and 0 unexposed library operations named
equation having 2 argument(s) but none was determined to be
applicable. Use HyperDoc Browse, or issue
)display op equation
to learn more about the available operations. Perhaps
package-calling the operation or using coercions on the arguments
will allow you to apply the operation.
Cannot find a definition or applicable library operation named
equation with argument type(s)
Variable e
List Equation Fraction Polynomial Integer
Perhaps you should use "@" to indicate the required return type,
or "$" to specify which version of the function you need.
axiom
e=solve(x^2=4,x)
There are 3 exposed and 0 unexposed library operations named
equation having 2 argument(s) but none was determined to be
applicable. Use HyperDoc Browse, or issue
)display op equation
to learn more about the available operations. Perhaps
package-calling the operation or using coercions on the arguments
will allow you to apply the operation.
Cannot find a definition or applicable library operation named
equation with argument type(s)
Variable e
List Equation Fraction Polynomial Integer
Perhaps you should use "@" to indicate the required return type,
or "$" to specify which version of the function you need.
axiom
P:=matrix[[a, b], [1.0 - a, 1.0 - b]]
Type: Matrix Polynomial Float
axiom
Time: 0.01 (IN) = 0.01 sec
eigenvectors(P)
Type: List Record(eigval: Union(Fraction Polynomial Float,SuchThat
?(Symbol,Polynomial Float)),eigmult: NonNegativeInteger
?,eigvec: List Matrix Fraction Polynomial Float)
axiom
Time: 0.01 (EV) + 0.01 (OT) = 0.02 sec