T.O.C. Index Bug Report ASCEND IV Home

measures Units library

Chapter 21 Units library


21.1 Units

This chapter defines the dimensions and units and all the attendant conversion factors. Note that all conversions are simply multiplicative. This information is from the file models/measures.a4l in the ASCEND source code.

Note that units can be easily defined to suit the needs of local users. We are always on the lookout for new and interesting units, so if you have some send them in. From measures.a4l we have:

21.2 The basic units in an extended SI MKS system

These units (kilogram, mole, et c.) are associated with the dimensionality listed here (M, Q, et c.) by the ASCEND IV C code. All other units are derived from these by multiplication factors. Use of units other than these requires loading unit definitions, either from measures.a4l or from another ASCEND file containing a UNITS declaration. The system rejects loudly any model or variable definition using undefined units.

define kilogram   M; (* internal mass unit SI *)
define mole       Q; (* internal quantity unit SI *)
define second     T;   (* internal time unit SI *)
define meter      L;   (* internal length unit SI *)
define Kelvin     TMP; (* internal temperature unit SI *)
define currency   C;   (* internal currency unit *)
define ampere     E;   (* internal electric current unit SI suggested *)
define candela    LUM; (* internal luminous intensity unit SI *)
define radian     P;   (* internal plane angle unit SI suggested *)
define steradian  S;   (* internal solid angle unit SI suggested *)

21.3 Units defined in measures.a4l, the default system units library of atoms.a4l.

distance
pc = 3.08374e+16*meter;

parsec = pc;

kpc = 1000*pc;

Mpc = 1e6*pc;

km = meter*1000;

m = meter;

dm = meter/10;

cm = meter/100;

mm = meter/1000;

um = meter/1000000;

nm = 1.e-9*meter;

kilometer = km;

centimeter = cm;

millimeter = mm;

micron=um;

nanometer = nm;

angstrom = m/1e10;

fermi = m/1e15;

mi = 1609.344*meter;

yd = 0.914412*meter;

ft = 0.304804*meter;

inch = 0.0254*meter;

mile = mi;

yard = yd;

feet = ft;

foot = ft;

in = inch;

mass
metton = kilogram *1000;

mton = kilogram *1000;

kg = kilogram;

g = kilogram/1000;

gram = g;

mg = g/1000;

milligram = mg;

ug= kilogram*1e-9;

microgram = ug;

ng=kilogram*1e-12;

nanogram=ng;

pg=kilogram*1e-15;

picogram=pg;

amu = 1.661e-27*kilogram;

lbm = 4.535924e-1*kilogram;

ton = lbm*2000;

oz = 0.028349525*kilogram;

slug = 14.5939*kilogram;

time
yr = 31557600*second;

wk = 604800*second;

dy = 86400*second;

hr = 3600*second;

min = 60*second;

sec = second;

s = second;

ms = second/1000;

us = second/1e6;

ns = second/1e9;

ps = second/1e12;

year = yr;

week = wk;

day = dy;

hour = hr;

minute = min;

millisecond = ms;

microsecond = us;

nanosecond = ns;

picosecond = ps;

molecular quantities
kg_mole=1000*mole;

g_mole = mole;

gm_mole = mole;

kmol = 1000*mole;

mol = mole;

mmol = mole/1000;

millimole=mmol;

umol = mole/1e6;

micromole=umol;

lb_mole = 4.535924e+2*mole;

temperature
K = Kelvin;

R = 5*Kelvin/9;

Rankine = R;

money
dollar = currency;

US = currency;

USdollar=currency;

CR = currency;

credits=currency;

reciprocal time (frequency)
rev = 1.0;

cycle = rev;

rpm = rev/minute;

rps = rev/second;

hertz = cycle/second;

Hz = hertz;

area
ha = meter^2*10000;

hectare=ha;

acre= meter^2*4046.856;

volume
l = meter^3/1000;

liter = l;

ml = liter/1000;

ul = liter/1e6;

milliliter = ml;

microliter = ul;

hogshead=2.384809e-1*meter^3;

cuft = 0.02831698*meter^3;

impgal = 4.52837e-3*meter^3;

gal = 3.785412e-3*meter^3;

barrel = 42.0*gal;

gallon = gal;

quart = gal/4;

pint = gal/8;

cup = gal/16;

floz = gal/128;

force
N = kilogram*meter/second^2;

newton = N;

dyne = N*1.0e-5;

pn=N*1e-9;

picoNewton=pn;

lbf = N*4.448221;

pressure
Pa = kilogram/meter/second^2;

MPa = 1.0e+6*Pa;

bar =1.0e+5*Pa;

kPa = 1000*Pa;

pascal = Pa;

atm = Pa*101325.0;

mmHg = 133.322*Pa;

torr = 133.322*Pa;

psia = 6894.733*Pa;

psi = psia;

ftH2O = 2989*Pa;

energy
J = kilogram*meter^2/second^2;

joule = J;

MJ = J * 1000000;

kJ = J * 1000;

mJ=J*1.0e-3;

uJ=J*1.0e-6;

nJ=J*1.0e-9;

