Fourmilab Home Page

Specification and Representation of
Physical Units in Computer Systems

by John Walker
September 9th, 1990


Attached is a description of a potential patent application on the system of units used within AutoCAD Release 11. The concept of deriving a universal system of units from fundamental physical constants is not original. I first encountered the idea in an article in Analog in 1967, in which the author suggested a replacement for metric units based on physical constants.

The scope of this disclosure is therefore not the concept of the system of units (which probably isn't patentable in any case), but rather the application of such a system of units within a computer to enable expression of physical quantities in a form not tied to any particular standard-making organisation and thus internationally and culturally neutral.

If this disclosure represents a patentable invention, and Autodesk wishes to pursue obtaining a patent on it, it will be necessary to allocate some individual in the technical group who understands this invention and its implementation to aid in the preparation of the patent application. If the application spells out, as I suspect it will have to, the algorithm used to interpret unit specifications in the associated language, preparing the application will be extremely time-consuming. I have neither the time to devote to such a process, nor any interest in pursuing it myself. If Autodesk chooses to undertake it, I will provide an initial briefing to the people involved and such limited support as I can manage given the time available.


Scientific and engineering computation usually involves numbers that represent physical quantities such as length, mass, electrical current, or temperature. Most existing computer programs operate in terms of a single set of units, such as metric units (metres, kilograms, etc.) or the English system of units (inches, pounds). A mechanism that allows computation to be done independently of the choice of a system of units and enables a computer to detect dimensional errors in computations (such as adding length to mass) is the subject of a separate patent application.

This disclosure involves the means by which a computer user specifies the units in which data are input to such a computer system or program, and the units in which the results of the computation will be displayed. In addition, the internal representation in which the computer stores dimensioned quantities is defined, in terms independent of any particular system of units. The mechanism is composed of the following parts:


A physical quantity might be specified in the language as:

0.022480894 meter kilogram / second^2

This is a quantity of force, actually equivalent to the “pound” in the English system of units.

The database contains definitions that are used to translate this specification in the form:


The translator processes the specification, retrieves the definitions of the units from the database, combines them using the rules of algebra and the means of computing with units described in the previous patent disclosure, and emits a definition of the unit in terms of physical constants in the factor, bias, and unit exponent form described in the previous disclosure.

The Language

Units are specified either as a simple name, or as an expression in terms of existing units.

In any case, you can specify a predefined unit such as “meter” or “kilogram” just by naming it. Many of the common units have standard abbreviations (specified on the definition line following a comma), and you may use the abbreviation if you prefer.

You can multiply units together simply by naming the units to be multiplied separated by spaces. Since the units database defines the dimensionless multiple and submultiple names, this means that if you want a unit of micro-inches that's not defined in the file, you can specify the unit by simply entering “micro inch”. You can also specify numeric constants, so you could have defined micro inches as “1e-6 inch” as well.

You can multiply dimensioned units as well as dimensionless constants. If you want volume reported in acre-feet (used to specify capacity of water reservoirs), just compose the unit as “acre foot”.

You can affix an exponent to any unit by following it with a caret and the constant integer exponent. For example, a board-foot is defined as 144 cubic inches, so you could use that unit of volume by entering “144 inch^3”. Since square and cubic measures are so frequently used, you can define synonym prefixes for exponents. The English language version of a unit definition file declares “square” and “cubic,” so we can also specify board-feet as “144 cubic inch”.

Operator precedence is exponentiation first, multiplication second, and division (see below) last.

You can divide by units or constants by separating the expression into a numerator and denominator delimited by a slash, “/”. Only one slash may appear in an expression and it has the lowest precedence: the numerator and denominator are evaluated, then divided to form the unit. As a simple example of division, you could express mass in troy ounces by specifying “kg/32.150737”. A more complicated definition would be that of a pound of force as “0.022480894 meter kilogram / second^2”.

The Database

The database in the AutoCAD implementation is stored as an ASCII text file. Any representation could be used, in practice, as long as it provides the ability to store the names, numbers, and expressions used to define the units in the database.

Each unit declaration consists of two consecutive lines the in the file. The first line begins with with an asterisk in the first column, and gives the name of the unit and, optionally, an abbreviation set off by a comma. The second line declares the unit's dimensionality and magnitude in terms of the five physical constants. The unit can be defined either directly in terms of the constants (in which case it is termed a fundamental unit declaration), or as an expression in the language, written in terms of other units and ultimately resolvable into fundamental unit declarations. Units declared by an expression are referred to as derived units.

Fundamental unit declarations

All units are defined in a neutral system of measurement derived from five fundamental constants of physics. This system is culture-, species-, and environment-neutral and, stipulating the correctness of the cosmological principle, equally valid and independently derivable throughout the universe.

The fundamental constants which underlie the system are:

c Velocity of light in vacuum
e Electron charge
h Planck's constant
me Electron rest mass
k Boltzmann's constant

A basic unit definition consists of the seven coefficients α–η of the equation:

I = E cα eβ hγ mδ kε ζ + η

where E is the value in the system of measurement being defined (the “external” value), and I (the “internal” value) is the quantity with that dimensionality derived from the product of the powers of fundamental constants specified by α through ε. ζ and η effect the conversion from external to internal units.

For example, let's examine the definition of the SI unit “kilogram”. This is a unit of mass, and our fundamental unit of mass is the mass of the electron, which is 9.109558×10−31 kg. Since only one fundamental constant is needed to define mass, the exponent coefficients are very simple: δ, the exponent for the mass of the electron, is 1 and all the rest are zero. Since we know that zero mass is the same in both system of units, we know that η is zero (it's rarely needed, but permits handling units like degrees Celsius and Fahrenheit where zero is offset from zero in natural units).

