Question 1: How does the cooling behavior change if we vary the parameters Rth and C? Figure this out using intuition and the above equations, and then vary these parameters in your program to confirm your conclusions.
Varying C:
Intuitively, if the material has a higher heat capacity (dE/dT), then a cup losing heat at any rate will cool down more slowly than a cup losing heat at the same rate, but with a lower heat capacity. Hence, we expect the cooling curve to be more shallow (smaller magnitude of dT/dt) as the heat capacity increases. From the equation for dT/dt, we can also see that C appears in the denominator, confirming the idea that the curve will be shallower at higher C.
We confirmed this idea by graphing the cooling curve twice, once with C = 1000 and once with C = 1500. The C = 1500 graph had the shallower curve.
Varying Rth:
Intuitively, if there is more resistance to heat flow, heat and therefore temperature will change more slowly. This is illustrated in the equation for dT/dt in the fact that Rth is in the denominator.
We confirmed this idea by graphing the cooling curve at Rth = .85 and .95. The Rth = .95 graph had the shallower curve.
Question 2:
Calculate a good value for P if we want our coffee to heat up to the Starbucks ideal 84°C.
Heating Simulations:
1) Bang-bang control:
![]() |
Close-up of the behavior of the bang-bang control system |
![]() |
Overall behavior of the bang-bang control system |
Bang-bang control is appropriate for many thermal systems because although it can't keep the temperature precisely at a consistent temperature, it is able to keep the temperature inside of a range that depends on the delay time of the sensor and the heater that can usually be pretty small. It could be insufficient for smaller acceptable ranges because the temperature does fluctuate up and down constantly by a small amount.
![]() |
3) Bang-bang control with sensor delay:
With a sensor delay, the range of temperature gets much larger, because the coffee is allowed to cool for a much longer time before the heating kicks in each time the temperature falls below the target. There is also a delay at the start of the simulation when there is no sensor value, so the heating does not start immediately.
4) Proportional control with sensor delay:
In the proportional system, the delay causes the temperature to oscillate before stabilizing, because the heater is responding to a previous error which causes the heater to overshoot when the drink is heating and wait too long when the drink is cooling. There is also a delay at the start of the simulation when there is no sensor value, so the heating does not start immediately.
Other real-life delays could include delays between:
- the sensor recording a reading and the heater turning on
- the heater turning on and the heat reaching the coffee
- the heat reaching the coffee and the heat reaching the sensor
- the edges of the cup cooling and the center of the cup cooling (these would depend on the placement of the heat sensor).