PHYSICS 141
Winter 2004
Lecture 1: Computer Modeling
The Three Components of Computer Simulations
Computer modeling plays a very important role in science today.
In the past, physical sciences were characterized by an interplay
between experiment and theory.
In experiment, a system is subjected to measurements,
and results, expressed in numeric form, are obtained.
In theory, a model of the system is constructed, usually
in the form of a set of mathematical equations.
The model is then validated by its ability to
describe the system behavior in a few selected cases, simple enough
to allow a solution to be computed from the equations.
In many cases, this implies a considerable amount of
simplification in order to eliminate all the complexities
invariably associated with real world problems, and make
the problem solvable.
In the past, theoretical models could be easily tested only in a few
simple ``special circumstances''.
So, for instance, in condensed matter physics a model for intermolecular
forces in a specific material could be verified in a diatomic molecule,
or in a perfect, infinite crystal. Even then, approximations were often
required to carry out the calculation.
Unfortunately, many physical problems of extreme interest (both academic
and practical) fall outside the realm of these ``special circumstances''.
Among them, one could mention astrophysical problems, like star formation,
collisions of galaxies, and the large scale structure of the universe,
the theory of the strong force which confines quarks permanently within
the nucleon, termonuclear fusion, turbulunce,
the physics and chemistry of defects, surfaces,
clusters of atoms, organic molecules, involving a large amount of
degrees of freedom; an accurate treatment of temperature
effects, including anharmonicities and phase transitions; disordered
systems in general, where symmetry is of no help to simplify the
treatment; and this list could be continued almost indefinitely.
Each computer simulation project outside the ``special circumstances''
requires three major components:
Example: N-Body Modeling
This course is an introduction to N-body simulations. We will briefly
survey here the three main components of simulation projects on our
chosen topic of the course.
1. Physics and the theoretical model
This part will illustrate the physical problem and its
theoretical model as the first component of computer modeling in
the general topic of N-body simulations. We will start with the underlying
theoretical framework which is general enough to capture a very
broad range of physical applications.
2. Algorithm and software implementation
The 6N coupled ordinary differential equations as displayed in Eq. 2
have to be solved numerically using some finite discretization of
the time variable. Variable discretization schemes are used in the
literature, like the leapfrog algorithm, or the Nordsieck predictor-corrector
method. The force calculation on the right side of Eq. 2 is also
a challenging problem. A naive approach will require N^2 calculations,
sophisticated procedures, like FFT or the Treecode will reduce the number
of operations to NlogN.
To keep software development accessible to every student, the code
we will work with will always be available in Fortran and C programming
languages. It will be the student's choice which language to use.
Since the discussions and applications will never be completely
symmetric, it is advantageous if teams have some knowledge
in both languages.
The Fortran implementation of the famous
Treecode for the collision of two galaxies is about 3000 lines and
organized in a very transparent fashion. We will also work in the
class with its equivalent C language implementation.
3. Analysis and visualization
The above two examples of N-body simulations are briefly discussed here.