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 describes its physical kind, 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. Eqiora source therefore makes dimension-bearing declarations part of the model rather than leaving them as comments.

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

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.

eqiora
model decay {
state x: 1;
initial { x = 1; }
parameter rate: 1 / s = 1;
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 current installed release, check the saved source:

Terminal windowconsole
$ eqiora check decay.eqi

A zero exit status means the current compiler accepted the source. The command does not resolve a numerical method, execute a trajectory, or validate a physical interpretation.

This chapter observes compiler acceptance and rejection only. It produces no time series or physical measurement. A later numerical observation would still need an explicit Realization, Run, and comparison appropriate to its claim.

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 check exits nonzero and reports compilation diagnostics. The intended repair is not a conversion factor chosen at random: derive the coefficient 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 characteristic scales and new dimensionless variables while preserving the relationship to the original quantities. Chapter 9 will develop that process; this chapter only establishes the dimensional bookkeeping it needs.

  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, run eqiora check, 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?

Previous: Models are not simulations · Back to the series map · Look up the exact CLI interface