Skip to main content

Unit System

EngCanvas's unit system tracks four fundamental dimensions — Length (L), Mass (M), Time (T), and Force (F) — through every arithmetic operation. This page covers the internals of how dimensional analysis works.

The four dimensions

SymbolDimensionSI base unit
LLengthmeter (m)
MMasskilogram (kg)
TTimesecond (s)
FForcenewton (N)

Every unit in the registry maps to a combination of these four dimensions. For example:

UnitLMTFPhysical meaning
ft1000Length
kip0001Force
psi-2001Force / Length² (pressure)
pcf-3001Force / Length³ (unit weight)
mph10-10Length / Time (velocity)
kg0100Mass
Force vs. mass

EngCanvas treats force and mass as independent dimensions. This differs from the SI convention (where force = mass × acceleration) but matches how structural engineers think. lb is a force (F=1), while lb_m is a mass (M=1).

How conversions work

All arithmetic happens in SI units internally:

  1. Input: your value is converted to SI using the toSI factor
  2. Calculate: arithmetic in SI
  3. Output: result converted back using the fromSI factor
// Example: 10 ft + 36 in
// Step 1: 10 × 0.3048 = 3.048 m, 36 × 0.0254 = 0.9144 m
// Step 2: 3.048 + 0.9144 = 3.9624 m
// Step 3: 3.9624 ÷ 0.3048 = 13.0 ft
// Result: 13 ft

This SI-first approach means you can freely mix unit systems:

total = 1 m + 12 in + 2 ft

Dimension rules for operations

Addition / Subtraction

Both operands must have identical dimensions:

10 ft + 3 in        ✓  (both L=1)
50 kip - 10 kip ✓ (both F=1)
10 ft + 5 kip ✗ (L=1 ≠ F=1)

Multiplication

Dimensions add:

10 kip × 3 ft = 30 kip·ft     // F=1, L=1 → moment
4 ft × 6 ft = 24 ft^2 // L=1 + L=1 → L=2 (area)

Division

Dimensions subtract:

100 kip / 20 in^2 = 5 ksi     // F=1, L=-2 → pressure
24 ft / 2 sec = 12 fps // L=1, T=-1 → velocity

Exponentiation

Dimensions scale:

(4 ft)^2 = 16 ft^2            // L=1 × 2 → L=2
(2 m)^3 = 8 m^3 // L=1 × 3 → L=3

Comparison

Operands should have the same dimensions. The comparison returns a dimensionless boolean:

10 ft > 100 in                 // ✓ both are length → true (10 ft = 120 in)

Compound unit syntax

Combine base units for complex quantities:

SyntaxMeaningDimensions
kip·ftForce × lengthF=1, L=1
lb/ft^3Force / length³F=1, L=-3
kN/m^2Force / length²F=1, L=-2
lb·ft/s^2Force × length / time²F=1, L=1, T=-2

Use · (middle dot) or * for multiplication between units, and / for division.

Unit powers

Attach ^n to any unit:

500 in^4         // moment of inertia (L⁴)
12 ft^2 // area (L²)
27 ft^3 // volume (L³)
3 m^-1 // inverse length
2 ft^0.5 // square root of length (decimal powers supported)

Complete unit registry

All 46 built-in units, grouped by dimension.

Length (L=1)

m, ft, in, mm, cm, km, yd, mi, mil

Force (F=1)

N, kN, MN, lb, lbs, kip

Mass (M=1)

kg, gm, mg, ton, lb_m

Pressure (F=1, L=-2)

Pa, kPa, MPa, GPa, psi, psf, ksi, ksf

Time (T=1)

s, sec, min, hr

Angle (dimensionless)

deg, rad

Temperature (dimensionless, affine)

degK, degC, degF

Temperatures are the one affine family: converting to SI applies an offset as well as a scale, valueSI = value × toSI + offset. So 0 degC is 273.15 degK, not 0 degK.

The offset is applied only at power 1. degC^2 has no meaningful affine interpretation, so it converts multiplicatively like any other unit.

The names are spelled degK/degC/degF rather than K/C/F because every registry key tokenizes as a unit, and a bare K, C, or F would shadow the engineering variable names those letters usually stand for.

Velocity (L=1, T=-1)

mph, fps

Acceleration (L=1, T=-2)

g (standard gravity = 9.80665 m/s²)

Volume (L=3)

L (liter), gal (US gallon), bu (US bushel)

Unit weight (F=1, L=-3)

pcf (lb/ft³), pci (lb/in³), kcf (kip/ft³)

Dimensionless quantities

Some results are dimensionless — their dimension vector is {L:0, M:0, T:0, F:0}:

ratio = fb / Fb                // stress / stress → dimensionless
angle = 45 deg // angles are dimensionless
count = COUNT($A1:$A10) // pure number

Error detection

EngCanvas catches these dimensional errors:

ErrorExampleProblem
Mismatched add/subtract10 ft + 5 kipLength ≠ Force
Unknown unit10 xyzxyz not in registry
Invalid conversionconverting kip to ftForce ≠ Length

Next steps