I = E cα eβ hγ mδ kε ζ + η
I = E c0 e0 h0 m1 k0 ζ + 0
I = E m1 ζ
1 = 9.109558×10−31 m ζ
ζ = 1/9.109558×10−31
ζ = 1.0977481015×1030

Therefore the coefficients defining the kilogram in terms of fundamental constants are:

α = 0
β = 0
γ = 0
δ = 1
ε = 0
ζ = 1.0977481015×1030
η = 0

The definition of this unit consists of just these coefficients separated by commas on the line following the name of the unit and optional abbreviation:


Now let's consider a more complicated case, the Celsius temperature scale. First we need to determine the exponents of the physical constants which yield a quantity with dimensions of temperature. Boltzmann's constant is 1.38×10−23 J K−1, so clearly we need an exponent of −1 on Boltzmann's constant to get temperature in the numerator. But that leaves us with an unwanted unit of energy in the denominator that we'll need to cancel out. Well, Planck's constant is 6.62×10−34 J sec, so if we use an exponent of 1 on it, we get rid of the Joules, but now we've got time in the numerator! The speed of light has dimensions of length over time, so if we divide our length unit by it, we'll get time. But we don't have a pure length unit either! No problem. The combination h/mc has the dimensions of length (and happens to be the Compton wavelength of the electron, by the way), so we use that to get rid of length. After a little fiddling, then, we discover that the correct exponents to obtain a unit with dimensions of temperature are:

α = 2
β = 0
γ = 0
δ = −1
ε = 1

Substituting these exponents into the general equation, we discover that the natural unit of temperature works out to be 5.930127668×109 °K. Since we know that the size of the degree is the same in both the Celsius and Kelvin scales, it follows that ζ is just the reciprocal of this number, 1.6863043358×10−10. Since zero degrees Celsius is not absolute zero, we'll need a nonzero η to translate the zero point. Knowing that 0 in both the Kelvin and natural scales corresponds to −273.15 Celsius, we compute this as follows:

I = E ζ + η
0 = −273.15 ζ + η
0 = −273.15 × 1.6863043358×10−10 + η
η = 273.15 × 1.6863043358×10−10
η = 4.6061402932×10−8

Consequently, our definition of degrees Celsius is:


Other fundamental units are defined by the same process. Once you know the following identities for the natural units derived from the physical constants, the rest of the process is simple:

c = 2.9979250× 108 M/sec
e = 1.6021917×10−19 Coulomb
h = 6.626196×10−34 J sec
k = 1.380622×10−23 J/°K
m = 9.109558×10−31 kg
Length = h/mc
Mass = m
Time = Length/c
Current = e/Time
Temperature = h/k Time
Length = 2.42631×10−12 M
Mass = 9.10956×10−31 kg
Time = 8.0933×10−21 sec
Current = 19.7965 Ampere
Temperature = 5.93013×109 °K

