Wednesday, June 27, 2007

Briefly reporting in

Tomorrow morning, I'm making an important (semi-final) code delivery to my (non-GSoC) client. I've been focusing on this for the last few days. After this, SymPy will be my only major project. Expect an update sometime next week.

Book club (Gail and Martin): sorry for the lapse, I will get back into this soon. Thanks for your loyal and unwaivering support ;-)

Tuesday, June 19, 2007

SymPy 0.4.1 released, with windows installer

This is the first release to include SymPy Plot.

0.4.1 source tarball
0.4.1 windows installer
SymPy homepage
Changelog

PyOpenGL is required for SymPy plotting support. While *nix users should have no problem (apt-get install python-opengl), Windows users will find it difficult, if not impossible, to use PyOpenGL with Python 2.5. I recommend setting up your Python environment as follows:
  1. Install Python 2.4.4 to C:\Python24 (the default location)
    I normally like to install all of my programs in C:\Program Files, but unfortunately PyOpenGL depends on the default install path.
  2. Install Numeric-23.7.win32-py2.4.exe
  3. Install numarray-1.1.1.win32-py2.4.exe
  4. Install PyOpenGL-2.0.2.01.py2.4-numpy23.exe
  5. Install sympy-0.4.1.win32.exe
  6. >>> from sympy import Symbol
    >>> from sympy.modules.graphing import Plot
    >>> x = Symbol('x')
    >>> Plot(x**2, [x, -1, 1, 10])


If you get a dll not found error relating to GLUT, obtain glut32.dll and put it in C:\Python24\Lib\site-packages\OpenGL.

Thursday, June 14, 2007

SymPy Plot: Now available in SVN



To try it out, check out or update from SVN and look at examples\plotting.py. You'll need to download and setup PyOpenGL for your platform: on ubuntu, apt-get install python-opengl; on windows, you might have luck with the instructions here. So far, I've only tried it on Windows with Python 2.4.



Enjoy, and let me know how it goes!

Wednesday, June 13, 2007

SymPy Plot: First screenshots


>>> f1 = 0.1+x**2+y**2
>>> f2 = -0.1-x**2-y**2
>>> Plot( f1, f2, [x, -0.75, 0.75, 8], [y, -0.75, 0.75, 8] )




>>> Plot( x*y**3-y*x**3, [x, -1, 1, 20], [y, -1, 1, 20] )

Tuesday, June 12, 2007

Book club, time to regroup?

To the GEB Book Club:

The weekly GEB posts are quickly becoming really hard for me to keep up with. I've also noticed that discussion has tapered off significantly. I don't want to give it up just yet, but I do want to regauge the interest level. If you are participating, or have a suggestion, I'd really like to hear from you. Thanks!

Brian

Thursday, June 7, 2007

Vision for an extensible visualization tool

In addition to providing standard 2d and 3d function graphing capabilities, the SymPy graphing module will be able to render 2d and 3d geometric entities on the plot, such as lines, vectors, and triangles. While the rendering system will be completely hidden from the casual user who simply wants to plot a few curves or surfaces, advanced users will be able to extend or create new kinds of renderable objects.

A new submodule called sympy.modules.graphing.scene makes this possible by providing a high-level rendering abstraction on top of OpenGL through the Scene class. A Scene handles the boilerplate OpenGL setup and teardown code. It also maintains a list of objects to be rendered, which are represented by objects which implement the Renderable interface. Renderable is a base class providing the render() function, which retrieves the object's primitive representation for rendering. This representation is something that OpenGL can render directly, such as a line list or a tri strip.

For example, consider the Renderable called CartesianCurve, which represents a plane curve in the form y = f(x); when CartesianCurve's render() function is called by a Scene which contains it, it returns a representative list of coordinate pairs, which are then used to render an OpenGL line list. The various other types of plots will be implemented as subclasses of Renderable in the same way. Here are some examples of possible constructor syntax for function plot Renderables:

# y = f(x)
CartesianCurve( x**3, [x, -10, 10, 20] )

# x = f(t), y = f(t)
ParametricCurve( cos(t), sin(t), [t, 0, 2*pi, 32] )

# r = f(theta)
PolarCurve( t, [t, 0, 2*pi, 32] )

# z = f(x, y)
CartesianSurface( x**2+y**2, [x, -1, 1, 5], [y, -1, 1, 5] )

# radius = f(z, theta)
CylindricalShell( 1.0, [z, 0, 1, 2], [t, 0, 2*pi, 32] )
CylindricalShell( t*sqrt(z), [z, 0, 1, 2] )

# radius = f(theta, rho)
SphericalShell( 1.0, [t], [p] )

Tuesday, June 5, 2007

Grub Error 17?!

My desktop has died. Looks like hard drive failure (long delays on hdd detection, then grub error 17, can't mount partition). I'm pretty used to this, seems to happen to me biannually. The Ubuntu live CD won't even come up, so my chances for data recovery seem pretty slim. The worst thing is that I just downloaded but have not yet watched two iTunes purchases (yesterday's Daily Show and Colbert). I also stand to lose quite a bit of work for my contracts as well as GSoC. Time to get out the screwdriver...