Continuous Simulation: How Computers Solve Differential Equations
How a cooling cup of coffee shows that the integration method and the time step can make or break a simulation
Key takeaways
A differential equation describes how fast something changes. When no neat formula exists, a computer advances the model in small time steps, so the method and the step size become assumptions of the model.
For the cooling cup, two steps of fourth-order Runge-Kutta beat 200 steps of Euler. Matching that accuracy with Euler takes 904 steps, about 113 times as many rate evaluations.
A step that is too large can produce oscillations, or even explosive nonsense, without any error message. Rerunning with half the step is the cheapest safeguard.
Cold milk added early leaves the coffee about 0.9 °C hotter at minute 15, because the milk is colder than the room. With room-temperature milk and an unchanged cooling constant, the effect disappears entirely.
In chaotic systems, a one-in-a-million difference destroys a forecast, and so does the solver's own error. Analyze ensembles, not single trajectories.
Engineers, epidemiologists, climate scientists, and business strategists all rely on models of quantities that change smoothly: temperature, infections, inventory, reputation. The charts these models produce look like smooth curves, yet a computer never sees a curve. It moves forward in steps, and behind every smooth line are two quiet choices: how long each step is and how the change within the step is computed. Make them badly and the model can be confidently, silently wrong.
Hat Nau, the fictional coffee chain followed throughout this series, offers a small laboratory. Its product team is weighing two seemingly minor questions. First, when customers buy takeaway coffee in a paper cup, how long does it take to cool to a drinkable temperature, and should the chain switch to insulated cups for customers with a long commute? Second, should baristas add cold milk right away, or let customers add it later, if the goal is for the coffee to still be hot when it is drunk?
These are not questions about queues, customers, or strategy. They are questions of physics, about a quantity that changes continuously over time. Answering them requires one of the oldest and most widespread types of simulation in science and engineering: continuous simulation based on differential equations.
In fact, the series has met continuous simulation several times already. The SIR epidemic model in What Is Simulation?, the Bass model and the chain expansion model in the article on system dynamics, and the strategic layer in the article on hybrid simulation and digital twins all rest on equations for rates of change, solved step by step. But we have not asked closely how the computer solves them, or how accurate the results are.
This article has four sections. Section 1 explains what continuous simulation is and why computers need to "slice" time. Section 2 explores numerical integration through the coffee cup: error, order of accuracy, and stability. Section 3 extends to combined continuous-discrete systems, chaotic systems, and stiff systems. Section 4 summarizes the process, the pitfalls, the tools, and Python code you can run.
1. Understanding Continuous Simulation
This section answers three questions in turn: what a differential equation describes, when it can be solved with a formula, and what a computer does when it cannot.
1.1. Differential equations, the language of change
Describing the rate of change rather than the result. Many natural laws do not tell us directly how large a quantity is, but how fast it changes. Newton's law of cooling is an example: the rate at which an object cools is proportional to the temperature difference between the object and its surroundings. As an equation:
dT/dt = −k × (T − Troom)
Here T is the temperature of the coffee, Troom is the room temperature, and k is the cooling constant, which depends on the type of cup, the amount of liquid, whether there is a lid, whether there is a breeze, and so on. The equation says that while the coffee is very hot it cools very quickly; when it is close to room temperature it cools very slowly. It is an approximation: it lumps conduction, convection, radiation, and evaporation into the single number k.
The link to stocks and flows. If you have read the article on system dynamics, this equation will look familiar. Strictly speaking, the heat contained in the cup is a stock, and the heat lost each minute is an outflow. As long as the amount of coffee does not change, temperature moves in proportion to heat, so we can treat it as the water level of that stock. System dynamics is essentially a visual representation of systems of differential equations, and system dynamics software solves them with the methods presented here.
1.2. When is there an exact solution, and when not?
Newton's law of cooling is simple enough to solve analytically. Its exact solution is an exponential function:
T(t) = Troom + (T0 − Troom) × e−k·t
Take coffee starting at 85 °C in a warm room at 28 °C, and assume that customers start drinking at 60 °C. Table 1 gives the results for two types of cup with assumed values of k.
With these constants, the product team's first question already has a tentative answer. Customers who drink within half an hour are well served by paper: the coffee reaches 60 °C in under 13 minutes. Customers who travel for more than 30 minutes will find the paper cup merely lukewarm, while the insulated cup keeps the coffee too hot to drink for more than an hour. No cup is best for everyone; the choice depends on how far it is from the counter to the first sip.
Most real systems do not have such a neat solution. Some added details are still solvable, only with longer formulas: a cup that itself warms and cools by a linear law, or a room temperature that changes through the day. But once we include evaporation or radiation, which depend on temperature nonlinearly, there is usually no convenient closed form left. Likewise, the Bass model has an analytical solution, but a chain expansion model with many stocks and nonlinear relationships generally does not. The practical way forward is then to let the computer approximate the solution step by step.
1.3. How does a computer "see" continuous time?
A computer cannot handle a continuously changing quantity directly, because between any two moments there are infinitely many others. The solution is to divide time into small time steps of length Δt, and to compute the state at the end of each step from the state at the beginning. This procedure is called numerical integration, and the way the computation is done within each step is called the numerical integration method.
The two key questions of any continuous simulation are therefore which method to use and what time step to choose. Section 2 shows that these two choices can make the result entirely right or entirely wrong.
2. The Coffee Cup and Numerical Integration Methods
This section uses Newton's law of cooling with the paper cup (k = 0.045) as a laboratory, because there is an exact solution to compare against. The concepts that emerge, namely error, order of accuracy, and stability, carry over to equations with no neat solution, although the specific numbers will differ.
2.1. Euler's method, simple and intuitive
The idea. Euler's method, named after the mathematician Leonhard Euler, is the simplest numerical integration method. It assumes that the rate of change stays constant throughout a step:
T(t + Δt) = T(t) + Δt × (rate of change at time t)
This is exactly the "new stock equals old stock plus flow times time step" formula of system dynamics. For example, at minute 0 the coffee is at 85 °C and the room at 28 °C, so the cooling rate is −0.045 × 57 = −2.565 °C per minute. With a 10-minute step, Euler predicts a temperature at minute 10 of 85 − 25.65 = 59.35 °C. The exact solution gives 64.34 °C, a gap of almost 5 °C.
Why Euler is wrong. Euler uses the cooling rate at the start of the step for the whole step. But the coffee cools more and more slowly: the rate at the start, when the coffee is hottest, is the fastest in the whole step. In this problem Euler therefore always overestimates the heat lost in each step, and the coffee "cools faster than in reality." The left panel of Figure 1 shows this clearly: the 10-minute Euler line lies lowest, the 5-minute line is closer, and the points from Runge-Kutta, the method introduced in Section 2.3, sit right on the exact curve. The right panel plots the two cups of Table 1.

