Skip to content
Get started

2. Quantities, dimensions, and units

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.

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.compile as a compile-time check; and
  • explain why a dimensionally consistent relation may still be a poor model.

The bead balance from chapter 1 is CT˙+G(T−T∞)=0C\dot T+G(T-T_\infty)=0. Every term must represent power. With Θ\Theta denoting temperature dimension,

Quantity Unit Dimension
Heat capacity CC J/K\mathrm{J/K} ML2T−2Θ−1ML^2T^{-2}\Theta^{-1}
Temperature rate T˙\dot T K/s\mathrm{K/s} ΘT−1\Theta T^{-1}
Conductance GG W/K\mathrm{W/K} ML2T−3Θ−1ML^2T^{-3}\Theta^{-1}
Decay rate G/CG/C s−1\mathrm{s}^{-1} T−1T^{-1}

First check addition: CT˙C\dot T and G(T−T∞)G(T-T_\infty) both have power dimension. Then check the derived scale: C/GC/G has time dimension. Finally check a numerical conversion: G/C=0.01 s−1G/C=0.01\,\mathrm{s}^{-1} is 0.6 min−10.6\,\mathrm{min}^{-1}, because 0.01×60=0.60.01\times60=0.6. At t=100 s=5/3 mint=100\,\mathrm s=5/3\,\mathrm{min}, either representation gives kt=1kt=1. 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 20 ∘C20\,{}^\circ\mathrm C is 293.15 K293.15\,\mathrm K. A temperature difference of 20 ∘C20\,{}^\circ\mathrm C is a difference of 20 K20\,\mathrm K. 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 ML2T−2ML^2T^{-2}; a temperature and a temperature difference both use Θ\Theta. 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.

Return to the residual

dxdt+kx=0.\frac{\mathrm{d}x}{\mathrm{d}t} + kx = 0.

Let [q][q] denote the dimension of quantity qq. Because xx is dimensionless, [x]=1[x]=1. Differentiation with respect to time gives

[dxdt]=1T.\left[\frac{\mathrm{d}x}{\mathrm{d}t}\right] = \frac{1}{T}.

Terms joined by addition must have the same dimension. Therefore

[kx]=[k][x]=[k]=1T.[kx]=[k][x]=[k]=\frac{1}{T}.

The coefficient rate must have inverse-time dimension. Its numeric default and its dimension are separate facts.

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;
}
}

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:

Terminal windowconsole
$ 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 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.

Change only the parameter declaration:

eqiora
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.

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 τ=C/G\tau=C/G, t^=t/τ\hat t=t/\tau, and x=(T−T∞)/(T0−T∞)x=(T-T_\infty)/(T_0-T_\infty). Since dx/dt=(1/τ)dx/dt^\mathrm{d}x/\mathrm{d}t=(1/\tau)\mathrm{d}x/\mathrm{d}\hat t, the equation becomes dx/dt^+x=0\mathrm{d}x/\mathrm{d}\hat t+x=0. Two beads with different CC and GG 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.

  1. If xx has length dimension instead of being dimensionless, derive the dimensions of derivative(x), rate, and rate * x.
  2. Predict whether changing state x: 1; initial { x = 1; } to state x: m; initial { x = 1[m]; } while keeping rate: 1 / s preserves consistency. Explain before checking the source.
  3. Create the deliberate failure above, call eqiora.compile, and identify the two terms whose dimensions disagree. Restore the inverse-time declaration and check again.
  4. Give an example of two dimensionally consistent equations that express different physical assumptions. What observation could distinguish them?

For exercise 1, changing [x][x] to LL gives [x˙]=L/T[\dot x]=L/T, while [k][k] stays 1/T1/T. For exercise 4, compare x˙+kx=0\dot x+kx=0 with x˙−kx=0\dot x-kx=0: dimensions agree, but one decays and the other grows. Extend the unit-conversion example by expressing the cooling time in milliseconds. The product ktkt, rather than the numeric value of either factor alone, must remain unchanged.

  • 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