Teaching numerics with Python

Antti Rasila arasila at pcu.helsinki.fi.invalid
Wed Nov 20 10:27:58 EST 2002


We have a special course on scientific computing at the math.
department of the University of Helsinki. In the past the course
has been based on the book and software bundle Numerical Recipes
in C/C++, and our experience is that this software worked very
well for our purposes. Gnuplot is used for graphing purposes.
In 2002, we used the C++ version for the first time and also
offered to the students the option of using the free GNU
Scientific Library GSL instead of the commercial Numerical
Recipes. For our purposes, it is important that the course
material is available to the students with minor or no cost
and also that everything works (without any major extra hacks)
with the most popular computing platforms platforms including at least
GNU/Linux + GCC and MS Windows/Visual Studio.

It seems that the trend in scientific computing is introduction of high
level scripting languages as front end to the more efficient Fortran/C/etc.
subprogram libraries. For some time we have been studying the
possibility of using Python scripting in this purpose.
We think that with this approach we might obtain the following benefits:

1) Writing basic applications could become simpler, like in MATLAB, while
still having flexibility and performance features of classical programming
language like C.

2) Version control and preparation of learning material (such a solutions
to weekly home work assignments, lecture handouts) is an iterative
process where sometimes 5-10 iterations may be needed. To simplify
these tasks, which include several mechanical steps, one would
like to use Makefile and CVS like functionality. An example of
this kind of application of Python scripting is the Portage package
manager system of Gentoo Linux distribution. The functionality
could include automatic installation and compiling of the libraries,
exercises solutions and also keeping track on updates of
various source files.

3) Integration with CGI/Web based environment could become much
easier. We have already implemented this kind on applications, i.e.
Web-runnable CGI demo applications with Python wrapper.

4) Building graphical front ends and interfaces to the applications
with Tkinter would become much easier than in plain C/C++. This becomes
more important in future, when even fewer students are familiar with
using command line interface.

Our experience in this matter is very limited. So, we would like to
ask, if

1) ..someone has experience on this kind of usage of Python numerical
mathematics? We would be happy to hear from your experiences.

2) ..if some course material and ready program files are available,
which we could use as building blocks of our course?

3) ..you have seen a book such as Scientific Computing with Python

Links:

Spring 2002 course homepage:
http://www.math.helsinki.fi/~arasila/nrc02/





More information about the Python-list mailing list