2.2. Smaller steps are more accurate, but at what cost?
Table 2 compares the temperature at minute 20 for different time steps, for both Euler and fourth-order Runge-Kutta. The exact value is 51.17447 °C. Errors are absolute: Euler is always below the exact value, and Runge-Kutta slightly above.
With Euler, halving the step roughly halves the error. In other words, the error is proportional to the step size, and Euler is called a first-order method. To get an error below 0.05 °C at minute 20, Euler needs at least 189 steps.
2.3. Runge-Kutta, looking before stepping
The idea. The family of Runge-Kutta methods overcomes Euler's weakness by "probing" the rate of change at several points within each step and taking a weighted average. The classic fourth-order Runge-Kutta method (RK4) computes four estimates of the rate for each step:
The rate at the start of the step (as in Euler).
The rate at the midpoint, if we moved half a step using estimate 1.
The rate at the midpoint, if we moved half a step using estimate 2.
The rate at the end of the step, if we moved a full step using estimate 3.
The final result is a weighted average of the four estimates, with the two midpoint estimates given double weight. Try a 10-minute step: the four estimates are −2.565, −1.988, −2.118, and −1.612 °C per minute, and their weighted average is −2.065. The temperature at minute 10 is 85 − 20.65 = 64.35 °C, against 64.34 °C for the exact solution. Runge-Kutta methods, together with multistep methods, are the two large families covered in the classic textbook on ordinary differential equations by Hairer et al. (1993).
The power of higher order. Table 2 shows the power of RK4: with only 2 steps (a 10-minute step), RK4 is already accurate to 0.01 °C, better than Euler with 200 steps. Each RK4 step costs four times as much as an Euler step because the rate is evaluated four times, so 2 RK4 steps cost 8 evaluations. To match that accuracy, Euler needs 904 steps and 904 evaluations, about 113 times as many.
The left panel of Figure 2 plots the error at minute 40 against the time step on logarithmic axes. The slope gives the method's order of accuracy: 1.03 for Euler and 4.12 for RK4 (the theoretical values are 1 and 4). Making the step 10 times smaller makes Euler about 10 times more accurate and RK4 about 10,000 times more accurate. In this calculation, going from a 10-minute to a 1-minute step, the actual factors are 10.9 and about 14,000.

