30 Gauß–Seidel Iterative Method 297
such that they form at least an approximate line. It is not completely perfect
but good enough such that nobody notices it.
In order to get the players exactly onto the line, the algorithm would
have to run for an infinitely long time. This is why you will never get the
completely right result in practice. But that does not matter because after
sufficiently many steps the algorithm’s outcome can get arbitrarily close to
the correct solution. You encounter algorithms like this often when it comes
to so-called numerical problems, i.e., when real decimal numbers have to be
computed, such as those needed by physicists or engineers.
If the players line up in the order of their back numbers, they will be
called from left to right over and over again but we can also do it differently.
A popular variant is the so-called red-black ordering of the players. There the
half of the players with the lower numbers occupy every other place in the
line first, then the players with the high numbers fill up the remaining places.
But even if the players are arranged completely at random, the method still
works, only it must be obvious to every player who both his neighbors are.
This method is the algorithm of Gauß and Seidel, which we are going to
apply for physical problems in the following.
Temperature Calculation in a Rod (1D)
Now, let us really consider the calculation of a temperature distribution. Is it
not somewhat amazing that we can use the principle of lining up in a row?
For example, if you look at the temperature distribution in a thin rod you will
notice that the temperature at every point along the rod is the average of the
temperatures in the neighborhood of that point. If you fix the temperature
at both ends of the rod, the temperature between both ends runs “in a row”,
i.e., linearly from one end to the other.
In order to compute this linear distribution of values, you need not use a
computer, just as a soccer coach needed no complicated algorithm in order
to place players in a row. But we can now see that the problems are related,
and maybe they can be solved in the same way. Observe that the position of
a player corresponds to a temperature value, otherwise the computation can
proceed in the same way as in our soccer problem.
Next, we make the task a bit more interesting: how does the temperature
distribution look if we heat the rod at some point in the middle? Then the
temperature at that point is of course no longer the average of the neighboring
temperatures, the additional heating has to be taken into account.
Now there is no longer an obvious possibility to determine the resulting
temperature distribution so we ponder how to utilize the computer for solving
this problem. A first difficulty is posed by the fact that there are infinitely
many points along the rod, however a computer can only treat finitely many
objects in finite time. Therefore, we choose a finite number of points along
the rod (see Fig. 30.2) at which we want to compute the temperature. This