This is a test of Sage
in MathAction.
Sage stands for:
Software for Algebra and Geometry Experimentation
Sage has native computer algebra capabilities as well as
interfaces to other systems such as
GAP ,
PARI ,
Singular
and Maxima.
Sage was recently extended (version 1.4.1.2) to include support
for Axiom.
Here is a summary of features
This is how to enter Sage commands:
Commands can be used inline, for example: $1+2=\sage{1+2}$ and $\sqrt{1+2}=\sage{sqrt(1+2)}$.
Or we can evaluate a block of Sage commands:
\begin{sageblock}
# do some stuff
E = EllipticCurve("37a")
# more stuff
\end{sageblock}
Now the elliptic curve $E$ given by $\sage{E}$
has discriminant $\sage{E.discriminant()}$.
To get this:
Commands can be used inline, for example: $1+2=\sage{1+2}$ and $\sqrt{1+2}=\sage{sqrt(1+2)}$.
Or we can evaluate a block of Sage commands:
\begin{sageblock}
# do some stuff
E = EllipticCurve?("36a")
# more stuff
\end{sageblock}
Now the elliptic curve $E$ given by $\sage{E}$
has discriminant $\sage{E.discriminant()}$.
Maxima commands in Sage look like this:
\begin{sageblock}
f = maxima(sin(x)^2*cos(x)*exp(x)+a*y)
g = f.integrate("x")
\end{sageblock}
The \sage commands can occur in other LaTeX contexts such
as:
\begin{equation}
\int \sage{f} dx = \sage{g}.
\end{equation}
This produces:
\begin{equation}
\label{eq1}
\int \sage{f} dx = \sage{g}.
\end{equation}
---------
Axiom commands in Sage look like this:
\begin{sageblock}
fAxiom = axiom(sin(x)^2*cos(x)*x)
gAxiom = fAxiom.integrate("x")
\end{sageblock}
The \sage commands can occur in other LaTeX contexts such
as:
\begin{equation}
{\int \sage{fAxiom} dx} = {\sage{gAxiom}}.
\end{equation}
This produces:
\begin{equation}
\label{eq2}
{\int \sage{fAxiom} dx} = {\sage{gAxiom}}.
\end{equation}
Using Axiom to guess integer sequences:
\begin{sageblock}
f = axiom('(guess [2,4,6]?).1.function')
\end{sageblock}
Gives:
$$
\sage{f}
$$
---------
Sage also works in pamphlet files. See SandBoxSagePamphlet
Some or all expressions may not have rendered properly,
because Latex returned the following error:
sage: unset PYTHONPATH; PATH=/usr/local/bin:$PATH HOME=/var/lib/zope sage 1433308504340526167-18.0px.sage
Traceback (most recent call last):
File "1433308504340526167-18.0px.py", line 24, in <module>
fAxiom = axiom(sin(x)^2*cos(x)*x)
File "/home/server2/sage/local/lib/python2.5/site-packages/sage/interfaces/expect.py", line 963, in __call__
return cls(self, x, name=name)
File "/home/server2/sage/local/lib/python2.5/site-packages/sage/interfaces/expect.py", line 1281, in __init__
raise TypeError, x
TypeError: Unable to start axiom
Timeout exceeded in read_nonblocking().
<pexpect.spawn instance at 0x2ade2b7d8320>
version: 2.0 ($Revision: 1.151 $)
command: /home/server2/sage/local/bin/axiom
args: [/home/server2/sage/local/bin/axiom, -nox, '-noclef']
patterns:
\([0-9]+\) ->
buffer (last 100 chars):
before (last 100 chars): ad.so"
foreign routines found
*** - invalid byte #xC3 in CHARSET:ASCII conversion
Break 1 [1]>
after: <class pexpect.TIMEOUT>
match: None
match_index: None
exitstatus: None
flag_eof: 0
pid: 19875
child_fd: 7
timeout: 30
delimiter: <class pexpect.EOF>
logfile: None
maxread: 10
searchwindowsize: None
delaybeforesend: 0