Sage rocks!

When I studied some Calculus at uni, we had to use Maple. Maple is a good software, but it isn’t free and it’s obscenely expensive. By that time I knew a project called Sage; it was difficult to install and use and I trashed the package.

This afternoon, at Jornades de programari lliure, William Stein (associate professor of Mathematics at the University of Washington) made a short course about Sage, a free open source mathematical software. It’s been very pleasant, entertaining, and very interesting. With just a few indications we understood the basis of Sage and made some light algebra, 2D and 3D graphics. Indications are available here.

It’s based on Python, so it uses a syntax simmilar to Python and, what’s more for experienced users, close to Maple, Mathlab and maybe Mathematica.

This software is sort of different: it’s command line, of course, but the GUI is in a web browser, so the steps to test it would be:

  1. Download Sage for your platform
  2. Uncompress it ( tar zxvf sage-*.tar.gz )
  3. Go to its folder and run ./sage

It will display a message offering the Notebook. That’s how we call the GUI, so we just type at the prompt «notebook()» and further instructions, plus probably a browser, will show up. Konqueror may not work properly, though. You need javascript (it’s a good time to test the new Firefox 3.5 with TraceMonkey Javascript Engine) and the Java plug-in.

With Firefox, go to http://localhost:8000/ and create a new worksheet. Can you see an input? Then, write something like « 2 + 2 » and press SHIFT+ENTER. You pressed shift, too? That evaluates the expression. Plain ENTER just adds a carriage return.

Now let’s do something more complex, just to show you what Sage offers you in less than 5 minutes:

P = plot3d(x^2 – y^2, (x,-2,2), (y,-2,2), opacity=0.7,mesh=True)
Q = sphere(figsize=[8,8], aspect_ratio = [1,1,1], size=.1, color=’purple’)
P + Q

That’s going to draw a little sphere in the saddle point of the plane:

Tags:

Leave a Reply


Entra