Subject: CCL:Scientific Computing Service Course(s) -- appropriate content ?

From: Alan Aspuru Guzik <[email-masked]>
Date: Mon, 23 Nov 1998 10:33:52 -0600 (CST)

On Thu, 19 Nov 1998, Pisanty Baruch Alejandro-FQ wrote:

|software applications to solve problems arising in their laboratories.  While
|some programming experience may be necessary to solve small problems
|or apply patches to programs where source code is available, this will
|probably
|be a small part of the tasks that they will have to do with computers. 

It dependes on whether they will use commercial operating systems such as
Windows NT or if they are using free alternatives such as FreeBSD or
Linux. Learning the basics of WHAT a programming language is makes them
free to make a contribution to the global free software depot. (See
http://SAL.Kachinatech.com for all the Scientific Applications / demo
programs written under free licenses).

|
|It would seem to me that they will spend more of their time installing,
|maintaining,
|and configuring operating systems and self-contained application packages.

It depends if those application packages are 4000 USD or 5000 USD. We in
the developing countries cannot afford buying that stuff from outside. I
think that in the long term, developing our own programs with our own
resources will be more formative, and indeed cheapear and fruitful.

|They will be interfacing computers to experimental equipment and installing
|software that will run the instrument, collect the data, and reduce it.
|They will be using software tools like Excel, SPSS, SAS, Origin, etc. to
|analyze

I agree with you in this aspect. Carlos Amador and I are experimenting in
using Computer Science as an aid in our Kinematics and Dynamics course
given here at UNAM. In the FIRST WEEK of the FIRST SEMESTER of class, we
taught them how to numerically integrate and derivate using a spreadsheet.
That gave them the insight of what VELOCITY and ACCELERATION are as
derivatives of the position of a moving object.

|data.  Programming will probably be done using MathCAD, MATLAB or
|Mathematica rather
|than C or FORTRAN because of the built-in graphical interfaces for the display
|of computed results.  

We chose to use an intermediate thing. There are programming languages
that are not as intricate as C or C++ (the first, with
difficult-to-teach-program and debug pointers, the second with the first
inconvenience and a badly designed and difficult object oriented stuff),
or Fortran.

We thought first on using Java, but afterwards found that Python
(http://www.python.org) is a VERY GOOD alternative, having numerical,
computational chemistry, graphics visualization (we are specifically using
VTK, http://www.kitware.com/vtk/), scientific (Vector, Tensor, etc) and is
a language that we taught them in ONE saturday and some support sessions
afterwards.

|The problem space that those who teach service course(s) in computing
|will have to be wider than the usual numerical analysis problems posed
|for engineering students, physics and chemistry majors.  There needs to
|be attention to combinatorics, probability, and statistics.  This is an

I agree with you, some insight using simple Monte Carlo programs like
calculating Pi by Monte Carlo, which as you see is fairly straightforward
in Python:

---------
>from math import *
from string import *
>from whrandom import *

archivo=open('circulo.dat','r')
linea = archivo.readline()
linea = archivo.readline()

r = atof(linea)
print('QMCirculo 98') 
print('Radio a usar: ' + str(r))

linea = archivo.readline()
linea = archivo.readline()

n = atoi(linea)
print('Numero de iteraciones: ' + str(n))

linea = archivo.readline()
linea = archivo.readline()

delta = atof(linea)
print('El intervalo de confianza porcentual es: ' + str(100.0* (1 - delta)) + "%")

# como inicializo las listas?
punto = [0,0]

n_circulo = 0
n_afuera = 0

a_circulo = 0

for i in range(n):
    punto[0] = random()
    punto[1] = random()

    if (sqrt(pow(punto[0],2)+pow(punto[1],2)) < r) :

	n_circulo = n_circulo + 1
    # n_afuera = n - n_circulo

# summary statistics
a_circulo = (1.0 * n_circulo) / n
print 'El area de la seccion es: ' + str(a_circulo)
pi = (4.0 * a_circulo) 
print 'Pi es: ' + str(pi)    

#estimando la varianza
varianza = (1.0 *n_circulo / n)*(1.0 - (1.0*n_circulo /n))/(n -1.0)
print "La varianza es " + str(varianza)

----
with a data file like this one:
------

Radio del circulo
1.0
Numero de vueltas
10000
El delta
0.001
----
(The delta parameter was not used, I planned to use it for confidence
interval evaluation, but I did not finish that part of the code)

Anyways, circulo.py was coded in 20 minutes... I think this kind of things
and cellular automata games can be very good for simulating economics /
population biology, etc...

|important aspect in the course offered here since the majority of the
|students are from cell and molecular biology, environmental science, and
|geology.  [The chemistry and physics students here take a pretty
|traditional course in FORTRAN.  Whether this is the best choice for all,
|I have my doubts.] The course in question is a freshman level course.  
|Students are concurrently struggling with calculus at best.

I'd have a second course in which Mathematica, Maple, Python and C are
used as languages. I support the idea of not marrying to just one option.

|I would welcome comments, critique, and suggestions on my comments from
|list members.  This list has subscribers from a number of disciplines
|whose insights I would appreciate.  I will summarize for the list.

Well, this was only 0.02 c. I wait your reply,

Alan Aspuru Guzik
Student and TA,
Theoretical Chemistry and Physics Department,
Chemistry School, 
Universidad Nacional Autonoma de Mexico