16SOLVING THE COFFEE PROBLEM
In the previous chapter, we wrote a simulation of a cooling cup of coffee. Given the initial temperature of the coffee, the temperature of the atmosphere, and the rate parameter, r, we predicted the temperature of the coffee over time. Then we used a root-finding algorithm to estimate r based on data. If you did the exercises, you simulated the temperature of the milk as it warmed, and estimated its rate parameter as well.
Now let’s put it together. In this chapter we’ll write a function that simulates mixing the two liquids, and use it to answer the question we started with: Is it better to mix the coffee and milk ...
Get Modeling and Simulation in Python now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.