Derived unit declarations

You can declare units in terms of other units defined in the database. These declarations are called derived units are are written as expressions in the same language used to specify dimensioned quantities. The second line of a derived unit definition declares the unit as an expression in constants and other units as described above. The first character of this line must be an equal sign to identify the definition as an expression as opposed to a fundamental definition.

For additional examples of unit definitions, examine the sample database appended to this document.

;       AutoCAD unit definition file -- ACAD.UNT

;       Basic SI units


;       Derived SI units

=kg 0.001
=meter kilogram / second^2
=newton meter

;       Exponent synonyms


;       Units of time

=100 year
=86400 second
=10 year
=14 day
=3600 second
=1000 year
=60 second
=365.25636 day
=365.24220 day
=604800 second
=365 day

;       Units of length

=meter 1E-10
=meter 149597870000
=meter 36.576
*cable(s)                     ; U.S. cable length
=meter 219.456
=meter 0.000254
=meter 0.01
*chain(s)                     ; Gunther's chain length
=meter 20.1168
=meter 0.4572
=meter 0.1
=meter 10
=meter 1.8288
=meter 0.3048
=meter 201.168
=meter 1E9
=meter 0.1016
=meter 100
=meter 2.54E-2
=meter 1000
=meter 5556
=meter 4828.032
=meter 9.46053E15
*link(s)                      ; Gunther's link length
=meter 0.201168
=meter 1E-6
=meter 2.54E-5
*mile_nautical,inm            ; International Nautical Mile
=meter 1852
=meter 1609.344
=meter 0.001
=meter 1E-9
=meter 0.762
=meter 0.0762
=meter 3.085677E16
=meter 5.0292
=meter 0.0042175176
=meter 0.0003514598
=meter 5.0292
=meter 6.096
=meter 109.728
=meter 0.2286
=0.3048006096 meter
=meter 0.9144

;       Units of area

=4046.85642 meter^2
=100 meter^2
=1.0E-28 meter^2
=1 meter^2
=10000 meter^2
=1011.7141 meter^2
=2589988.096 meter^2
=93239571.456 meter^2

;       Units of volume

*barrel(s),bbl                ; International Petroleum barrel
=0.1589873 meter^3
=144 inch^3
*bushel(s),bu                 ; U.S. dry bushel
=0.03523907 meter^3
=0.01 liter
=3.6245734 meter^3
=1e-6 meter^3
=0.1 meter^3
=10 liter
=10 meter^3
*dram(s)                      ; U.S. fluid dram
=3.6967162 cc
=0.551 liter
=1.101 liter
=34.06775 liter
*gallon(s),gal                ; U.S. fluid gallon
=0.0037854118 meter^3
=118.29412 cc
=100 liter
=0.23848094 meter^3
=0.08182957 meter^3
=1.000028 meter^3
=0.001 meter^3                ; Redefined from 0.001000028m^3 in 1964
=0.001 liter
=6.160979e-5 liter
=2.9573730e-5 meter^3
=8.809521 liter
=0.4731632 liter
=2.272980 liter
=0.31797510 meter^3
=0.9463264 liter
=2.8316847 meter^3
=290.9414 liter
=1 meter^3
=252 gallon

;       Units of mass

=1.66053e-27 kg
=45.359337 kg
=1016.0469088 kg
=0.45359237 kg
=14.5939 kg
=14 pound
=907.18474 kg
=1000 kg

;       Units of frequency


;       Electromagnetic units

=ampere second
=ohm second
=volt second

;       Circular measure


;       Solid measure


;       Dimensionless prefixes

;          Multiples

;          Fractions

;       Reference:  CRC Handbook, 68th edition ('87–'88).

;       Dimensions of common units in terms of fundamental constants

;       Measurement             C   E   H   K   M          Notes

;       Length                 -1       1      -1
;       Mass                                    1
;       Time                   -2       1      -1          time / C
;       Current                 2   1  -1       1          E / time
;       Temperature             2           -1  1          H / (K time)
;       Luminous intensity      4      -1       2          Units of power over
;                                                          solid angle, a
;                                                          dimensionless value.