Write a program to simulate the propagation of heat in a thin
insulated rod, as discussed in this lesson. Your program should
prompt the user for:
- the temperature of the left heat source,
- the temperature of the right heat source,
- the initial temperature of the rod,
- the number of segments (up to 20) into which the rod should be
divided,
- the number of time units to simulate, and
- the value of the constant C.
You should assume that the rod is one unit long. Thus, if you divide
the rod into N segments, each segment will be 1/N units long.
Recall that
Be sure to choose values of C so that s is between 0 and 1;
anything else is physically impossible! You'll get the most
interesting simulations if s is approximately 0.5.
Once your program has read in all of the initial conditions, it should
first display the initial temperature of each segment of the rod, and
then the temperature of each segment following each tick of simulated
time. You will find a function for displaying temperature histograms
in the file ``heat.c'' in your ``examples'' directory.
Eric N. Eide
Hamlet Project
Department of Computer Science
University of Utah