next up previous
Next: Assessment and Requirements Up: A Computational Physics Course Previous: Topics

Examples

To get a feel for how the science and computation support strengthen each other, we look at some examples. In Figure gif we see some actual 2D random walk simulations from the Monte Carlo project. By uncovering correlations in pseudorandom number, the students have already seen that the random number generators are not truly random and so know that Monte Carlo simulations may be suspect. Although random processes are discussed in many undergraduate science and engineering courses, here the students themselves generate a random walk and for the first time actually ``see'' what one looks like. They often ask me if their results are correct--as if I have seen molecules collide. Given that opening, I tell them that if their computer simulation makes predictions which agree with experiment, then it is likely that their is some truth in the simulation. The simulation is successful if it lets students ``see'' a process which previously could only be imagined or read about in a book, gives them a deeper insight into how scientific modeling works, or gives them a new view of reality. The simulation is truly successful when these insights cause the student to experience the addicting excitement of computational science.

To check the validity of models of random processes, in Figure gif we give a student's result for the distance covered after N random steps versus tex2html_wrap_inline137 . We see that although the theory of random processes predicts tex2html_wrap_inline139 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.

In Figure gif we present the results of a Monte-Carlo simulation of radioactive decay. The simulation is based on the empirical observation that the probability of there being a spontaneous decay of an excited atom is proportional to the number of atoms present N and the time period tex2html_wrap_inline145 of the observation. If we assume the number of decays tex2html_wrap_inline147 is proportional to the probability of decay (in a statistical sense), then

  equation68

This leads to the basic algorithm

  equation71

The results In Figure gif of the simulation of this equation show the student that if a meaningful decay rate (i.e. slope of the curve) can be defined, then it is independent of the initial number of nuclei decaying. Yet of even more interest, the student sees that for large numbers of atoms the decay can be approximated well by an exponential (a straight line on this semilog plot), but that for small N the process is stochastic in nature. Furthermore, this graph shatters the student's prejudice that the analytic result (exponential decay) is ``exact'' while the numerical result is an approximation; here the numerical simulation holds for all values of N while exponential decay clearly becomes a poorer and poorer approximation as N decreases (which of course is what happens in nature).

Although we cannot present it here, the student's belief in the model and understanding of nature is further strengthen by the sonification work of Hans Kowallik[5]. He has created a virtual Geiger-counter web tutorial which converts the decay rate into a series of 1's and 0's, opens up a sound player, and then plays the decay simulation. It's rather satisfying to hear your simulation actually sounding like a Geiger counter and to know that it all follows from an idea as simple as Equation (gif).

My final example deals with the numerical solution of the ordinary differential equation resulting from applying Newton's second law of motion to a particle bound by a potential which always attracts particles to the origin,

  equation79

For n=2 this is the familiar harmonic oscillator whose solutions most physics students study over and over again, and which provides a good test case for the numerical method. As n increases, the potential looks more and more like a square well and x(t) looks more and more like a sawtooth function. This is a good mix of physics and computing since it shows the student that 11-place accuracy is attainable for 1000's of periods, and that for tex2html_wrap_inline161 the time dependence of the potential and kinetic energies are very different (which we hasten to point out is a consequence of the virial theorem). Finally in Figure gif we see the results of a number of computations in which the period of the oscillation is plotted as a function of both the amplitude of the oscillation and the power n in (gif). We see that for n=2 there is no amplitude dependence to the period (which is expected theoretically and which means the algorithm is working), but that for larger values of n the period decreases as the amplitude is made larger. This is an exciting result, in part because it is not obvious, in part because it is for a system not accessible to analytic solution, in part because it is so easy to obtain numerically, and in large part because it shows how easy it is to understand systems which were too hard for previous generations to study.


next up previous
Next: Assessment and Requirements Up: A Computational Physics Course Previous: Topics

Rubin Landau
Wed Mar 18 09:44:22 PST 1998