1. Models are not simulations
How long until a warm object cools?
Section titled “How long until a warm object cools?”Place a warm metal bead in a room and measure its temperature. Will it lose the same number of degrees every minute? Or will cooling slow as it approaches room temperature? Our first model predicts the second behavior: after each equal time interval, the temperature difference shrinks by the same fraction.
The bead runs through the whole series. We first describe it with one number, then ask what changes when a slab needs a temperature at every point. The heat-transfer path develops that spatial model; numerical simulation asks how accurately we solve it. You can start in either subject and return here for a particular idea.
Decide what the system contains
Section titled “Decide what the system contains”Draw an imaginary boundary around the bead. Energy leaves it and enters the room. The room is treated as a reservoir with fixed temperature . Assume the bead has one uniform temperature , constant heat capacity in joules per kelvin, and a constant thermal conductance to the room in watts per kelvin. We neglect internal heating and changes of phase.
system boundary ┌──────────────────┐ │ bead: C, T(t) │ ── Pout = G(T − T∞) ──> room at T∞ └──────────────────┘Conceptual energy-flow diagram. The arrow defines positive outward power; if the bead is colder than the room, the signed power is negative.
Energy balance gives . Substitution yields
The balance and the transfer law have different jobs: energy conservation accounts for the change, while describes the exchange we chose. The ODE chapter will derive its solution. For now, check the signs: a hotter bead has positive outward power and a negative temperature derivative.
For , define and . The relation becomes , with . Thus the small source example below is also a normalized cooling model. Its dimensionless state is a ratio of temperature differences, not temperature itself.
Make a prediction before compiling
Section titled “Make a prediction before compiling”Take illustrative values and . At a temperature difference of , the outward power is and the initial cooling rate is . At half that difference, the cooling rate is half as large. These are algebraic consequences of our assumptions; no computer output is needed to obtain them.
The time scale compares storage with exchange. A bead with twice the heat capacity and the same conductance responds twice as slowly. The executable source uses for a shorter experiment; it has the same normalized mathematical structure.
Why this distinction matters
Section titled “Why this distinction matters”A simulation is one way to investigate a model. It is not the model itself. Keeping the two separate lets us ask two different questions:
- What mathematical statement follows from our assumptions?
- How will a computer approximate and execute that statement?
If those questions are mixed, changing a time step can appear to change the physical meaning. Eqiora keeps them apart:
- a Model names quantities and states typed relations;
- a Realization selects numerical methods and execution policy;
- a Run applies a realization to state and inputs; and
- an Observation projects a result into values intended for interpretation.
Learning outcomes
Section titled “Learning outcomes”After this chapter, you should be able to:
- classify a statement as model meaning, realization policy, run input, or observation;
- explain why an initial value can belong to a model while an output time does not;
- compile a readable
.eqimodel without choosing a solver; and - diagnose a solver choice that has leaked into model source.
From phenomenon to relation
Section titled “From phenomenon to relation”Suppose a dimensionless quantity decreases at a rate proportional to its current value. We choose these assumptions:
- is the only changing quantity;
- the proportionality factor is constant and has inverse-time dimension;
- time is continuous; and
- the initial value of is one.
Those assumptions produce the residual relation
Writing the relation as a residual equal to zero states mathematical meaning without naming an integration method, tolerance, output schedule, processor, or file format.
Readable Eqiora source
Section titled “Readable Eqiora source”Save this as decay.eqi:
// A minimal implicit ODE: x decays at the rate supplied by the user.model decay() { // `x` is dimensionless and starts at 1. `rate` has inverse-time units. state x: 1; initial { x = 1; } parameter rate: 1 / s = 1;
// Eqiora writes the evolution law as a residual equal to zero. relation flow { derivative(x) + rate * x = 0; }}The declaration says that x is dimensionless and initially one, rate has
inverse-seconds dimension, and flow is a continuous relation. It does not say
which integrator to use or when to record output.
With the package from Get started, compile the source from Python without resolving or running it:
from pathlib import Path
import eqiora
source = Path("decay.eqi").read_text(encoding="utf-8")model = eqiora.compile(source=source, filename="decay.eqi")print(model.field_ids)Compilation checks that the source is valid Eqiora with consistent meaning and units. It cannot tell you whether the assumptions fit your physical system.
What belongs on each side
Section titled “What belongs on each side”| Decision | Boundary | Reason |
|---|---|---|
| Model | It is part of the mathematical initial-value problem. | |
| has dimension | Model | It makes the relation dimensionally meaningful. |
| Adaptive versus fixed stepping | Realization | It selects an approximation policy. |
| Stop at | Run | It is a request for one execution. |
| Record at selected times | Run / Observation | It chooses what one execution returns and exposes. |
| Plot color and line width | Presentation | They do not change the mathematical problem. |
Several numerical methods can solve the same model. Choose a method when you are ready to run it; the equations above stay the same.
Read the result
Section titled “Read the result”The printed field identifiers tell you which unknowns the compiler found. Later, an observation will select values of those fields from a completed run. The cooling rate and initial temperature determine the trajectory; choosing which times to inspect determines the view you take of it.
Deliberate failure: a method inside the model
Section titled “Deliberate failure: a method inside the model”This mutation tries to name a numerical stepping policy as though it were a model quantity:
model decay() { state x: 1; initial { x = 1; } parameter rate: 1 / s = 1; relation flow { derivative(x) + euler_step * rate * x = 0; }}euler_step is undeclared, so compilation must fail. Declaring it merely to
silence the error would still encode a numerical choice in the wrong layer.
The repair is to restore the method-neutral residual and choose stepping only
when constructing a Realization.
When should the model change?
Section titled “When should the model change?”A single temperature is useful when internal temperature differences relax much faster than exchange with the room. If the surface cools long before the core, reducing a solver tolerance cannot recover the missing spatial field. Likewise, a room that warms appreciably must become part of the system rather than remain a fixed reservoir. These are changes in the physical model.
A measured departure from exponential cooling invites several explanations: temperature-dependent properties, a changing environment, measurement delay, or numerical error. Separate them by asking what can be checked independently. For example, compare the computed trajectory to the analytic solution before using a disagreement with a thermometer to question the transfer law.
The MIT notes listed below cover modeling with first-order equations in more depth. The bead and its parameter values are illustrative, not measured data.
Exercises
Section titled “Exercises”- Classify each item as Model, Realization, Run, Observation, or Presentation: a material density, a linear-solver tolerance, an end time, a field sample, and a plot title.
- Rewrite “simulate decay with 100 Euler steps” as one model statement and one realization/run request.
- Add a comment to
decay.eqiexplaining whyratebelongs in the Model but an output interval does not. Confirm that comments do not prevent compilation. - Name one modeling assumption that the source does not encode. Explain what information would be needed before treating decay as a physical prediction.
Exercise guidance
Section titled “Exercise guidance”For exercise 2, state the differential equation and initial value first; put the step size and final time in a second sentence. For exercise 4, ask whether a single temperature represents the actual object. As an extension, replace the fixed room with a second finite heat capacity. Which second state and balance would you need, and what total energy should remain constant in an insulated pair?
References
Section titled “References”- Arthur Mattuck, Haynes Miller, Jeremy Orloff, and John Lewis, Differential Equations, MIT OpenCourseWare 18.03SC (2011), Basic DE’s and separable equations, especially “Modeling by First Order Linear ODE’s,” for the relation between physical assumptions, balance equations, and first-order dynamics.
Back to the series map · Next: Quantities, dimensions, and units · Read the modeling guide