2.4. Stability: when too large a step brings everything down
Large errors are bad enough, but there is a more serious problem: numerical instability. The right panel of Figure 2 shows Euler's method with too large a time step. With a 30-minute step, the first step predicts that the coffee cools to about 8 °C, below room temperature, a physically absurd result. The result then swings up to 35 °C and down to 25.6 °C before gradually settling at 28 °C. With a 50-minute step, the oscillation grows more and more violent, with the coffee at times "cold" at −146 °C and at times "hot" at 245 °C. The simulation is completely meaningless.
The reason is visible in the formula. Each Euler step multiplies the difference from room temperature by (1 − k × Δt). If Δt is smaller than 1/k, about 22 minutes for the paper cup, this factor lies between 0 and 1 and the difference shrinks steadily, as in reality. If Δt lies between 1/k and 2/k, the factor is negative, so the result jumps back and forth around 28 °C but dies out. If Δt exceeds 2/k, about 44 minutes, the factor is larger than 1 in magnitude: the error is not just large but amplifies itself at every step. RK4 has a threshold too, a little farther out: about 2.79/k, or nearly 62 minutes.
The practical lesson is important. An unstable simulation may produce no error message at all. The program still runs, still prints numbers, still draws charts. Only a knowledgeable modeler will notice that the results are absurd. This is why every continuous model should be checked by rerunning it with half the time step: if the results change significantly, the original step was not small enough.
2.5. Checking the time step of a business model
This check applies directly to a kind of model familiar from system dynamics. Take the Bass diffusion model with illustrative parameters: a coefficient of innovation p = 0.03 and a coefficient of imitation q = 0.38 per month, a potential market of M customers, and no adopters at the start. The rate of new customers is (p + q × N/M) × (M − N). This model has an exact solution: the market reaches 50% at time ln(2 + q/p)/(p + q) = 6.55 months. Table 3 compares that with Euler.
With a 1-month step, reading the output directly gives 8 months, almost 1.5 months or 22% off. That number mixes two kinds of discrepancy. One is Euler's integration error, about 0.65 months, visible in the interpolated column. The rest, about 0.8 months, arises only because results are recorded at whole months, so the crossing time is rounded up. With a 0.25-month step, the discrepancy is only about 0.2 months (3%) when read off the grid, accurate enough for comparing policies.
The interpolated column also repeats the first-order lesson: halve the step and the error halves. Euler is still widely used in system dynamics. The documentation of Vensim says plainly that Euler is not a good technique for solving differential equations accurately, yet it suits many business and social models; for more accuracy, reduce the time step (Ventana Systems, n.d.). Checking the time step should therefore be a mandatory part of model verification.
3. More Complex Systems
A cooling cup of black coffee is the easiest case. This section moves on to three harder situations, systems that are both continuous and discrete, chaotic systems, and stiff systems, and then surveys the fields that use continuous simulation.
3.1. When continuous meets discrete: milk early or late?
The problem. Back to the product team's second question: should cold milk be added right away or later? This is a classic puzzle in physics teaching. The educational equipment company Vernier describes a real experiment with two cups of coffee: although the cup with cream added early is cooler at first, by the end it is the hotter one. The company presents this as a great demonstration of Newton's law of cooling (Vernier, 2011).
The simulation model combines two kinds of change. The continuous change is the coffee cooling by Newton's law. The discrete change happens at one moment, when 30 ml of milk at 5 °C is poured into 200 ml of coffee and the temperature of the mixture drops instantly according to the mixing rule, a volume-weighted average. For simplicity, we give milk and coffee the same heat capacity and, for now, keep k unchanged after the milk is added.
This is a combined continuous-discrete simulation, very common in engineering: a thermostat switching on and off (discrete) controls room temperature (continuous), and a valve opening and closing (discrete) controls a flow (continuous).
Results. Figure 3 plots the temperature of the two cups, and Table 4 records the key moments.

