Skip to content
Archee Docs

Units and expressions

The unit table, dimension checks, expression syntax, the standard functions and tolerance classes.

Units

A quantity is a number with an optional unit, such as 7.5 kW or 20000 h. A number without a unit is dimensionless. Arc uses metres, kilograms and seconds for arithmetic, radians for angles, and radians per second for angular speed. Divide angular speed by 1 turn to get cycles per second. Results display in the declared unit.

UnitDimensionType
mm, mLengthlength
kgMassmass
N, kNForceforce
Nm, NmmTorquetorque
JEnergyenergy
MPaStressstress
kWPowerpower
rpmAngular speedspeed
HzFrequency[Hz]
h, sTimetime
deg, rad, turnAngleangle
mm3Volume or section modulus
mpsLinear speed
kgpmLinear density
-Ratio-

Dimension rules

  • +, -, == and the relations require matching dimensions and kinds. Torque and energy have distinct kinds.
  • * and / add and subtract the exponents. ^ INT multiplies them.
  • sqrt and cbrt divide the exponents by 2 and 3.
  • x to U converts to a unit of the same dimension.
  • A let, in or out type is checked against its expression:
let d: length = cbrt(16 * T / (pi * tau)) to mm
let ze: [sqrtMPa] = sqrt(400 MPa)
let k: [MPasqrtm] = 3 MPa * sqrt(4 m)

Integer values, such as a tooth count, use the type -.

Expressions

FormExample
Arithmetica + b, a * b, a / b, -a, a ^ 2
Parentheses(a + b) / 2
Constantpi
Callsqrt(x)
Pathshaft2.s1.d
Table readT1."Table 10.5"["C45"].tau
Conversiond to mm
Relation<=, <, >=, >, ==

Functions

The standard functions are sqrt cbrt hypot abs min max ceil floor round sin cos tan pow inverse_involute up down near interp. hypot(x, y) returns the magnitude of two quantities with the same dimension, and pow(x, y) calculates a dimensionless power. inverse_involute(x) returns the angle in radians whose tangent minus the angle equals x.

up(x, S) rounds up to the next member of a standard series. down and near round down and to the nearest. The series live in the library archee.standards:

SeriesStandard
standards.dISO 15 rolling-bearing bores
standards.mISO 54 gear modules
standards.r10ISO 3 preferred numbers R10
use standards = lib archee.standards
let d1: length = up(d_min, standards.d)

Tolerance classes

A class after a length makes it a fit: 40 k6 is a nominal length of 40 mm with class k6. H7 alone is a tolerance class. A port field such as d = d1 k6 carries both. A fit works wherever a length does, with its nominal.

fit.upper(x) and fit.lower(x) return the signed deviations from the ISO 286 table.

Assumed values

A literal with no citation is allowed. The compiler reports it as assumed (code A01, information), so you see which values rest on your own choice.