Skip to content

3. The algebra of units ​

Units multiply, divide and raise to powers like numbers. FURY applies the rules symbolically: the exponents of the same symbol add up, a symbol whose exponent becomes zero disappears, and the dimensions follow.

f90
speed     = metre / second
area      = metre ** 2
frequency = second ** (-1)

Why the references matter ​

A pressure can be defined by its references or by its symbol only. Both are valid, but they are not equally informative:

f90
pascal        = uom64('kg [mass].m-1 [length-1].s-2 [time-2] (Pa[pressure]) {pascal}')
pascal_symbol = uom64('Pa [pressure] {pascal}')
force             = pascal * metre ** 2
force_from_symbol = pascal_symbol * metre ** 2
$ tutorial_3
speed     : m.s-1 [length.time-1]
area      : m2 [length2]
frequency : s-1 [time-1]
pressure times area, from the references: kg.m.s-2 [mass.length.time-2]
pressure times area, from the symbol    : Pa.m2 [pressure.length2]

From the references, a pressure times an area is kg.m.s-2: FURY sees that the metres cancel and the result is a force. From the bare symbol Pa it can only write Pa.m2, correct but opaque. Define units by their references, with a main alias for the short symbol, and the algebra works for you. The SI system defines all its derived units this way.

A product or a quotient has the references of its operands, never their main alias: N times s is kg.m.s-1, not a newton.

What you learned

Products, quotients and powers of units; cancelling exponents; references against bare symbols. Reference: Units.

Next: 4. What FURY refuses.

Released under GPL v3, BSD 2-Clause, BSD 3-Clause or MIT, at your choice.