Final questions

  1. Consider the one-dimensional heat equation with k = 1, N = 20, and a random initial temperature distribution generated by
              u[i] = rand()/(double)RAND_MAX;
    
    Find and graph the temperature distribution for t = 1 .. 10. Use this as a basis for understanding the long-term behavior of the temperature distribution. If necessary compute it for larger values of t. Comment on any phenomena which seem of interest.
  2. Repeat the analysis of the previous problem for the two-dimensional heat equation with N = 11 and a random initial temperature distribution given by
                 u[i,j] = rand()/(double)RAND_MAX;
    
  3. Note: For some reason our beloved compiler does not seem to know about RAND_MAX any more. It should be defined in <stdlib.h> (see p. 252 of "The C Programming Language" by Kernighan and Richie, second edition). A temporary fix for this is to put the line
      #define RAND_MAX 100000000
    
    in your program. You can use a different value or RAND_MAX if you like. The point is to use a large integer.

Back to syllabus
Back to Department of Mathematics, University of Utah
Created Feb 28, 1995
Last modified: Feb 28, 1995
Copyright © 1995 Department of Mathematics, University of Utah