CSI 801

Assignment #3: A Cool Cup of Coffee

October 24, 1996

...a cup, a cup, a cup, a cup, a cup...

Modeling the Temperature of a Cooling Cup of Coffee

Description

The cooling rate for a cup of coffee (or other culturally equivalent beverages) is approximately given by
 
  dT    T - Teq
  -- = ---------
  dt     tau
 
Where :
        T = current temp
        Teq = equilibrum (ambient) temp
        t = time
        tau = a cooling constant
Using this equation, calculate the cooling curve for coffee using the explicit and implicit methods. For both methods, use a variety of time step sizes to examine how the solution depends on step size. Also, compare this to analytic results and to the actual data at the end of this page. You will also have to calibrate your analytic solution using actual data.

Purpose of the Assignment

Through building this code, students will learn the essential difference between explicit and implicit solutions to PDE's. Students will also gain additional expertise producing graphics, and calibrating numerical simulations, along with familiarity with Unix Makefiles.

Assignment

Required Data

The following is a data table of temp vs time for a cup of coffee. You will need to use this data to determine the cooling constant Tau, as defined in the above equation.
time (minutes)Temperature (Celsius)
0.0 83.0
1.0 77.7
2.0 75.1
3.0 73.0
4.0 71.1
5.0 69.4
6.0 67.8
7.0 66.4
8.0 64.7
9.0 63.4
10.0 62.1
11.0 61.0
12.0 59.9
13.0 58.7
14.0 57.8
15.0 56.6

Procedure

  1. Determine the analytic solution to the coffee cup equation.
  2. Using the data in the above table, determine the cooling constant for this equation. (I am NOT going to specify an specific method for doing this.)
  3. Determine an explicit and implicit first order equation for the coffee cup problem.
  4. Using C, Fortran, or C++, write a program which solves the explicit and implicit equations over the time range O to 15 minutes.
  5. Use a Makefile to build the programs in this assignment.
  6. Using this code, create sets of data files with step sizes 0.1, 0.2, 0.5, 1, 2, and 5 minutes for both methods.
  7. Create a set of plots using your favorite plotting package with these results.
  8. Summarize your conclusions.

Assignment Requirements

The results from this project should be:
  1. a program that produces data for the explicit, implicit, and exact solutions to this program.
  2. a set of plots linked to your web page
  3. a short writeup about the results of this program. Keep it to about a page. Be sure to include at least a paragraph of conclusions!

Plots

The plots should be temperature as a function of time. The set of plots you produce should include:

explict method vs analytic solution
Several different time steps should be used for the explicit method. All the plots should be on the same graph.
implicit method and analytic solution
As before, several different timesteps should be used to create this graph.
measured results vs the analytic solution
Use the table below as an analytic result.

Placing it On-Line

When you have produced all the plots, create a web page for this assignment named "pa3.html and place it in your "public_html" directory. Make sure I can access it through the web. On this page, you should have links to your summary, your graphs, you programs, and the Makefile. Make sure the links work through the net.

If you absolutely cannot get the graphics into a form which can be viewed on the Web, I will accept paper copies of the assignments with no deduction in credit. However, it is much cooler to have them on-line and is more effective at showcasing your ablilities to possible employers.



Copyright John Wallin 1996. All rights reserved.
Last Modified : Thur Aug 29 12:31:00 EST 1996 <jwallin@gmu.edu>