milliJoule=mJ;

microJoule=uJ;

nanoJoule=nJ;

erg = J*1.0e-7;

BTU = 1055.056*J;

pCu = BTU * 1.8;

cal = J*4.18393;

calorie = cal;

kcal=1000*calorie;

Cal=1000*calorie;

power
W = J/second;

EW = 1.0e+18*W;

PW = 1.0e+15*W;

TW = 1.0e+12*W;

GW = 1.0e+9*W;

MW = 1.0e+6*W;

kW = 1000*W;

mW = W/1000;

uW = W/1000000;

nW = W/1e9;

pW = W/1e12;

fW = W/1e15;

aW = W/1e18;

terawatt = TW;

gigawatt = GW;

megawatt = MW;

kilowatt = kW;

watt = W;

milliwatt = mW;

microwatt = uW;

nanowatt = nW;

picowatt = pW;

femtowatt = fW;

attowatt = aW;

hp= 7.456998e+2*W;

absolute viscosity
poise = Pa*s;

cP = poise/100;

electric charge
coulomb=ampere*second;

C = coulomb;

coul = coulomb;

mC = 0.001*C;

uC = 1e-6*C;

nC = 1e-9*C;

pC = 1e-12*C;

miscellaneous electro-magnetic fun
V = kilogram*meter^2/second^3/ampere;

F = ampere^2*second^4/kilogram/meter^2;

ohm = kilogram*meter^2/second^3/ampere^2;

mho = ampere^2*second^3/kilogram/meter^2;

S = mho;

siemens = S;

A=ampere;

amp = ampere;

volt = V;

farad= F;

mA= A/1000;

uA= A/1000000;

kV= 1000*V;

MV= 1e6*V;

mV= V/1000;

mF = 0.001*F;

uF = 1e-6*F;

nF = 1e-9*F;

pF = 1e-12*F;

kohm = 1000*ohm;

Mohm = 1e6*ohm;

kS = 1000*S;

mS = 0.001*S;

uS = 1e-6*S;

Wb = V*second;

weber = Wb;

tesla = Wb/m^2;

gauss = 1e-4*tesla;

H = Wb/A;

henry = H;

mH = 0.001*H;

uH = 1e-6*H;

numeric constants of some interest
To set a variable or constant to these, the code is (in the declarations):

ATOM unspecified_unitwise REFINES real; 
END unspecified_unitwise;
MODEL gizmo;
	x IS_A unspecified_unitwise;
	(* if some other atom type is more appropriate, by all
	*	means, use it.
	*)
	x := 1 {PI}; 
	...
END gizmo;
molecule = 1.0;
PI=3.141592653589793;                  # Circumference/Diameter ratio
EULER_C = 0.57721566490153286;         # euler gamma
GOLDEN_C = 1.618033988749894;          # golden ratio
HBAR = 1.055e-34*J*second;             # Reduced Planck's constant
PLANCK_C = 2*PI*HBAR;                  # Planck's constant
LIGHT_C = 2.99793e8 * meter/second;    # Speed of light in vacuum
MU0 = 4e-7*PI*kg*m/(C*C);              # Permeability of free space
EPSILON0 = 1/LIGHT_C/LIGHT_C/MU0;      # Permittivity of free space
BOLTZMAN_C = 1.3805e-23 * J/K;         # Boltzman's constant
AVOGADRO_C = 6.023e23 *molecule/mole;  # Avogadro's number of molecules
GRAVITY_C = 6.673e-11 * N*m*m/(kg*kg); # Newtons gravitational constant
GAS_C = BOLTZMAN_C*AVOGADRO_C;         # Gas constant
INFINITY=1.0e38;                       # darn big number;
eCHARGE = 1.602e-19*C;                 # Charge of an electron
EARTH_G = 9.80665 * m/(s*s);           # Earth's gravitational field, somewhere
eMASS = 9.1095e-31*kilogram;           # Electron rest mass, I suppose
pMASS = 1.67265e-27*kilogram;          # Proton mass

constant based conversions
eV = eCHARGE * V;

keV = 1000*eV;

MeV = 1e6*eV;

GeV = 1e9*eV;

TeV = 1e12*eV;

PeV = 1e15*eV;

EeV = 1e18*eV;

lyr = LIGHT_C * yr; # Light-year

oersted = gauss/MU0;

subtly dimensionless measures
rad = radian;

srad = steradian;

deg = radian*1.74532925199433e-2;

degrees = deg;

grad = 0.9*deg;

arcmin = degrees/60.0;

arcsec = arcmin/60.0;

light quantities
cd = candela;

lm = candela*steradian;

lumen = lm;

lx = lm/meter^2;

lux= lx;

miscellaneous rates
gpm = gallon/minute;

time variant conversions
MINIMUMWAGE = 4.75*US/hr;

SPEEDLIMIT = 65*mi/hr;

Conversions we'd like to see, but probably won't:

milliHelen = beauty/ship;


Last Modified: 02:31pm EDT, September 30, 1997
9/26/97 Release 0.8 authors T.O.C. Index Bug Report ASCEND IV Home