Tools › Units › Calculators › Unit Calculator Pad › Method

Unit Calculator Pad: Method

Open the Unit Calculator Pad tool

Unit Calculator Pad

What the tool does

The pad is a scratch sheet for calculations that carry units. Each line is a small statement, later lines may use the names defined on earlier ones, and every quantity is held as a number in the SI base units together with its exponent vector over the metre, kilogram, second, ampere, kelvin, mole and candela (with the radian kept as an eighth entry, as the site's unit engine does). Because the vector travels with the number, the pad can refuse an operation that has no meaning (a length added to a time, the sine of a force, a force raised to a power that is itself a quantity) and can name the result when it is finished: kg·m·s⁻² is a newton, kg·m⁻¹·s⁻² a pascal, kg·m²·s⁻³ a watt. The result sheet gives, for every line, the natural derived unit with an SI prefix, the unit the line asks for, the US customary equivalent, the base-unit value and the dimension vector; a variables table closes the sheet; the unit algebra of each operation can be listed step by step; and the sheet can be copied as text. The conversion factors are those of the site's dictionary and of NIST Special Publication 811 (2008), Appendix B.

Line forms

Definition: name = expression, optionally followed by a conversion request: sigma = F / A in MPa. The name starts with a letter or underscore and continues with letters, digits and underscores; names are case-sensitive (F and f are different, as the units m and M would be). A name may be redefined; the later value holds from its line on. The names of the functions, the constants (pi, e, g_0) and the keywords in, to, show, steps cannot be variables. A name that also spells a unit (A, h, m, t, L …) is accepted; from its line on the name means the variable, so a number directly followed by it is refused as a missing operator (write 3 * m) and the unit cannot be used while the name is defined.

Conversion request: expression in unit, expression to unit or expression -> unit: sigma in MPa, 60 mi/h in ft/s, h -> ft. The word in is read as the request when something follows it on the line; directly after a number, as in 4 in or 0.5 in^2, it is the inch. The requested unit must have the dimensions of the expression; otherwise the sheet says what each of the two is.

Bare expression: anything else, sqrt(4 m^2) or (2 m/s) / (4 m), evaluated and shown without being named.

Comment: everything after # (or //) is a comment, kept on the sheet beside its line; a line that is only a comment is shown as a heading. The line show steps turns the step listing on, as the checkbox does.

Expressions

Operators + − * / ^ with the usual precedence, parentheses, and the unary minus. The multiplication sign, the middle dot and the Unicode minus are accepted. Unit literals: a number followed by a unit spelling is a quantity, 12 kN, 0.5 in^2, 2 m/s, 9.81 m/s^2, 1000 kg/m^3, 250 gal/min; the spelling runs as far as it is joined without spaces by /, *, - and ^, so 3 ft + 4 in is two quantities and 2 m/s * 3 is a speed times three. A unit spelling alone, ft, counts as one of it, so 5 * ft is also five feet and F / (2.5 lbf) a ratio. A percent sign after a number divides by 100. Numbers may be written 1.5e-3.

Functions: sqrt (halves the exponent vector), abs, min and max (arguments of equal dimensions), sin, cos and tan of an angle (deg or rad) or of a pure number, asin, acos and atan (results in radians, shown also in degrees), sinh, cosh, tanh, exp, ln (natural), log and log10 (common), log2, floor, ceil and round (pure numbers). The arguments of the exponential, logarithmic and hyperbolic functions must be pure numbers: ex = 1 + x + x²/2 + … adds powers of x, which is admissible only when x has no dimension. Powers: the exponent must be a pure number; it multiplies the exponent vector, so (8 m^3)^(1/3) is 2 m and (3 kN)^2 / (2 in^2) has the dimensions of a squared stress. A negative quantity to a fractional power is refused. Constants: pi, e, and g_0 = 9.806 65 m/s², the standard acceleration of gravity, which carries its unit.

How the units move

Multiplication adds the exponent vectors, division subtracts them, a power multiplies them, a square root halves them; a sum or difference requires equal vectors and keeps them. A pure number and an angle may be added (the radian is dimensionless in the SI). Every unit literal is first reduced to base units with its factor, 3 ft = 0.9144 m, so a sum of feet and inches needs no further conversion. With "Show steps" on, the sheet lists these reductions and every operation with the units of its operands, which is the way a textbook writes the dimensional check beside the arithmetic.

The result's vector is matched against the dictionary for a derived name. Where the dictionary's first name of a type is not coherent with the base units (it lists rpm before rad/s), the pad takes the coherent spelling. A name with alternatives (N-m, also J) is shown with them. A vector with no name is printed in base units. The radian is kept as a dimension: an angular velocity in rad/s times a radius gives m·rad/s, which the pad will not call a speed; divide by 1 rad to read it as one, and the sheet says so when a request differs from the result only by the radian.

Spellings

The dictionary spellings of the Formula with Units tool are all accepted (its explanation page lists them by type); any SI spelling takes a prefix (kN, MPa, GPa, mm, μm, kJ, kWh, mbar, MeV) and spellings combine with *, / and ^ and parentheses, with a hyphen or a middle dot as a product (N-m, lb-ft, ft-lbf, kg/(m*s^2), lbf/in^2). The pad adds the spellings in the table below, each defined by its SP 811 Appendix B value. Note the conventions the dictionary imposes: lb is the pound-force (lbf is the same; lbm the pound-mass); g is the standard acceleration of gravity, 9.806 65 m/s², so masses in grams are written gram, mg or μg; ton is the ton of refrigeration (12,000 Btu/h), the short ton is tn and the tonne t; C and F alone are refused (scales with an offset), while °C, degC, °F and degF are temperature differences and K and R absolute temperatures; the litre L is 0.001 m³ (the pad corrects a dictionary entry that reads 0.1).

spellingdefinitionSP 811 Appendix B value
L, liter, litre (mL, dL …)0.001 m³1.0 E−03 m³, exact
gal, gallon; qt; pt; floz231 in³; gal/4; gal/8; gal/1283.785 412 E−03 m³; 9.463 529 E−04; 4.731 765 E−04; 2.957 353 E−05 m³
mi, mile5,280 ft1.609 344 E+03 m, exact
kn, knot1,852 m / 3,600 s5.144 444 E−01 m/s
atm101,325 Pa1.013 25 E+05 Pa, exact
bar (mbar, kbar)100,000 Pa1.0 E+05 Pa, exact
torr; mmHg; inHg; mmH2O; psf101,325/760 Pa; 133.3224 Pa; 3,386.389 Pa; 9.806 65 Pa; lbf/ft²1.333 224 E+02; 1.333 224 E+02; 3.386 389 E+03; 9.806 65 E+00; 4.788 026 E+01 Pa
Wh (kWh, MWh)3,600 Jkilowatt hour 3.6 E+06 J, exact
eV (keV, MeV)1.602 176 634 × 10⁻¹⁹ J1.602 176 E−19 J (exact since the 2019 SI)
oz; tn; t, tonne; gram; mg; μglbm/16; 2,000 lbm; 1,000 kg; 0.001 kg; 10⁻⁶ kg; 10⁻⁹ kg2.834 952 E−02 kg; 9.071 847 E+02 kg; 1.0 E+03 kg; exact
acre; ha43,560 ft²; 10,000 m²4.046 873 E+03 m² on the U.S. survey foot (the pad's international-foot acre is 4.046 856 E+03 m²); 1.0 E+04 m²
yr, year; wk, week; days; hours; minutes; sec365 d; 7 d; 86,400 s; 3,600 s; 60 s; 1 s3.1536 E+07 s; 6.048 E+05 s; 8.64 E+04 s; 3.6 E+03 s; 6.0 E+01 s, exact
degF, degR; degC5/9 K; 1 K (temperature differences)5.555 556 E−01 K; 1 K
percent, pct, %0.01exact
cc; cfs; fps; kph; Nm (kNm); rps; dyn; ergcm³; ft³/s; ft/s; km/h; N·m; rev/s; 10⁻⁵ N; 10⁻⁷ J1.0 E−06 m³; 2.831 685 E−02 m³/s; 3.048 E−01 m/s; 2.777 778 E−01 m/s; 1 J; 6.283 185 rad/s; exact; exact

Reading the sheet

The result column is the natural derived unit with a prefix (37.200 MPa, 489.50 kN-m = 489.50 kJ); the requested column holds the value in the unit the line asked for, in bold, or the reason the request cannot be met; US customary is the dictionary's unit of the result's kind chosen by magnitude (psi, ksi, lb-ft, ft/s, cfm …), composed from ft, lbm, s, R and deg when the kind has none; SI base units is the number the arithmetic actually ran on; dimensions is the vector in M, L, T, Θ, I, N, J. A line in red failed, and every later line that uses the name it was meant to define is marked as depending on it; the other lines are unaffected. The variables table repeats the last value of every defined name. The text box below the tables holds the same sheet as plain text.

Worked pad

The default pad: a tie rod carrying 12 kN over 0.5 in² is stressed to 12,000 N / (0.5 × 0.0254² m²) = 37.200 MPa = 5.3954 ksi; 250 US gallons per minute through a 2-inch pipe is 0.015 773 m³/s over π(0.0508 m)²/4 = 7.7819 m/s = 25.531 ft/s (the handbook rule v = 0.4085 Q/d² in gpm and inches gives the same 25.53 ft/s); a 3,000-lbm car at 60 mi/h (26.8224 m/s) has ½ m v² = 489.50 kJ = 463.96 Btu = 361,036 ft·lbf (½ × 93.24 slug × 88² ft²/s²); one standard atmosphere, 14.696 psi, is a head of 101,325 Pa / (1,000 kg/m³ × 9.806 65 m/s²) = 10.332 m = 33.899 ft of water; 3 ft + 4 in = 1.016 m, which a body at 2 m/s covers in 0.508 s; and 60 mi/h = 88 ft/s exactly. Every value is the SP 811 one and is checked by the tool's test script against an independent pint computation.

Rounding

The sheet shows the chosen number of significant figures (4 to 8); the arithmetic is carried in double precision and is not rounded between lines. SP 811 Section B.7 recommends that a converted value keep the precision of the original, no more (a length known to 36 ft is 11 m, not 10.9728 m); choose the digits accordingly when copying a sheet into a report.

Limits

No comparison or logical operators, no implicit multiplication (write 2 * L), no vectors or complex numbers, no temperatures on an offset scale (convert a Fahrenheit reading to kelvin by hand or work with differences), no currency. A derived name is given only when the result's exponent vector equals a dictionary composition exactly, so unusual combinations stay in base units. The pad holds up to 200 lines.