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 turns per second for cyclic frequency. Results display in the declared unit.
| Unit | Dimension | Type |
|---|---|---|
mm, m | Length | length |
kg | Mass | mass |
N, kN | Force | force |
Nm, Nmm | Torque | torque |
MPa | Stress | stress |
kW | Power | power |
rpm, Hz | Cyclic frequency | speed |
h, s | Time | time |
deg, rad | Angle (dimensionless) | angle |
mm3 | Volume or section modulus | |
mps | Linear speed | |
kgpm | Linear density | |
- | Ratio | - |
Dimension rules
+,-,==and the relations need equal dimensions.*and/add and subtract the exponents.^ INTmultiplies them.sqrtandcbrtneed exponents divisible by 2 and 3.x to Uconverts to a unit of the same dimension.- A
let,inorouttype is checked against its expression:
let d: length = cbrt(16 * T / (pi * tau)) to mmInteger values, such as a tooth count, use the type -.
Expressions
| Form | Example |
|---|---|
| Arithmetic | a + b, a * b, a / b, -a, a ^ 2 |
| Parentheses | (a + b) / 2 |
| Constant | pi |
| Call | sqrt(x) |
| Path | shaft2.s1.d |
| Table read | T1."Bảng 10.5"["C45"].tau |
| Conversion | d 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:
| Series | Standard |
|---|---|
standards.d | ISO 15 rolling-bearing bores |
standards.m | ISO 54 gear modules |
standards.r10 | ISO 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.