The cup with early milk is about 0.9 °C hotter when the customer drinks it. The usual explanation is that the hotter black coffee loses heat faster during the first 10 minutes. That is true but incomplete. With this linear equation, if the milk were exactly at room temperature, the difference from the room would be multiplied by the same dilution ratio of 200/230 whenever it was poured, and the two cups would be exactly equal. The gap appears because milk from the refrigerator is 23 °C colder than the room. Poured early, the milk's "coldness" has 15 minutes to be warmed by the room; poured late, it has only 5.
Written as a formula, the temperature at minute 15 when milk is added at minute m is 28 + (200/230) × 57 × e−15k − (30/230) × 23 × e−k(15−m). Only the last term depends on m: the larger m is, the more is subtracted. In reality, moreover, a fuller cup holds heat longer, so k also falls after the milk is added. Table 5 shows how the conclusion changes with the assumptions.
The third row assumes that the heat lost per degree of difference is unchanged, so k is inversely proportional to the amount of liquid. The advantage of early milk then nearly triples. With an insulated cup, the timing hardly matters.
A difference of 1 or 2 °C is not large, and in practice Hat Nau's decision also depends on taste and workflow. But the example illustrates two points. Intuition is often wrong about dynamic systems, even the simplest ones, and a small model can answer a question far faster and more cheaply than an experiment. And changing the assumptions is what reveals the true cause: the second row of Table 5 refutes the explanation based only on how fast black coffee cools.
3.2. Chaotic systems and the limits of predictability
Lorenz's discovery. In 1963, the MIT meteorologist Edward Lorenz published "Deterministic Nonperiodic Flow," studying a simple system of three differential equations that represents convection (Lorenz, 1963). The system is completely deterministic: it contains no randomness at all. Yet Lorenz showed that two runs starting from almost identical initial states can evolve into considerably different states. The finding helped lay the foundation of chaos theory, later associated with the famous image of the "butterfly effect."
Reproducing the experiment. The Lorenz system is dx/dt = σ(y − x), dy/dt = x(r − z) − y, dz/dt = xy − bz, with the classic parameters σ = 10, r = 28, and b = 8/3. Figure 4 recreates the experiment from the starting point (1, 1, 1). The two runs differ only in the initial value of x: 1 and 1.000001, one part in a million. Both use SciPy's DOP853 method with a tolerance of 10−12.

