Now that you understand something about arrays, let's delve a bit
deeper into the simulation behind the heat flow problem.
Recall that we are simulating the heat flow problem by dividing our
rod into N segments, each of length h, under the assumption that
the temperature within each segment is uniform. How can we keep track
of the temperature of each of the N segments?
Click here for the answer
As time passes, heat flows through each segment of the rod. Heat
dissipates, so each segment gives some of its own heat energy to its
neighbor segments. If we let u(i, t) stand for the temperature of
segment i at time t, then u(i, t+1) (which is the temperature of
segment i one time unit later) is given by the equation
where
and C is a constant determined by the thermal conductivity, specific
heat, and density of the material.
Thus, the temperature of a segment one time unit from now depends upon
the current temperatures of the segment and its two neighbors. The
formula only applies to internal segments, of course. The end
segments, by assumption, remain at the constant temperature of the
adjacent heat source.
Eric N. Eide
Hamlet Project
Department of Computer Science
University of Utah