Next: 7.2 Rootfinding (optimization)
Up: 7. Workhorses of Computational
Previous: 7. Workhorses of Computational
Contents
Now that you are familiar with the basics of programming and can write
simple programs, you can begin to solve physics problems that have no
``closedform'' solutions. The fact that a problem has no closedform
solution does not mean that it doesn't have a solution, only that that
solution can't be written as any combination of elementary functions. Most
(all?) of the interesting problems in the physical sciences fit into this
category. Some of the problems that cannot be solved in closedform are
surprisingly simple. For example, the time dependence of the angular
displacement a simple pendulum, , cannot be written as any
combination of elementary functions^{7.1} and neither can the orbits of three (or more) celestial
bodies.
This may seem a little odd to you if you're used to the ``nice,
pretty'' answers of PHY 161 and PHY 262 but nice, pretty answers are
actually the exception rather than the rule. Simple examples from math may
be more familiar. Consider the equation . Can you solve it? How
do you isolate ? This amazingly simplelooking equation cannot be
simplified, that is, we cannot isolate and write it in terms of
elementary functions. And yet the solution exists and is easy to find. Make
sure your calculator is in radians mode, enter 0.7, and then repeatedly
strike the cos
key. Soon, you'll find that the answer stops
changing. The equation is solved for
.
If we rewrite the equation as and then plot it
(ezplot('xcos(x)',[0 1])
, we can see
graphically that there is indeed an answer and that it occurs near .
Figure:
.

Just because we can't write the solution in closedform doesn't mean that
it somehow isn't as good. You might argue that we actually can't write our
solution down exactly so in that sense it's only approximate but we can
determine it to as many digits as we want to. Consider
. We can't write down exactly either but we don't
consider our answer anything but exact.
In the same way that doesn't have a pretty answer, most
physics problems don't eitherand the nonexistence of a pretty answer
does not imply that the system we're studying is exceptionally
complex. Consider the two examples we just mentioned, a simple pendulum and
a ``threebody'' problem, these are exceptionally simple cases and yet they
have no closedform solutions. When we can't solve a problem ``with paper
and pencil'' we must resort to ``numerical'' solutions (like we did for
above). The easiest way to implement methods for finding
solutions to problems that must be solved ``numerically'' is to use a
computer. Thus, computational physics implies a computerbased approach to
solving physics problems.
At this stage, I should also mention that computational physics isn't just
solving physics problems by computer but also includes computer
simulations. Computer simulations are more than just solving a
difficult equation numerically. Computer simulations allow us to make
models of a physical system and then watch the evolution of the model
almost as if we were performing an experiment in a real
laboratory. Computer simulations have come to play a significant role in
physics research. Some significant discoveries in physics have been made by
performing ``computer experiments'' in ``virtual laboratories.'' Until the
recent past, physics was divided into two major fields, theoretical physics
and experimental physics. But recently, computational physics has become an
important third field in physics. In the rest of this chapter, you will be
introduced to the major techniques of computational physics.
Next: 7.2 Rootfinding (optimization)
Up: 7. Workhorses of Computational
Previous: 7. Workhorses of Computational
Contents
Gus Hart
20050128