The quantity calculus #
A quantity is a magnitude together with a dimension: 0.9 g is a magnitude in the
dimension of mass, 0.9 g/mL one in the dimension of density, and 9 is a pure number,
a magnitude in the identity dimension. This file sets up the quantity calculus that
measure-phrase semantics computes in. Dimensions are the group QuantityDimension;
quantities are pairs K × QuantityDimension of a magnitude and a dimension and
multiply and divide componentwise, so that dividing two quantities of one dimension yields a
pure number.
Main definitions #
Quantity,Quantity.pure,Quantity.unit: quantities, pure numbers, unit quantities.DimensionedMeasure.quantity: the value of a measure function as a quantity.
References #
- [de-boer-1995]
- [coppock-2021]
A quantity, a magnitude in K with a dimension. Quantities multiply and divide
componentwise.
Equations
- Degree.Quantity K = (K × Degree.QuantityDimension)
Instances For
The pure number n, a quantity (n, 1) of the identity dimension.
Equations
- Degree.Quantity.pure n = (n, 1)
Instances For
The unit quantity (1, d) of the base dimension d.
Equations
- Degree.Quantity.unit d = (1, Degree.QuantityDimension.of d)
Instances For
a / b = q / r ↔ a = q * (b / r) when the magnitudes of b and r are nonzero.
The value of μ at x as a quantity of μ's dimension.
Equations
- μ.quantity x = (μ.apply x, Degree.QuantityDimension.of μ.dimension)
Instances For
Measuring n units is having the quantity n times the unit.