Report on Python and Free Software (for scientific computing) workshop at C.K.G.M College

Published on: 2009-9-19

Home | Archive

Report on Python and Free Software (for scientific computing) workshop at C.K.G.M College

2009-09-19T04:35:00

I was at CKGM College (Perambra, Calicut) yesterday to conduct a workshop for college Math lecturers. My class was on day 2 (day 1 was basic introduction to GNU/Linux + document preparation using LaTeX). A little bit about the teachers attending the seminar - many of them were senior lecturers with extensive experience in teaching math but with very little exposure to computers or programming. I had this idea that a "pure-functional" approach (no loops, no `i=i+1' stuff) which utilized the power of numeric arrays to deal with a sequence of numbers as a single entity would be the path of least resistance - from the feedback obtained during the class, I think this is indeed true. Here is a simple demonstration of the approach - say you wish to integrate the function y = x^2 between limits 2 and 3 - you can do it by dividing the region under the curve between the limits into lots of small rectangles and summing up the areas.

from numpy import *
x = arange(2, 3, 0.001)
h = x ** 2
a = h * 0.001
print sum(a)
For those who are not familiar with NumPy: the `arange' function generates a sequence of numbers from 2 to 2.999 in steps of 0.001 and returns it as a numeric array. A numeric array, unlike the tradition Python list, has the property that any math operation you apply on it gets applied on ALL the elements of the sequence. Compare the code fragment above with what you would have written using an explicit loop - the single-assignment-and-function-application-only code beats an imperative program for readability and clarity by a wide margin. One of the reasons (especially for beginners) might be the fact that a functional program mimics the structure of natural language prose more closely than an imperative one. Day 2 of the workshop had two more sessions - one by Binoy of LBS College who provided a traditional programmer-oriented introduction to Python and another by Kishore of NIT Calicut. Kishore provided an introduction to three interesting Free Software tools for mathematics - gnuplot, maxima and kig. Calicut university is going to implement the Python/Free Software based syllabus as part of the BSc Maths curriculum from November onwards.

Hari K T

Sat Sep 26 20:01:30 2009

Oh sir, Happy to see your site . Was not aware about your site . Hope you enjoyed workshop .


Jain Basil Aliyas

Sat Sep 19 14:56:06 2009

I'm really excited to see numpy and numeric arrays, thanks a lot!