2. Quantities, dimensions, and units
Three ideas that are easy to conflate
Section titled “Three ideas that are easy to conflate”A quantity is what the model talks about, such as duration or velocity. A dimension records powers of base dimensions, such as time or length per time. A unit supplies a scale for expressing a value, such as seconds or metres per second.
The number 1 alone cannot tell us whether a duration is one second, one hour,
or dimensionless. In Eqiora source, the dimension is part of each declaration
instead of a comment beside it.
Learning outcomes
Section titled “Learning outcomes”After this chapter, you should be able to:
- distinguish a quantity, its dimension, and a chosen unit;
- derive the dimension required for a coefficient in a relation;
- inspect an Eqiora declaration using
1,s, multiplication, and division; - use
eqiora.compileas a compile-time check; and - explain why a dimensionally consistent relation may still be a poor model.
Check the cooling balance in three ways
Section titled “Check the cooling balance in three ways”The bead balance from chapter 1 is . Every term must represent power. With denoting temperature dimension,
| Quantity | Unit | Dimension |
|---|---|---|
| Heat capacity | ||
| Temperature rate | ||
| Conductance | ||
| Decay rate |
First check addition: and both have power dimension. Then check the derived scale: has time dimension. Finally check a numerical conversion: is , because . At , either representation gives . Converting only time and forgetting the rate changes the model.
Temperature differences and physical meaning
Section titled “Temperature differences and physical meaning”A temperature of is . A temperature difference of is a difference of . The offset cancels in subtraction, so the cooling law uses a difference without adding 273.15. This distinction follows the SI treatment of Celsius temperature and intervals in the BIPM brochure.
Equal dimensions do not guarantee equal meaning. Energy and torque both have dimension ; a temperature and a temperature difference both use . The model still has to say what each quantity represents. Similarly, a scalar pressure and a stress tensor can share units while having different value shapes. Units catch one class of mistake; names, shapes, and physical reasoning carry the rest.
Derive the required dimension first
Section titled “Derive the required dimension first”Return to the residual
Let denote the dimension of quantity . Because is dimensionless, . Differentiation with respect to time gives
Terms joined by addition must have the same dimension. Therefore
The coefficient rate must have inverse-time dimension. Its numeric default
and its dimension are separate facts.
Encode the dimension in .eqi
Section titled “Encode the dimension in .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; }}Here 1 in the type position means dimensionless, while 1 / s means inverse
seconds. The same spelling = 1 on the right supplies the default numeric
value; it does not erase the declared dimension.
With the package from Get started, check the saved source:
$ uv run python -c "import eqiora; eqiora.compile(path='decay.eqi')"A zero exit status means the source compiled. Nothing has been solved yet, and the physics has not been checked.
Read the result
Section titled “Read the result”Read a dimensional diagnostic as a clue about the equation: identify the two terms being added and work out their dimensions on paper. After the compiler accepts the repaired source, the ODE chapter turns it into a trajectory.
Deliberate failure: a dimensionless rate
Section titled “Deliberate failure: a dimensionless rate”Change only the parameter declaration:
model invalid_decay() { state x: 1; initial { x = 1; } parameter rate: 1 = 1;
relation flow { derivative(x) + rate * x = 0; }}Now derivative(x) has inverse-time dimension, but rate * x is
dimensionless. They cannot be added in one residual, so eqiora.compile raises
ValidationError with compilation diagnostics. Do not patch it with an
arbitrary conversion factor: derive the coefficient’s dimension from the
relation, then declare rate: 1 / s.
Consistent does not mean correct
Section titled “Consistent does not mean correct”Dimensional checking can reject impossible additions such as time plus a
dimensionless value. It cannot decide whether proportional decay is the right
law, whether rate is constant, whether important fields are missing, or
whether an initial value matches an experiment. Those are modeling and
validation questions.
Nondimensionalization is also more than deleting units. It introduces chosen scales while keeping a route back to dimensional quantities. For cooling, put , , and . Since , the equation becomes . Two beads with different and have the same normalized curve if the same assumptions apply. Their actual times remain different. A numerical scaling that helps a solver is a separate choice from this physical similarity.
Exercises
Section titled “Exercises”- If has length dimension instead of being dimensionless, derive the
dimensions of
derivative(x),rate, andrate * x. - Predict whether changing
state x: 1; initial { x = 1; }tostate x: m; initial { x = 1[m]; }while keepingrate: 1 / spreserves consistency. Explain before checking the source. - Create the deliberate failure above, call
eqiora.compile, and identify the two terms whose dimensions disagree. Restore the inverse-time declaration and check again. - Give an example of two dimensionally consistent equations that express different physical assumptions. What observation could distinguish them?
Exercise guidance
Section titled “Exercise guidance”For exercise 1, changing to gives , while stays . For exercise 4, compare with : dimensions agree, but one decays and the other grows. Extend the unit-conversion example by expressing the cooling time in milliseconds. The product , rather than the numeric value of either factor alone, must remain unchanged.
References
Section titled “References”- Bureau International des Poids et Mesures, The International System of Units (SI), 9th edition (2019, updated 2026), SI Brochure, sections on dimensions, the kelvin, and expressing quantity values. These define the unit and temperature-interval conventions used here.
Previous: Models are not simulations · Back to the series map · Next: Algebraic relations and networks