> > For a start, you could try looking at the files mathematica.py and magma.py
> > (etc.) in SAGE_ROOT/devel/sage/sage/
> > interfaces/.  If you have a bunch of Mathematica code and want to convert it
> > to Sage, it looks like you could try commands like
>
> >             sage: m = mathematica('Sin[Sqrt[1-x^2]] * (1 - Cos[1/x])^2')  # 
> > optional - mathematica
> >             sage: m.sage()                          # optional - mathematica
> >             (cos(1/x) - 1)^2*sin(sqrt(-x^2 + 1))
>
> Is it possible to run the above commands if I don't have mathematica?

You can run them, but you'd get the following.

sage: m = mathematica('Sin[Sqrt[1-x^2]] * (1 - Cos[1/x])^2')
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call
last)

TypeError: Unable to start mathematica because the command 'math'
failed.

In order to use the Mathematica interface you need to have Mathematica
installed and have a script in your PATH called "math" that runs the
command-line version of Mathematica. Alternatively, you could use a
remote connection to a server running Mathematica -- for hints, type
    print mathematica._install_hints_ssh()


  (1) You might have to buy Mathematica (http://www.wolfram.com/).

  (2) * LINUX: The math script comes standard with your Mathematica
install.

      * APPLE OS X:
          (a) create a file called math (in your PATH):
              #!/bin/sh
              /Applications/Mathematica\ 5.2.app/Contents/MacOS/
MathKernel $@

          Note that the 5.2 part will depend on the version of
          Mathematica you have, and the above path could be different
          if you installed mathematica elsewhere.

          (b) Make the file executable.
                chmod +x math

      * WINDOWS:

        Install Mathematica for Linux into the VMware virtual machine
(sorry,
        that's the only way at present).



However, if you have remote access to a machine with Mathematica
installed, you could do as above by installing Sage on it.

Could Rajeev even set the 'math' script on his home computer in such a
way that it called a remote installation of Mma?  (Which probably
violates the user license, but just to know...)

-- 
To post to this group, send an email to [email protected]
To unsubscribe from this group, send an email to 
[email protected]
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to