Rubin H. Landau
rubin@physics.orst.edu
http://www.physics.orst.edu/~rubin
kowallik@sdsc.edu
Manuel J. Paez
Applying computer technology is simply finding
the right wrench to pound in the correct screw. -Anonymous
We have developed the course and written the text over a seven year period with external support from the U.S. Department of Energy, the U.S. National Science Foundation, and IBM corporation. The Web materials were developed in the last three years with travel support from the Undergraduate Computational Engineering and Science project (UCES)[2], and with research support from the Northwest Alliance for Computational Science (NACSE)[3]. This last organization is an NSF Metacenter Regional Alliance which promotes Web technology to improve the use of high performance computing (HPC) resources in science and engineering.
While some of the Web materials we have developed are directly related to the course, others are also useful for a general audience. The latter include Techniques for Visualizations, HPC Library Use, PVM, and Coping with Unix (both a book [4] and Web tutorials[5]). Accordingly, the Web materials can be used in the traditional university and high school settings, or in a scientist's and engineer's workplace.
This coherent package of educational materials is not what we planned on writing when, about a decade ago, we started the discussions that led to our Computational Physics course. We though that the Computer Science Department would teach the students what they needed to know about computers, the Mathematics Department would teach them what they needed to know about numerical methods and statistics, and we would teach what they needed to know about applying that knowledge to solve physics problems using computers. That's how we thought it would be. But, by and large we have found that the students taking the Computational Physics course do not carry the subject matter from these other disciplines with them. And so a lot of the materials we have developed would, in a more perfect world, be taught and written by experts in these other fields.
While that is not the materials we originally planned to develop, we believe it's probably for the better. On the one hand, having physicists who conduct research with computers tell students they need to know "this" in computer science and "that" in mathematics gets the message across that "this stuff really matters". On the other hand, it is useful to have the physics, mathematics, and computer science concepts conveyed in the language and from the perspective of a natural scientist working within the context of solving a problem scientifically.
As a case in point, we have tried to make computational science education become alive for students by having the clever -but transparent- use of computers stimulate their innate intellectual interest in understanding and finding beauty in the world in which they live. The viewpoint we try to impart is that the computer is an excellent tool for amplifying our cognitive and reasoning abilities. There is nothing like having your science, be it some mathematical equations and lines of code, or some abstract connection among ideas, come alive right before your own eyes, and come alive looking like the real world. After that type of "close encounter" with science, students often go back to learn more of the underlying science and to find more powerful tools in order to understand better what is happening. Not surprisingly, we find that teaching gets to be much easier once students are motivated, are interacting with the materials, and are doing it all without too much pain.
This paradigm distinguishes the different steps in scientific problem solving, encourages the use of the best (or just the available) tools, and emphasizes the value of continual assessment (the double-headed arrows). It also makes it clear that computational science is an interdisciplinary field founded on the scientific process.
The specific objectives of the course are:I hear and I wonder,
I see and I follow,
I do and I understand. -as recalled from a fortune cookie
When we first started teaching this course, which typically contains 10-20 students, we envisioned that the students would read the assigned materials beforehand and then work through the projects in the computer lab with the help of the professor and teaching assistant. Possibly as a consequence of the newness of much of the material, or of the breadth of the subjects covered, there has been a uniform desire on the part of the students to have a traditional lecture before working on a project. The lecture seems important to give a broad picture of the material and to make it clear what is expected of the students in their projects. It is interesting that our experience does not support the vision of some higher-education mangement gurus who envision classes with professors in back row seats when the Web is used in education.[6]
The reader will notice from browsing through these topics that there is an emphasis on looking at subjects which may not be covered in the standard physics curriculum (aside from the computer science and mathematics). They includes anharmonic oscillations, chaotic dynamics, integral equations of quantum mechanics, and solitons; all subjects which are best studied with the computer.
The first quarter of the course concentrates on the basic mathematical, numerical, and conceptual elements needed for using computers as virtual scientific laboratories. We start off slowly, in part because this is the first experience some students have with Unix. We next study the basics of computing: algorithms, precision, efficiency, and verification, and then move on to some numerical analysis and associated approximation and round-off errors.
Learning Unix is less of a problem than it used to be, both for students in this course and for all students using the Physics Department workstation cluster. This is because our NACSE[3] group (and especially Melanie Johnson) has taken a conventionally-published Guide for Scientists and Engineers written by Landau and Fink,[4] and used it as a base for a series of Interactive Unix Tutorials.[5] The Unix tutorials use some Java-based Web technology (Webterm) we developed which makes it possible for a browser to connect to a remote Unix machine and execute Unix command - even browsers on non-Unix computers such as PCs or Macs. Many students take the tutorials on their own either before or during the course.
The second quarter of the course focuses on realistic physical problems which apply and extend the preceding techniques. (There are more projects than can covered in two quarters, so some customizations to students' interests is are usually made.) An important aspect of the course is the use of advanced scientific library subroutines, multiple-subroutine programs, and the use of supercomputers or parallel workstation clusters. This is usually covered in the second quarter by which point the students have some experience with numerically intensive computing, and is often the only place students experience these common aspects of computational science.
There is a price to pay for the unusually broad approach we see with all these topics: the students must work hard and cannot master material in great depth. The workload is lightened somewhat by providing "bare bones" programs, and the level is deepened somewhat by having references and Web tutorials readily available. By eliminating the time-consuming theoretical backgrounds more properly taught in other places, and by not sustaining a continual attack on errors, the students have the time to get many of these challenging projects "to work". In the process, the students enjoy the excitement of physics and gain pride, independence and self-confidence; this makes for a fun course for everyone.
Following the Web links given in the table of contents (the scenic route which we highly recommend) leads to running codes, figures, animations, sonifications, corrected code listings, and control-panel interfaces. While these tutorials are not meant to be substitutes for studying the text or for running one's own codes, they do provide prototypes of what can de done and of how scientific materials can be viewed in new and exciting ways (such as seeing phase space plots drawn as a pendulum swings, or hearing the noise made by a chaotic oscillator).
In Fig. 2 we see seven simulations of a 2D random walk of 1000 steps starting at the origin. These have been taken from a student's report [7] on Monte-Carlo techniques. The data were produced by the program walk.c (http://www.physics.orst.edu/~rubin/CPbook/PROGS/C_PROGS/walk.c).
Having the student generate random numbers and then random walks with these numbers inevitably leads to "strange " graphs like these. Although random processes are discussed in many undergraduate science and engineering courses, it is surprising to learn how few students have ever seen one! They often ask if their results are correct - as if being a physics professor gives one the divine power to see molecules collide. They are told that if their computer simulation yields a prediction which agrees with experiment, then it is likely to have some truth in it. In some sense, then, they are seeing a random walk.
By uncovering correlations in pseudorandom numbers, the students have
already seen that random number generators are not truly random and so know
to suspect Monte-Carlo simulations. In Fig. 3 we give results from a
student's project which checks the validity of the model of a random walk
by plotting the distance covered after N steps versus , where
is the square root of the average squared step size.
We see that although the theory of random processes predicts that for large N,
this holds only on the average after many trials, and even then only if particular care is used in generating the random walk (the different curves in Fig. 3).
In Fig. 4 we present the results of a Monte-Carlo simulation
of radioactive decay. The simulation is based on
the basic, phenomenological fact that for
particles at time t, the number of these particles decaying in some
small time interval
is proportional to both N(t), the number of particles present at
time t, and the length of the time interval:
where lambda is the decay constant. This leads to the basic algorithm which decides if a nucleus decays:
The results in Fig. 4 are of a simulation of this equation. Notice that the Nmax=1000 curve starts smoothly but becomes more stochastic as the number of atoms decreases. In contrast, the Nmax=10 curve is always stochastic. These simulations show the student that the decay rate (the slope of the curves) is independent of the number of initial nuclei (the curves are scaled to begin at the same point). Of even more interest, the student sees that for large numbers of nuclei, the decay can be approximated well by an exponential (a straight line on a semilog plot), but that for small N, the process is always stochastic, as it is in nature.
These simulations shatter the students' prejudice that the analytic
result (exponential decay) is a more accurate description of nature than
the computed result. Here, the simulation holds for all values of
N, while exponential decay becomes a poorer and poorer approximation
to nature as N decreases (which, in nature, always happens
eventually).
The actual Web Geiger counter is a CGI-bin script on our server which has an interface of the form:
The theory here is the angular form of Newton's laws of motion including an external periodic driving torque, viscous damping, and a nonlinear restoring force proportional to the sine of the angle of displacement. This leads to an ordinary differential equation,
In Fig. 5 we show an animation of the solution to this equation. On the left is a cartoon of a moving pendulum, and on the right is a plot of the angular displacement theta versus time. When animated, the plotting is done in synchronization with the pendulum's motion (remember to push "Reload" to animate).
In Fig. 6 we show on the left a cartoon of the moving pendulum, and on the right a plot of the motion of the pendulum in phase space (angular velocity versus angular position). When animated, the plotting is done in sychronization with the pendulum's motion.
These animations (and the JAVA applets we show next) indicate how multimedia can help students learn some difficult and abstract concepts. On the one hand, the picture of a pendulum actually swinging is a concrete example of a chaotic motion's combination of oscillations with multiple frequencies and "over the top" rotations. Seeing this motion occur simultaneously as the displacement versus time graph is being drawn breathes life into what, otherwise, appeared like an unusal geometric figure. Seeing the phase space plot being drawn along with the other plots and the swinging pendulum itself, adds meaning at different levels of understanding to the abstract concept that classical dynamics is just geometry in phase space. While students can learn these concepts from studying the plots in books, this is more engaging and revealing.
JAVA is a general programming language particularly well suited for creating animated and interactive Web objects (it is object oriented and its objects can be graphical). In fact, in addition to creating the animated and interactive graphics, our JAVA programs actually solve the equations of motion numerically, albeit slower than with Fortran or C. Of particular noteworthiness is that the JAVA programs sent over the Web ("applets") actually do the numerical computation and the graphical animations on the local computer running the (JAVA-enabled) Web browser. Not only does this take some load off the State of Oregon, but it permits much faster and smoother results than trying to transmit the data and the images over the Web. It also lets the user adjust the parameters in the program and run it again locally. Since this is so fast and painless, it is a valuable type of interaction which hastens the learning process.
Our most recent JAVA applets permit extensive control of the programs, very fast animations of a variety of tabulated and dial-your-own chaotic behaviors, and some research-level studies of levels of complicated behavior. A snapshot of one of these applets is shown in Fig. 7. The buttons are used to start, stop, and clear the animation (helpful before rerunning). Some sample configurations are listed and can be chosen with mouse clicks (since chaotic systems can be a hypersensitive to the precise values of parameters, it is good to have some sample cases).
In Fig. 7 you can see a comparison being made of two chaotic pendula with slightly differing initial conditions. If you activate the applet you will find that both pendula appear identical for quite a few cycles, but when the separatrix is reached, as predicted in the Robert Frost poem, the pendula then follow very different paths in phase space and oh the difference it makes.
At http://nacphy.physics.orst.edu/HSPhysics/nonlinear/ is a Web tutorial we originally developed for a high school physics class, but which also works well at the university level. The physics problem is the simple one from statics, shown in Fig. 8. Two weights hang from three strings of known lengths, and you are asked to determine the angles of and tensions in the strings (for graduate work we like to increase the number of weights).
This is a great problem for computational science. It is easy to write down the relatively simple equations to be solved, and even though there is no analytic solution, there is an easy numerical one ("easy" if one uses a scientific subroutine library). This shows the student how even simple problems may require a computer for solution. In addition, since the computer uses a Newton-Raphson method to search for the solution, the student can take an active part in the process by experimenting with different initial guesses and actually seing the computer fail at a numerical task. This shows the student that while the computer may be needed to solve the problem, there is still a critical need for human insight and intuition.
To avoid the delicate "bookkeeping" needed in using a scientific subroutine library, the high school students submit their problem to the computer via a form of the form: