Tools › Units › Calculators › Calc Sheet › Method

Calc Sheet: Method

Open the Calc Sheet tool

Method: Line Syntax, How Units Are Carried, What It Assumes, Common Mistakes

What the tool does

You type a calculation one line at a time, the way it would be written on paper, and the tool gives it back as a calculation page: a title block, your headings and text, each value with its unit, and each formula three ways (in symbols, with the numbers and their units put in, and the result). Every quantity carries its unit through the arithmetic, so units can be mixed freely and a line that does not make dimensional sense is refused where it stands.

The idea: a number never travels without its unit

On paper a unit slip is easy: a load in kilonewtons is divided by an area in square inches and the answer is read as megapascals. Here every value is stored as a number in SI base units together with its dimensions (how many powers of length, mass, time, temperature and so on it carries). Multiplying adds the powers, dividing subtracts them, and adding or comparing is allowed only when the powers agree. The printed result is that stored value converted to the unit the line asks for.

Left: six typed lines, among them sigma = P / A in MPa. Right: the same lines as printed by the sheet, the formula first in symbols, then as 12.00 kN divided by 0.1963 square inches equals 94.73 MPa, a check marked OK, and the line that adds a force to a length refused in words
Six typed lines and what the sheet prints for them

Line forms

One item per line. Blank lines only space the typing.

You typeIt isPrinted as
# Bolt sheara headinga heading with a rule under it
## Givena subheadinga smaller heading
> Two plates in single shear.a line of texta paragraph; text lines that follow each other are joined, an empty > line starts a new paragraph
P = 24 kip // joint loada definition: a name, a number and its unitP = 24 kip, with the note after // beside it
f_v = V / A_b in ksia formula; in ksi names the unit of the resultthe formula in symbols, then with values and units, then the result
f_v in MPaa conversion of a name already definedthe value in its unit = the value in the new unit
check f_v <= F_va check (<, <=, >, >=)both sides with units, the ratio of the left side to the right, and OK or NOT OK
// ask the suppliera private notenot printed

Names start with a letter or an underscore and continue with letters, digits and underscores. They are case-sensitive: F and f are different. An underscore starts a subscript (two levels at most), and the names of Greek letters print as the letters: sigma_max is σmax, DeltaT is ΔT. A name must be defined on a line above the line that uses it. A name may be defined again; the new value holds from that line down and the summary table shows the last one. The names of the functions and constants, and the words in and check, cannot be names.

Numbers and units. A unit follows a number, with or without a space: 12 kN, 0.5 in^2, 998 kg/m^3, 8 W/(m^2-K), 1.2e5 Pa, 85 %. A compound unit is written without spaces; a hyphen or * joins a product, / divides and ^ raises to a power. After a slash a product must sit in parentheses, W/(m^2-K), because W/m^2-K can be read two ways and is refused. The power in 2 m^2 belongs to the unit (two square meters); (2 m)^2 is four.

Operators and functions. + - * / ^ and parentheses, with the usual order (-2^2 is −4, 2^3^2 is 2⁹). Functions: sqrt, abs, min, max, sin, cos, tan, asin, acos, atan, sinh, cosh, tanh, exp, ln, log (base 10), log2, round, floor, ceil, and if(a < b, x, y), which gives x when the comparison holds and y when it does not (x and y must have the same dimensions). Constants: pi, e and g_0, the standard acceleration of gravity. Multiplication is always written: 2 * a, not 2a.

The word in. Directly after a number it is the inch (4 in). At the end of a formula, followed by a unit, it asks for that unit (delta = P * L / (A * E) in mm). Both can stand on one line: x = 3 in in mm.

Which units are known

Every factor comes from the site's own unit dictionary, the same one behind the unit menus of the other tools. The sheet has no conversion table of its own. A spelling is accepted when it is one of these:

  • a unit of the dictionary, with an SI prefix where one applies: N, kN, Pa, MPa, GPa, m, mm, cm, m^2, mm^4, kg, W, kW, N-m, kN-m, N/m, kg/m^3, L, L/s, J/(kg-K), W/K, rad, rpm; and in, ft, yd, mil, in^2, ft^3, in^4, lb (the pound-force; lbf also), kip, psi, ksi, Msi, psf, lb-in, lb-ft, kip-ft, lb/in, lb/ft, lbm, slug, hp, Btu/h, ft/s, mph, kts, cfm, gpm, deg, °F and °C (temperature differences), K and R;
  • a base unit: m, kg, s, A, K, mol, cd, rad (also ms, mA, kmol);
  • one of a few names built from dictionary units without any number: J (N-m), Hz (1/s), h and min (from the dictionary's kg/h and kg/min), Wh, Btu (Btu/h times h), gal (gpm times min), V (W/A), ohm, gram, mi, knot, degC, degF, degR, each with a prefix where that is usual (kJ, MJ, kHz, kWh, mV);
  • a compound of those: W/(m^2-K), Pa-s, Btu/(h-ft^2-degF), kN/mm.

Anything else is refused by name on its line. Units the dictionary does not hold, such as atm, bar, cal or a day, are entered through ones it does (101325 Pa, 24 h).

Temperatures. K and R are absolute temperatures; °C, °F, degC and degF are temperature differences (a rise of 25 degC is 25 K). The Celsius and Fahrenheit scales themselves have an offset that cannot be carried through a product, so 20 C is refused: enter 293.15 K.

Angles. The radian is kept as a dimension. sin, cos and tan take an angle or a plain number (read as radians); atan, asin and acos return an angle, which prints in radians unless the line ends in deg. A speed in rpm is an angle per time, not a frequency: it cannot be restated in Hz.

How a formula line is worked

For sigma = P / A in MPa with P = 12 kN and A = 0.1963 in²:

  1. Each value is taken in SI base units: P = 12,000 kg·m/s², A = 0.1963 × 0.0254² = 1.2668 × 10⁻⁴ m².
  2. The operation is carried out on the numbers and on the dimensions together: 12,000 / 1.2668 × 10⁻⁴ = 9.473 × 10⁷, and (kg·m/s²) / m² = kg/(m·s²), which is a pressure.
  3. The requested unit is checked against those dimensions (MPa is a pressure, so it is accepted) and the stored value is divided by the size of that unit: 9.473 × 10⁷ / 10⁶ = 94.73 MPa.

The printed lines are σ = P / A, then σ = 12.00 kN / 0.1963 in² = 94.73 MPa. The values shown in the second line are rounded for display; the arithmetic uses the unrounded ones.

The unit of a result. If the line ends with in unit, that unit. Otherwise the sheet looks for a unit of the right kind among the operands of the formula (an area from a diameter in inches prints in in²), then among the units typed earlier on the sheet, and last takes the SI or US customary unit of that kind from the dictionary. If the choice is not the one you want, name the unit.

The display choice. "The units as written" keeps every value in the unit it was typed in. "SI units throughout" and "US customary units throughout" convert the values typed in the other system (the defining line shows both, d = 0.5 in = 12.70 mm) and print the results in that system. A conversion line (sigma in ksi) always prints the unit it names. Where the dictionary has no unit of a kind in the chosen system, for example a film coefficient in US customary units, the unit as written is kept.

What it assumes

  • The formulas are yours. The sheet checks the arithmetic and the dimensions of each line, not whether the formula fits the problem.
  • Lines are evaluated once, from the top down. There is no solving for an unknown and no iteration: a name is used only below the line that defines it.
  • All values are real numbers in double precision. Rounding applies to the display only.
  • lb is the pound-force and lbm the pound-mass, as in the rest of the site. The dictionary's density and flow units lb/ft^3, lb/in^3, lb/s and lb/h are pounds of mass.
  • g alone is the dictionary's unit of acceleration (one standard gravity), not the gram: write gram or kg.

When it misleads

  • A dimensionally correct line can still be wrong. A stress computed with the wrong area, a deflection formula for the wrong support condition or a factor of 2 left out all pass the unit check.
  • Torque and energy have the same dimensions (N-m and J), as do a frequency in Hz and a circular frequency in 1/s. The sheet cannot tell them apart and will add one to the other.
  • Empirical formulas with hidden units (a coefficient that is only right for inches and pounds) are not protected: the constant is taken as a pure number. Give such a constant its real unit, or keep the whole formula in the units it was written for by dividing each quantity by its unit first, as in d / 1 in.
  • Rounded values on the page. Recomputing a line by hand from the four figures shown can differ in the last figure from the printed result, which comes from the unrounded values.
  • A check is only the comparison you wrote. OK means the inequality holds, not that the design is adequate.

Common mistakes

  • Using a name before its line. The sheet reads from the top: define the load above the stress that uses it.
  • A unit without a number. v = d / s does not divide by a second; write d / 1 s, or better, give the time a name.
  • A name that is also a unit. After m = 180 kg the letter m means the mass, and 5 m is refused as a missing operator. Call it m_1 if meters appear below.
  • Pounds of force and pounds of mass. 50 lb/ft^2 is the dictionary's areal density (mass per area). For a pressure write 50 psf or 50 lbf/ft^2.
  • Mass where weight is meant. A 180 kg machine presses on its mounts with 180 kg × g_0, not with 180 kg. The unit check catches this when the result is asked for in newtons.
  • W/m^2-K. Put the denominator in parentheses: W/(m^2-K).
  • Celsius in a product. A temperature difference may be in degC; an absolute temperature in a gas law must be in K.
  • Degrees and radians. sin(30) is the sine of 30 radians. Write sin(30 deg).
  • Percent. 85 % is 0.85; a result in percent is the ratio times 100.

Saving and exporting

Signed in, the box under the form saves the sheet, the title block and the display choices under a name and loads them back. The Export Report box under the results gives the page as a PDF or a Word file.

Related tools

The Unit Calculator Pad is the quick version: a scratch pad that lists each line with its result in several unit systems and knows more everyday units (gallons, atmospheres, acres) from its own table. Formula with Units evaluates one formula from a table of variables and finds dimensionless groups.