For about the first 27 time units, the two runs almost coincide. After that, the tiny initial difference has been amplified enough that the trajectories separate completely. If the initial difference is 1,000 times larger, one part in a thousand, they separate at about 18.4. Measuring the starting point 1,000 times more precisely buys only about 9 more time units: better input data extend the forecast horizon, but very slowly.
A second experiment is even more thought-provoking. Keep the same starting point and merely switch from the very high-precision setting to the solver's defaults (RK45, relative tolerance 10−3). The trajectory is off by more than 1 from around time 12. In a chaotic system, numerical integration error is itself a "butterfly." That applies to Figure 4 as well: rerun with three methods at the same tolerance of 10−12, the results agree only until about time 33. Beyond that point the details of each curve cannot be trusted, even though the overall butterfly shape persists.
Practical significance. Lorenz used this finding to examine the feasibility of very-long-range weather prediction (Lorenz, 1963). It is also why modern weather centers do not run their models just once, but many times from slightly different initial conditions. As introduced in the article on Monte Carlo simulation, the European Centre for Medium-Range Weather Forecasts runs its model 51 times from slightly different initial conditions to estimate forecast uncertainty (European Centre for Medium-Range Weather Forecasts [ECMWF], n.d.). Here continuous simulation, solving the equations of the atmosphere, meets the Monte Carlo spirit of running many scenarios.
3.3. Stiff systems: when some things change very fast and others very slowly
Another difficulty is stiff systems, which contain both very fast and very slow processes. In an espresso machine, for example, the temperature sensor and controller react within hundredths of a second, while the water in the boiler heats up over several minutes.
With methods such as Euler or RK4, the time step is limited by the fastest process to ensure stability (as seen in Section 2.4), even though that process barely affects the result of interest. To solve this, mathematicians developed implicit methods, which allow large steps while remaining stable; the textbook by Hairer and Wanner (1996) is devoted to such problems. Modern libraries such as SciPy provide both kinds: explicit methods such as RK45 for nonstiff systems, implicit methods such as Radau and BDF for stiff systems, and an LSODA option that switches between the two automatically (The SciPy Community, n.d.).
To see the difference, consider a hypothetical boiler. The water temperature T starts at 25 °C, loses heat to its surroundings with a time constant of 600 seconds, and is heated at a rate of 0.03 × (93 − s) °C per second, where s is the sensor reading. The sensor tracks the water with a time constant of 0.01 seconds: ds/dt = (T − s)/0.01. Table 6 records the computational work for 600 seconds at a tolerance of 10−6.
All four methods give the same answer: the water settles at 89.42 °C, below the 93 °C setpoint because a proportional controller needs some error to keep heating. But RK45 evaluates the right-hand side about 600 times as often as BDF, although each implicit step costs more because it must solve an additional system of equations. With Euler and a step of 0.021 seconds, just past the 0.02-second threshold, the result overflows. The wider the gap between fast and slow, the more expensive explicit methods become.
3.4. Continuous simulation across engineering
Beyond these examples, continuous simulation is a foundational tool in many fields. Mechanical and aerospace engineering simulates the motion of vehicles, aircraft, and spacecraft, and the vibration of structures. Electrical and electronic engineering simulates circuits, power systems, and motors. Control engineering designs and tests controllers before they are installed in the real system. Chemistry and biology simulate reaction kinetics, drug metabolism in the body (pharmacokinetics), and population ecology. Climate and environmental science uses models of climate, water quality, and air quality.
Many of these problems lead to partial differential equations, in which a quantity varies over both time and space, such as the temperature at each point of a cup's wall. They require more specialized methods, such as the finite element method, which are beyond the scope of this article.
4. Practicing Continuous Simulation
This section gathers the lessons above into a short process and four common pitfalls, and then introduces tools and sample code.
4.1. The process
A trustworthy continuous simulation usually goes through six steps:
Write the equations from physical, economic, or behavioral laws: identify the state variables (stocks) and their rates of change (flows).
Choose a numerical integration method: for most problems, a ready-made solver with an adaptive step size (such as RK45 in SciPy) is a reasonable starting point. If the solver runs very slowly, suspect a stiff system and try an implicit method.
Check convergence: rerun with a smaller step or a tighter tolerance. The results of interest must not change significantly.
Check against a case with an exact solution where possible, as this article does with the cooling equation and the Bass model.
Check plausibility: with cooling alone, the temperature must not fall below ambient; the number of customers must not be negative; total population must be conserved.
For chaotic systems: do not interpret a single trajectory as a forecast; analyze an ensemble of runs.
4.2. Common pitfalls
Most mistakes lie not in the equations but in how they are solved and how the results are read.
Using the default time step without checking. As Section 2.5 shows, too large a step can shift a reported time by more than 20% without any warning.
Mistaking numerical error for real behavior. The oscillations in the right panel of Figure 2 look like an interesting physical phenomenon but are just an artifact of the computation. Before interpreting an oscillation, check whether it persists when the time step is reduced.
Trusting false precision. An RK4 simulation that gives results to six decimal places does not mean reality is that precise. Errors in the model itself (how k was estimated, whether evaporation was ignored) are usually far larger than integration error. Table 5 is an example: a single assumption about k after the milk is added changed the result by more than 2 °C, hundreds of times the error of RK4 with a 10-minute step.
Ignoring discrete events. If the system has sudden changes (pouring milk, flipping a switch, opening a new branch), handle them as separate events, stopping the integration at that moment and restarting it, rather than letting the solver "step over" them with a large step.
4.3. Tools and sample code
Among the tools, Python with SciPy offers the solve_ivp function, with many adaptive-step methods that suit most problems in this article. MATLAB and Simulink are widely used in engineering, especially control engineering, with an intuitive block-diagram interface. Modelica (through OpenModelica and Dymola) is an object-oriented modeling language for multi-domain engineering systems (mechanical, electrical, thermal, hydraulic). Vensim and Stella serve system dynamics.
The first program reproduces the two output columns of Table 2 in plain Python, with no library beyond math.
import math
T_ROOM, T0, K = 28.0, 85.0, 0.045
def rate(T): # Newton's law of cooling
return -K * (T - T_ROOM)
def euler_step(T, h):
return T + h * rate(T)
def rk4_step(T, h):
k1 = rate(T)
k2 = rate(T + h / 2 * k1)
k3 = rate(T + h / 2 * k2)
k4 = rate(T + h * k3)
return T + h / 6 * (k1 + 2 * k2 + 2 * k3 + k4)
def solve(step, h, t_end=20):
T = T0
for _ in range(round(t_end / h)):
T = step(T, h)
return T
exact = T_ROOM + (T0 - T_ROOM) * math.exp(-K * 20)
for h in [10, 5, 2, 1, 0.1]:
e, r = solve(euler_step, h), solve(rk4_step, h)
print(f"{h:>4} min: Euler {e:.3f} ({abs(e - exact):.3f}), "
f"RK4 {r:.3f} ({abs(r - exact):.1e})")The second program solves the milk problem with solve_ivp, treating the pouring of milk as a discrete event that splits the simulation into two continuous phases.
from scipy.integrate import solve_ivp
T_ROOM, K = 28.0, 0.045 # room temperature (°C), paper cup cooling constant (1/min)
def cooling(t, T): # Newton's law of cooling: dT/dt = -k (T - T_room)
return [-K * (T[0] - T_ROOM)]
def add_milk(T_coffee, V_coffee=200, V_milk=30, T_milk=5):
return (V_coffee * T_coffee + V_milk * T_milk) / (V_coffee + V_milk)
def temp_at_minute_15(milk_minute):
T = 85.0
if milk_minute > 0: # continuous phase 1: black coffee cools down
T = solve_ivp(cooling, (0, milk_minute), [T], rtol=1e-8).y[0, -1]
T = add_milk(T) # discrete event: cold milk poured in
# continuous phase 2: the white coffee keeps cooling until minute 15
return solve_ivp(cooling, (milk_minute, 15), [T], rtol=1e-8).y[0, -1]
for minute in [0, 5, 10, 14]:
print(f"Milk added at minute {minute:2d}: temperature when drunk (minute 15) = {temp_at_minute_15(minute):.2f} °C")The results show the drinking temperature falling the later the milk is added: 51.71 °C if added right away, 51.32 °C at minute 5, 50.84 °C at minute 10, and 50.37 °C at minute 14. Try substituting the insulated cup's K (0.008), setting T_milk to 28 to verify the second row of Table 5, or adding a second equation for the temperature of the cup itself.
Conclusion
Continuous simulation is one of the oldest types of simulation and, in a sense, the foundation of many others. This article has shown that two seemingly technical choices, the integration method and the time step, can decide whether the result is right or wrong. Euler is simple but inaccurate and prone to instability. Higher-order Runge-Kutta methods are far more accurate for the same cost. Chaotic systems set fundamental limits on all long-range forecasts, and stiff systems require specialized methods. Above all, the simple habit of rerunning with a smaller step can prevent a great many wrong conclusions.
Looking back, Hat Nau's story began with a classification map: three technical questions (static or dynamic, deterministic or stochastic, discrete or continuous) and the main modeling paradigms. Monte Carlo simulation assessed the risk of a new branch and showed that "a single number" hid a probability of loss of almost one in four. Discrete-event simulation found the real bottleneck at the drink station rather than at the ordering counter everyone could see. System dynamics examined fast and slow expansion in a system with feedback and delays. Agent-based modeling looked at branch location through the behavior of individual customers. Hybrid models and digital twins combined the methods and brought simulation into daily operations. This article returned to the mathematical foundation, with a cooling cup of coffee and Lorenz's butterflies.
All of these use simulation to analyze and decide: people stand outside the model, run scenarios, and choose an option. One question remains for the series: what happens when people step inside the model and make decisions while it runs? Beneath a flight simulator lie differential equations solved step by step, just as in this article, with one added constraint: each step must finish in real time. The article on simulation for learning continues from there, through business games, flight simulators, and virtual reality.
Each type of simulation is a lens, and no lens is best for every question. The most important skill of a simulation practitioner is not mastering a particular software package, but asking the right question, choosing the right lens, and always keeping a healthy skepticism toward their own results.
Data note: Hat Nau is a fictional coffee chain. The cooling constants, the 60 °C threshold, the volumes and milk temperature, and the Bass and boiler parameters are illustrative assumptions. Simulations were run in Python (NumPy, SciPy); the step counts in Table 6 may vary slightly with the SciPy version.
References
European Centre for Medium-Range Weather Forecasts. (n.d.). Quantifying forecast uncertainty. Retrieved November 23, 2026, from https://www.ecmwf.int/en/research/modelling-and-prediction/quantifying-forecast-uncertainty
Hairer, E., Nørsett, S. P., & Wanner, G. (1993). Solving ordinary differential equations I: Nonstiff problems (2nd rev. ed.). Springer. https://doi.org/10.1007/978-3-540-78862-1
Hairer, E., & Wanner, G. (1996). Solving ordinary differential equations II: Stiff and differential-algebraic problems (2nd rev. ed.). Springer. https://doi.org/10.1007/978-3-642-05221-7
Lorenz, E. N. (1963). Deterministic nonperiodic flow. Journal of the Atmospheric Sciences, 20(2), 130–141. https://doi.org/10.1175/1520-0469(1963)020%3C0130:DNF%3E2.0.CO;2020%3C0130:DNF%3E2.0.CO;2)
The SciPy Community. (n.d.). scipy.integrate.solve_ivp. SciPy documentation. Retrieved November 23, 2026, from https://docs.scipy.org/doc/scipy/reference/generated/scipy.integrate.solve_ivp.html
Ventana Systems. (n.d.). Euler integration. Vensim documentation. Retrieved November 23, 2026, from https://vensim.com/documentation/euler.html
Vernier. (2011, May 16). Cooling coffee. Vernier Science Education. https://vernier.com/vernier-ideas/cooling-coffee


Discussion about this post