"Fossies" - the Fresh Open Source Software Archive

Member "units-2.18/definitions.units" (16 Oct 2018, 284471 Bytes) of package /linux/misc/units-2.18.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "definitions.units": 2.17_vs_2.18.

    1 #
    2 # This file is the units database for use with GNU units, a units conversion
    3 # program by Adrian Mariano adrianm@gnu.org
    4 #
    5 # October 2018 Version 2.44
    6 #
    7 # Copyright (C) 1996-2002, 2004-2018
    8 # Free Software Foundation, Inc
    9 #
   10 # This program is free software; you can redistribute it and/or modify
   11 # it under the terms of the GNU General Public License as published by
   12 # the Free Software Foundation; either version 3 of the License, or
   13 # (at your option) any later version.
   14 #
   15 # This program is distributed in the hope that it will be useful,
   16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
   17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   18 # GNU General Public License for more details.
   19 #
   20 # You should have received a copy of the GNU General Public License
   21 # along with this program; if not, write to the Free Software
   22 # Foundation, Inc., 51 Franklin Street, Fifth Floor,
   23 # Boston, MA  02110-1301  USA
   24 #
   25 ############################################################################
   26 #
   27 # Improvements and corrections are welcome.
   28 #
   29 # Fundamental constants in this file are the 2014 CODATA recommended values.
   30 #
   31 # Most units data was drawn from
   32 #            1. NIST Special Publication 811, Guide for the
   33 #                 Use of the International System of Units (SI).
   34 #                 Barry N. Taylor. 1995
   35 #            2. CRC Handbook of Chemistry and Physics 70th edition
   36 #            3. Oxford English Dictionary
   37 #            4. Websters New Universal Unabridged Dictionary
   38 #            5. Units of Measure by Stephen Dresner
   39 #            6. A Dictionary of English Weights and Measures by Ronald Zupko
   40 #            7. British Weights and Measures by Ronald Zupko
   41 #            8. Realm of Measure by Isaac Asimov
   42 #            9. United States standards of weights and measures, their
   43 #                   creation and creators by Arthur H. Frazier.
   44 #           10. French weights and measures before the Revolution: a
   45 #                   dictionary of provincial and local units by Ronald Zupko
   46 #           11. Weights and Measures: their ancient origins and their
   47 #                   development in Great Britain up to AD 1855 by FG Skinner
   48 #           12. The World of Measurements by H. Arthur Klein
   49 #           13. For Good Measure by William Johnstone
   50 #           14. NTC's Encyclopedia of International Weights and Measures
   51 #                   by William Johnstone
   52 #           15. Sizes by John Lord
   53 #           16. Sizesaurus by Stephen Strauss
   54 #           17. CODATA Recommended Values of Physical Constants available at
   55 #                   http://physics.nist.gov/cuu/Constants/index.html
   56 #           18. How Many?  A Dictionary of Units of Measurement.  Available at
   57 #                   http://www.unc.edu/~rowlett/units/index.html
   58 #           19. Numericana.  http://www.numericana.com
   59 #           20. UK history of measurement
   60 #                   http://www.ukmetrication.com/history.htm
   61 #           21. NIST Handbook 44, Specifications, Tolerances, and
   62 #                 Other Technical Requirements for Weighing and Measuring
   63 #                 Devices. 2011
   64 #           22. NIST Special Publication 447, Weights and Measures Standards
   65 #                 of the the United States: a brief history. Lewis V. Judson.
   66 #                 1963; rev. 1976
   67 #           23. CRC Handbook of Chemistry and Physics, 96th edition
   68 #           24. Dictionary of Scientific Units, 6th ed.  H.G.  Jerrard and D.B.
   69 #                 McNeill. 1992
   70 #
   71 # Thanks to Jeff Conrad for assistance in ferreting out unit definitions.
   72 #
   73 ###########################################################################
   74 #
   75 # If units you use are missing or defined incorrectly, please contact me.
   76 # If your country's local units are missing and you are willing to supply
   77 # them, please send me a list.
   78 #
   79 ###########################################################################
   80 
   81 ###########################################################################
   82 #
   83 # Brief Philosophy of this file
   84 #
   85 # Most unit definitions are made in terms of integers or simple fractions of
   86 # other definitions.  The typical exceptions are when converting between two
   87 # different unit systems, or the values of measured physical constants.  In
   88 # this file definitions are given in the most natural and revealing way in
   89 # terms of integer factors.
   90 #
   91 # If you make changes be sure to run 'units --check' to check your work.
   92 #
   93 # The file is USA-centric, but there is some modest effort to support other
   94 # countries.  This file is now coded in UTF-8.  To support environments where
   95 # UTF-8 is not available, definitions that require this character set are
   96 # wrapped in !utf8 directives.
   97 #
   98 # When a unit name is used in different countries with the different meanings
   99 # the system should be as follows:
  100 #
  101 # Suppose countries ABC and XYZ both use the "foo".  Then globally define
  102 #
  103 #   ABCfoo  <some value>
  104 #   XYZfoo  <different value>
  105 #
  106 # Then, using the !locale directive, define the "foo" appropriately for each of
  107 # the two countries with a definition like
  108 #
  109 # !locale ABC
  110 #    foo  ABCfoo
  111 # !endlocale
  112 #
  113 ###########################################################################
  114 
  115 !locale en_US
  116 !  set UNITS_ENGLISH US
  117 !endlocale
  118 
  119 !locale en_GB
  120 !  set UNITS_ENGLISH GB
  121 !endlocale
  122 
  123 !set UNITS_ENGLISH US   # Default setting for English units
  124 
  125 !set UNITS_SYSTEM default   # Set a default value
  126 
  127 !varnot UNITS_SYSTEM si emu esu gaussian gauss default
  128 !message Unknown unit system given with -u or UNITS_SYSTEM environment variable
  129 !message Valid systems: si, emu, esu, gauss[ian]
  130 !message Using SI
  131 !prompt (SI)
  132 !endvar
  133 
  134 !var UNITS_SYSTEM si
  135 !message SI units selected
  136 !prompt (SI)
  137 !endvar
  138 
  139 ###########################################################################
  140 #                                                                         #
  141 # Primitive units.  Any unit defined to contain a '!' character is a      #
  142 # primitive unit which will not be reduced any further.  All units should #
  143 # reduce to primitive units.                                              #
  144 #                                                                         #
  145 ###########################################################################
  146 
  147 #
  148 # SI units
  149 #
  150 
  151 kg        !      # Mass of the international prototype
  152 kilogram  kg
  153 
  154 s         !      # Duration of 9192631770 periods of the radiation
  155 second    s      #   corresponding to the transition between the two hyperfine
  156                  #   levels of the ground state of the cesium-133 atom
  157 
  158 m         !      # Length of the path traveled by light in a vacuum
  159 meter     m      #   during 1|299792458 seconds.  Originally meant to be
  160                  #   1e-7 of the length along a meridian from the equator
  161                  #   to a pole.
  162 
  163 A         !      # The current which produces a force of 2e-7 N/m between two
  164 ampere    A      #   infinitely long wires that are 1 meter apart
  165 amp       ampere
  166 
  167 cd        !      # Luminous intensity in a given direction of a source which
  168 candela   cd     #   emits monochromatic radiation at 540e12 Hz with radiant
  169                  #   intensity 1|683 W/steradian.  (This differs from radiant
  170                  #   intensity (W/sr) in that it is adjusted for human
  171                  #   perceptual dependence on wavelength.  The frequency of
  172                  #   540e12 Hz (yellow) is where human perception is most
  173                  #   efficient.)
  174 
  175 mol       !      # The amount of substance of a system which contains as many
  176 mole      mol    #   elementary entities as there are atoms in 0.012 kg of
  177                  #   carbon 12.  The elementary entities must be specified and
  178                  #   may be atoms, molecules, ions, electrons, or other
  179                  #   particles or groups of particles.  It is understood that
  180                  #   unbound atoms of carbon 12, at rest and in the ground
  181                  #   state, are referred to.
  182 
  183 K         !      # 1|273.16 of the thermodynamic temperature of the triple
  184 kelvin    K      #   point of water
  185 
  186 #
  187 # The radian and steradian are defined as dimensionless primitive units.
  188 # The radian is equal to m/m and the steradian to m^2/m^2 so these units are
  189 # dimensionless.  Retaining them as named units is useful because it allows
  190 # clarity in expressions and makes the meaning of unit definitions more clear.
  191 # These units will reduce to 1 in conversions but not for sums of units or for
  192 # arguments to functions.
  193 #
  194 
  195 radian    !dimensionless   # The angle subtended at the center of a circle by
  196                            #   an arc equal in length to the radius of the
  197                            #   circle
  198 sr        !dimensionless   # Solid angle which cuts off an area of the surface
  199 steradian sr               #   of the sphere equal to that of a square with
  200                            #   sides of length equal to the radius of the
  201                            #   sphere
  202 
  203 #
  204 # A primitive non-SI unit
  205 #
  206 
  207 bit       !      # Basic unit of information (entropy).  The entropy in bits
  208                  #   of a random variable over a finite alphabet is defined
  209                  #   to be the sum of -p(i)*log2(p(i)) over the alphabet where
  210                  #   p(i) is the probability that the random variable takes
  211                  #   on the value i.
  212 
  213 #
  214 # Currency: the primitive unit of currency is defined in currency.units. 
  215 # It is usually the US$ or the euro, but it is user selectable.  
  216 #
  217 
  218 ###########################################################################
  219 #                                                                         #
  220 # Prefixes (longer names must come first)                                 #
  221 #                                                                         #
  222 ###########################################################################
  223 
  224 yotta-                  1e24     # Greek or Latin octo, "eight"
  225 zetta-                  1e21     # Latin septem, "seven"
  226 exa-                    1e18     # Greek hex, "six"
  227 peta-                   1e15     # Greek pente, "five"
  228 tera-                   1e12     # Greek teras, "monster"
  229 giga-                   1e9      # Greek gigas, "giant"
  230 mega-                   1e6      # Greek megas, "large"
  231 myria-                  1e4      # Not an official SI prefix
  232 kilo-                   1e3      # Greek chilioi, "thousand"
  233 hecto-                  1e2      # Greek hekaton, "hundred"
  234 deca-                   1e1      # Greek deka, "ten"
  235 deka-                   deca
  236 deci-                   1e-1     # Latin decimus, "tenth"
  237 centi-                  1e-2     # Latin centum, "hundred"
  238 milli-                  1e-3     # Latin mille, "thousand"
  239 micro-                  1e-6     # Latin micro or Greek mikros, "small"
  240 nano-                   1e-9     # Latin nanus or Greek nanos, "dwarf"
  241 pico-                   1e-12    # Spanish pico, "a bit"
  242 femto-                  1e-15    # Danish-Norwegian femten, "fifteen"
  243 atto-                   1e-18    # Danish-Norwegian atten, "eighteen"
  244 zepto-                  1e-21    # Latin septem, "seven"
  245 yocto-                  1e-24    # Greek or Latin octo, "eight"
  246 
  247 quarter-                1|4
  248 semi-                   0.5
  249 demi-                   0.5
  250 hemi-                   0.5
  251 half-                   0.5
  252 double-                 2
  253 triple-                 3
  254 treble-                 3
  255 
  256 kibi-                   2^10     # In response to the convention of illegally
  257 mebi-                   2^20     # and confusingly using metric prefixes for
  258 gibi-                   2^30     # powers of two, the International
  259 tebi-                   2^40     # Electrotechnical Commission aproved these
  260 pebi-                   2^50     # binary prefixes for use in 1998.  If you
  261 exbi-                   2^60     # want to refer to "megabytes" using the
  262 Ki-                     kibi     # binary definition, use these prefixes.
  263 Mi-                     mebi
  264 Gi-                     gibi
  265 Ti-                     tebi
  266 Pi-                     pebi
  267 Ei-                     exbi
  268 
  269 Y-                      yotta
  270 Z-                      zetta
  271 E-                      exa
  272 P-                      peta
  273 T-                      tera
  274 G-                      giga
  275 M-                      mega
  276 k-                      kilo
  277 h-                      hecto
  278 da-                     deka
  279 d-                      deci
  280 c-                      centi
  281 m-                      milli
  282 u-                      micro   # it should be a mu but u is easy to type
  283 n-                      nano
  284 p-                      pico
  285 f-                      femto
  286 a-                      atto
  287 z-                      zepto
  288 y-                      yocto
  289 
  290 #
  291 # Names of some numbers
  292 #
  293 
  294 one                     1
  295 two                     2
  296 double                  2
  297 couple                  2
  298 three                   3
  299 triple                  3
  300 four                    4
  301 quadruple               4
  302 five                    5
  303 quintuple               5
  304 six                     6
  305 seven                   7
  306 eight                   8
  307 nine                    9
  308 ten                     10
  309 eleven                  11
  310 twelve                  12
  311 thirteen                13
  312 fourteen                14
  313 fifteen                 15
  314 sixteen                 16
  315 seventeen               17
  316 eighteen                18
  317 nineteen                19
  318 twenty                  20
  319 thirty                  30
  320 forty                   40
  321 fifty                   50
  322 sixty                   60
  323 seventy                 70
  324 eighty                  80
  325 ninety                  90
  326 hundred                 100
  327 thousand                1000
  328 million                 1e6
  329 
  330 twoscore                two score
  331 threescore              three score
  332 fourscore               four score
  333 fivescore               five score
  334 sixscore                six score
  335 sevenscore              seven score
  336 eightscore              eight score
  337 ninescore               nine score
  338 tenscore                ten score
  339 twelvescore             twelve score
  340 
  341 # These number terms were described by N. Chuquet and De la Roche in the 16th
  342 # century as being successive powers of a million.  These definitions are still
  343 # used in most European countries.  The current US definitions for these
  344 # numbers arose in the 17th century and don't make nearly as much sense.  These
  345 # numbers are listed in the CRC Concise Encyclopedia of Mathematics by Eric
  346 # W. Weisstein.
  347 
  348 shortbillion               1e9
  349 shorttrillion              1e12
  350 shortquadrillion           1e15
  351 shortquintillion           1e18
  352 shortsextillion            1e21
  353 shortseptillion            1e24
  354 shortoctillion             1e27
  355 shortnonillion             1e30
  356 shortnoventillion          shortnonillion
  357 shortdecillion             1e33
  358 shortundecillion           1e36
  359 shortduodecillion          1e39
  360 shorttredecillion          1e42
  361 shortquattuordecillion     1e45
  362 shortquindecillion         1e48
  363 shortsexdecillion          1e51
  364 shortseptendecillion       1e54
  365 shortoctodecillion         1e57
  366 shortnovemdecillion        1e60
  367 shortvigintillion          1e63
  368 
  369 centillion              1e303
  370 googol                  1e100
  371 
  372 longbillion               million^2
  373 longtrillion              million^3
  374 longquadrillion           million^4
  375 longquintillion           million^5
  376 longsextillion            million^6
  377 longseptillion            million^7
  378 longoctillion             million^8
  379 longnonillion             million^9
  380 longnoventillion          longnonillion
  381 longdecillion             million^10
  382 longundecillion           million^11
  383 longduodecillion          million^12
  384 longtredecillion          million^13
  385 longquattuordecillion     million^14
  386 longquindecillion         million^15
  387 longsexdecillion          million^16
  388 longseptdecillion         million^17
  389 longoctodecillion         million^18
  390 longnovemdecillion        million^19
  391 longvigintillion          million^20
  392 
  393 # These numbers fill the gaps left by the long system above.
  394 
  395 milliard                1000 million
  396 billiard                1000 million^2
  397 trilliard               1000 million^3
  398 quadrilliard            1000 million^4
  399 quintilliard            1000 million^5
  400 sextilliard             1000 million^6
  401 septilliard             1000 million^7
  402 octilliard              1000 million^8
  403 nonilliard              1000 million^9
  404 noventilliard           nonilliard
  405 decilliard              1000 million^10
  406 
  407 # For consistency
  408 
  409 longmilliard              milliard
  410 longbilliard              billiard
  411 longtrilliard             trilliard
  412 longquadrilliard          quadrilliard
  413 longquintilliard          quintilliard
  414 longsextilliard           sextilliard
  415 longseptilliard           septilliard
  416 longoctilliard            octilliard
  417 longnonilliard            nonilliard
  418 longnoventilliard         noventilliard
  419 longdecilliard            decilliard
  420 
  421 # The long centillion would be 1e600.  The googolplex is another
  422 # familiar large number equal to 10^googol.  These numbers give overflows.
  423 
  424 #
  425 # The short system prevails in English speaking countries
  426 #
  427 
  428 billion                 shortbillion
  429 trillion                shorttrillion
  430 quadrillion             shortquadrillion
  431 quintillion             shortquintillion
  432 sextillion              shortsextillion
  433 septillion              shortseptillion
  434 octillion               shortoctillion
  435 nonillion               shortnonillion
  436 noventillion            shortnoventillion
  437 decillion               shortdecillion
  438 undecillion             shortundecillion
  439 duodecillion            shortduodecillion
  440 tredecillion            shorttredecillion
  441 quattuordecillion       shortquattuordecillion
  442 quindecillion           shortquindecillion
  443 sexdecillion            shortsexdecillion
  444 septendecillion         shortseptendecillion
  445 octodecillion           shortoctodecillion
  446 novemdecillion          shortnovemdecillion
  447 vigintillion            shortvigintillion
  448 
  449 #
  450 # Numbers used in India 
  451 #
  452 
  453 lakh                    1e5
  454 crore                   1e7
  455 arab                    1e9
  456 kharab                  1e11
  457 neel                    1e13
  458 padm                    1e15
  459 shankh                  1e17
  460 
  461 #############################################################################
  462 #                                                                           #
  463 # Derived units which can be reduced to the primitive units                 #
  464 #                                                                           #
  465 #############################################################################
  466 
  467 
  468 
  469 #
  470 # Named SI derived units (officially accepted)
  471 #
  472 
  473 newton                  kg m / s^2   # force
  474 N                       newton
  475 pascal                  N/m^2        # pressure or stress
  476 Pa                      pascal
  477 joule                   N m          # energy
  478 J                       joule
  479 watt                    J/s          # power
  480 W                       watt
  481 coulomb                 A s          # charge
  482 C                       coulomb
  483 volt                    W/A          # potential difference
  484 V                       volt
  485 ohm                     V/A          # electrical resistance
  486 siemens                 A/V          # electrical conductance
  487 S                       siemens
  488 farad                   C/V          # capacitance
  489 F                       farad
  490 weber                   V s          # magnetic flux
  491 Wb                      weber
  492 henry                   V s / A      # inductance
  493 H                       henry
  494 tesla                   Wb/m^2       # magnetic flux density
  495 T                       tesla
  496 hertz                   /s           # frequency
  497 Hz                      hertz
  498 
  499 #
  500 # Dimensions.  These are here to help with dimensional analysis and
  501 # because they will appear in the list produced by hitting '?' at the
  502 # "You want:" prompt to tell the user the dimension of the unit.
  503 #
  504 
  505 LENGTH                  meter
  506 AREA                    LENGTH^2
  507 VOLUME                  LENGTH^3
  508 MASS                    kilogram
  509 AMOUNT                  mole
  510 ANGLE                   radian
  511 SOLID_ANGLE             steradian
  512 MONEY                   US$
  513 FORCE                   newton
  514 PRESSURE                FORCE / AREA
  515 STRESS                  FORCE / AREA
  516 FREQUENCY               hertz
  517 VELOCITY                LENGTH / TIME
  518 ACCELERATION            VELOCITY / TIME
  519 DENSITY                 MASS / VOLUME
  520 LINEAR_DENSITY          MASS / LENGTH
  521 VISCOSITY               FORCE TIME / AREA
  522 KINEMATIC_VISCOSITY     VISCOSITY / DENSITY
  523 CURRENT                 ampere
  524 CHARGE                  coulomb
  525 CAPACITANCE             farad
  526 RESISTANCE              ohm
  527 CONDUCTANCE             siemens
  528 INDUCTANCE              henry
  529 E_FIELD                 ELECTRIC_POTENTIAL / LENGTH
  530 B_FIELD                 tesla
  531 # The D and H fields are related to the E and B fields by factors of epsilon
  532 # and mu respectively, so their units can be found by multiplying/dividing by
  533 # the epsilon0 and mu0, but then it is necessary to remove the constant factors
  534 # to get the correct scaling.  Defining the units this way allows conversion to
  535 # CGS units to work correctly.
  536 D_FIELD                 E_FIELD epsilon0 (c/(m/s))^2 4 pi 1e-7 
  537 H_FIELD                 B_FIELD / mu0 * 4 pi 1e-7		
  538 ELECTRIC_DIPOLE_MOMENT  C m
  539 MAGNETIC_DIPOLE_MOMENT  J / T
  540 POLARIZATION            ELECTRIC_DIPOLE_MOMENT / VOLUME
  541 MAGNETIZATION           MAGNETIC_DIPOLE_MOMENT / VOLUME
  542 ELECTRIC_POTENTIAL      volt
  543 VOLTAGE                 ELECTRIC_POTENTIAL
  544 E_FLUX                  E_FIELD AREA	
  545 D_FLUX                  D_FIELD AREA
  546 B_FLUX                  B_FIELD AREA	
  547 H_FLUX                  H_FIELD AREA
  548 
  549 #
  550 # units derived easily from SI units
  551 #
  552 
  553 gram                    millikg
  554 gm                      gram
  555 g                       gram
  556 tonne                   1000 kg
  557 t                       tonne
  558 metricton               tonne
  559 sthene                  tonne m / s^2
  560 funal                   sthene
  561 pieze                   sthene / m^2
  562 quintal                 100 kg
  563 bar                     1e5 Pa     # About 1 atm
  564 b                       bar
  565 vac                     millibar
  566 micron                  micrometer # One millionth of a meter
  567 bicron                  picometer  # One brbillionth of a meter
  568 cc                      cm^3
  569 are                     100 m^2
  570 a                       are
  571 liter                   1000 cc       # The liter was defined in 1901 as the
  572 oldliter                1.000028 dm^3 # space occupied by 1 kg of pure water at
  573 L                       liter         # the temperature of its maximum density
  574 l                       liter         # under a pressure of 1 atm.  This was
  575                                       # supposed to be 1000 cubic cm, but it
  576                                       # was discovered that the original
  577                                       # measurement was off.  In 1964, the
  578                                       # liter was redefined to be exactly 1000
  579                                       # cubic centimeters.
  580 mho                     siemens    # Inverse of ohm, hence ohm spelled backward
  581 galvat                  ampere     # Named after Luigi Galvani
  582 angstrom                1e-10 m    # Convenient for describing molecular sizes
  583 xunit                   xunit_cu      # Used for measuring x-ray wavelengths.
  584 siegbahn                xunit         # Originally defined to be 1|3029.45 of
  585 xunit_cu             1.00207697e-13 m # the spacing of calcite planes at 18
  586 xunit_mo             1.00209952e-13 m # degC.  It was intended to be exactly
  587                                       # 1e-13 m, but was later found to be
  588                                       # slightly off.  Current usage is with
  589                                       # reference to common x-ray lines, either
  590                                       # the K-alpha 1 line of copper or the
  591                                       # same line of molybdenum.
  592 angstromstar            1.00001495 angstrom # Defined by JA Bearden in 1965
  593 fermi                   1e-15 m    # Convenient for describing nuclear sizes
  594                                    #   Nuclear radius is from 1 to 10 fermis
  595 barn                    1e-28 m^2  # Used to measure cross section for
  596                                    #   particle physics collision, said to
  597                                    #   have originated in the phrase "big as
  598                                    #   a barn".
  599 shed                    1e-24 barn # Defined to be a smaller companion to the
  600                                    #   barn, but it's too small to be of
  601                                    #   much use.
  602 brewster                micron^2/N # measures stress-optical coef
  603 diopter                 /m         # measures reciprocal of lens focal length
  604 fresnel                 1e12 Hz    # occasionally used in spectroscopy
  605 shake                   1e-8 sec
  606 svedberg                1e-13 s    # Used for measuring the sedimentation
  607                                    # coefficient for centrifuging.
  608 gamma                   microgram  # Also used for 1e-9 tesla
  609 lambda                  microliter
  610 spat                    1e12 m     # Rarely used for astronomical measurements
  611 preece                  1e13 ohm m # resistivity
  612 planck                  J s        # action of one joule over one second
  613 sturgeon                /henry     # magnetic reluctance
  614 daraf                   1/farad    # elastance (farad spelled backwards)
  615 leo                     10 m/s^2
  616 poiseuille              N s / m^2  # viscosity
  617 mayer                   J/g K      # specific heat
  618 mired                   / microK   # reciprocal color temperature.  The name
  619                                    #   abbreviates micro reciprocal degree.
  620 crocodile               megavolt   # used informally in UK physics labs
  621 metricounce             25 g
  622 mounce                  metricounce
  623 finsenunit              1e5 W/m^2  # Measures intensity of ultraviolet light
  624                                    # with wavelength 296.7 nm.
  625 fluxunit                1e-26 W/m^2 Hz # Used in radio astronomy to measure
  626                                        #   the energy incident on the receiving
  627                                        #   body across a specified frequency
  628                                        #   bandwidth.  [12]
  629 jansky                  fluxunit   # K. G. Jansky identified radio waves coming
  630 Jy                      jansky     # from outer space in 1931.
  631 flick       W / cm^2 sr micrometer # Spectral radiance or irradiance
  632 pfu                    / cm^2 sr s # particle flux unit -- Used to measure
  633                                    #   rate at which particles are received by
  634                                    #   a spacecraft as particles per solid
  635                                    #   angle per detector area per second. [18]
  636 pyron            cal_IT / cm^2 min # Measures heat flow from solar radiation,
  637                                    #   from Greek work "pyr" for fire.
  638 katal                   mol/sec    # Measure of the amount of a catalyst.  One
  639 kat                     katal      #   katal of catalyst enables the reaction
  640                                    #   to consume or produce on mol/sec.
  641 solarluminosity         382.8e24 W # A common yardstick for comparing the
  642                                    #   output of different stars.
  643                 # http://nssdc.gsfc.nasa.gov/planetary/factsheet/sunfact.html
  644 # at mean earth-sun distance
  645 solarirradiance		solarluminosity / (4 pi sundist^2)
  646 solarconstant		solarirradiance
  647 TSI			solarirradiance		# total solar irradiance
  648 
  649 #
  650 # time
  651 #
  652 
  653 sec                     s
  654 minute                  60 s
  655 min                     minute
  656 hour                    60 min
  657 hr                      hour
  658 day                     24 hr
  659 d                       day
  660 da                      day
  661 week                    7 day
  662 wk                      week
  663 sennight                7 day
  664 fortnight               14 day
  665 blink                   1e-5 day   # Actual human blink takes 1|3 second
  666 ce                      1e-2 day
  667 cron                    1e6 years
  668 watch                   4 hours    # time a sentry stands watch or a ship's
  669                                    # crew is on duty.
  670 bell                    1|8 watch  # Bell would be sounded every 30 minutes.
  671 
  672 # French Revolutionary Time or Decimal Time.  It was Proposed during
  673 # the French Revolution.  A few clocks were made, but it never caught
  674 # on.  In 1998 Swatch defined a time measurement called ".beat" and
  675 # sold some watches that displayed time in this unit.
  676 
  677 decimalhour             1|10 day            
  678 decimalminute           1|100 decimalhour   
  679 decimalsecond           1|100 decimalminute 
  680 beat                    decimalminute          # Swatch Internet Time
  681 
  682 #
  683 # angular measure
  684 #
  685 
  686 circle                  2 pi radian
  687 degree                  1|360 circle
  688 deg                     degree
  689 arcdeg                  degree
  690 arcmin                  1|60 degree
  691 arcminute               arcmin
  692 '                       arcmin
  693 arcsec                  1|60 arcmin
  694 arcsecond               arcsec
  695 "                       arcsec
  696 ''                      "
  697 rightangle              90 degrees
  698 quadrant                1|4 circle
  699 quintant                1|5 circle
  700 sextant                 1|6 circle
  701 
  702 sign                    1|12 circle # Angular extent of one sign of the zodiac
  703 turn                    circle
  704 revolution              turn
  705 rev                     turn
  706 pulsatance              radian / sec
  707 gon                     1|100 rightangle  # measure of grade
  708 grade                   gon
  709 centesimalminute        1|100 grade
  710 centesimalsecond        1|100 centesimalminute
  711 milangle                1|6400 circle     # Official NIST definition.
  712                                           # Another choice is 1e-3 radian.
  713 pointangle              1|32 circle  # Used for reporting compass readings
  714 centrad                 0.01 radian  # Used for angular deviation of light
  715                                      # through a prism.
  716 mas                     milli arcsec # Used by astronomers
  717 seclongitude            circle (seconds/day) # Astronomers measure longitude
  718                                      # (which they call right ascension) in
  719                                      # time units by dividing the equator into
  720                                      # 24 hours instead of 360 degrees.
  721 #
  722 # Some geometric formulas
  723 #
  724 
  725 circlearea(r)   units=[m;m^2] range=[0,) pi r^2 ; sqrt(circlearea/pi)
  726 spherevolume(r) units=[m;m^3] range=[0,) 4|3 pi r^3 ; \
  727                                          cuberoot(spherevolume/4|3 pi)
  728 spherevol()     spherevolume
  729 square(x)       range=[0,)          x^2 ; sqrt(square)
  730 
  731 #
  732 # Solid angle measure
  733 #
  734 
  735 sphere                  4 pi sr
  736 squaredegree            1|180^2 pi^2 sr
  737 squareminute            1|60^2 squaredegree
  738 squaresecond            1|60^2 squareminute
  739 squarearcmin            squareminute
  740 squarearcsec            squaresecond
  741 sphericalrightangle     0.5 pi sr
  742 octant                  0.5 pi sr
  743 
  744 #
  745 # Concentration measures
  746 #
  747 
  748 percent                 0.01
  749 %                       percent
  750 mill                    0.001     # Originally established by Congress in 1791
  751                                   # as a unit of money equal to 0.001 dollars,
  752                                   # it has come to refer to 0.001 in general.
  753                                   # Used by some towns to set their property
  754                                   # tax rate, and written with a symbol similar
  755                                   # to the % symbol but with two 0's in the
  756                                   # denominator.  [18]
  757 proof                   1|200     # Alcohol content measured by volume at
  758                                   # 60 degrees Fahrenheit.  This is a USA
  759                                   # measure.  In Europe proof=percent.
  760 ppm                     1e-6
  761 partspermillion         ppm
  762 ppb                     1e-9
  763 partsperbillion         ppb       # USA billion
  764 ppt                     1e-12
  765 partspertrillion        ppt       # USA trillion
  766 karat                   1|24      # measure of gold purity
  767 caratgold               karat
  768 gammil                  mg/l
  769 basispoint              0.01 %    # Used in finance
  770 fine                    1|1000    # Measure of gold purity
  771 
  772 # The pH scale is used to measure the concentration of hydronium (H3O+) ions in
  773 # a solution.  A neutral solution has a pH of 7 as a result of dissociated
  774 # water molecules.
  775 
  776 pH(x) units=[1;mol/liter] range=(0,) 10^(-x) mol/liter ; (-log(pH liters/mol))
  777 
  778 
  779 #
  780 # Temperature
  781 #
  782 # Two types of units are defined: units for converting temperature differences
  783 # and functions for converting absolute temperatures.  Conversions for
  784 # differences start with "deg" and conversions for absolute temperature start
  785 # with "temp".
  786 #
  787 
  788 TEMPERATURE             kelvin
  789 TEMPERATURE_DIFFERENCE  kelvin
  790 
  791 # In 1741 Anders Celsius introduced a temperature scale with water boiling at
  792 # 0 degrees and freezing at 100 degrees at standard pressure. After his death
  793 # the fixed points were reversed and the scale was called the centigrade
  794 # scale.  Due to the difficulty of accurately measuring the temperature of
  795 # melting ice at standard pressure, the centigrade scale was replaced in 1954
  796 # by the Celsius scale which is defined by subtracting 273.15 from the
  797 # temperature in Kelvins.  This definition differed slightly from the old
  798 # centigrade definition, but the Kelvin scale depends on the triple point of
  799 # water rather than a melting point, so it can be measured accurately.
  800 
  801 tempC(x) units=[1;K] domain=[-273.15,) range=[0,) \
  802                              x K + stdtemp ; (tempC +(-stdtemp))/K
  803 tempcelsius() tempC
  804 degcelsius              K
  805 degC                    K
  806 
  807 # Fahrenheit defined his temperature scale by setting 0 to the coldest
  808 # temperature he could produce in his lab with a salt water solution and by
  809 # setting 96 degrees to body heat.  In Fahrenheit's words:
  810 #
  811 #    Placing the thermometer in a mixture of sal ammoniac or sea
  812 #    salt, ice, and water a point on the scale will be found which
  813 #    is denoted as zero. A second point is obtained if the same
  814 #    mixture is used without salt. Denote this position as 30. A
  815 #    third point, designated as 96, is obtained if the thermometer
  816 #    is placed in the mouth so as to acquire the heat of a healthy
  817 #    man."  (D. G. Fahrenheit, Phil. Trans. (London) 33, 78, 1724)
  818 
  819 tempF(x) units=[1;K] domain=[-459.67,) range=[0,) \
  820                 (x+(-32)) degF + stdtemp ; (tempF+(-stdtemp))/degF + 32
  821 tempfahrenheit() tempF
  822 degfahrenheit           5|9 degC
  823 degF                    5|9 degC
  824 
  825 
  826 degreesrankine          degF              # The Rankine scale has the
  827 degrankine              degreesrankine    # Fahrenheit degree, but its zero
  828 degreerankine           degF              # is at absolute zero.
  829 degR                    degrankine
  830 tempR                   degrankine
  831 temprankine             degrankine
  832 
  833 tempreaumur(x)    units=[1;K] domain=[-218.52,) range=[0,) \
  834                   x degreaumur+stdtemp ; (tempreaumur+(-stdtemp))/degreaumur
  835 degreaumur              10|8 degC # The Reaumur scale was used in Europe and
  836                                   # particularly in France.  It is defined
  837                                   # to be 0 at the freezing point of water
  838                                   # and 80 at the boiling point.  Reaumur
  839                                   # apparently selected 80 because it is
  840                                   # divisible by many numbers.
  841 
  842 degK                    K         # "Degrees Kelvin" is forbidden usage.
  843 tempK                   K         # For consistency
  844 
  845 # Gas mark is implemented below but in a terribly ugly way.  There is
  846 # a simple formula, but it requires a conditional which is not
  847 # presently supported.
  848 #
  849 # The formula to convert to degrees Fahrenheit is:
  850 #
  851 # 25 log2(gasmark) + k_f   gasmark<=1
  852 # 25 (gasmark-1) + k_f     gasmark>=1
  853 #
  854 # k_f = 275
  855 #
  856 gasmark[degR] \
  857   .0625    634.67 \
  858   .125     659.67 \
  859   .25      684.67 \
  860   .5       709.67 \
  861   1        734.67 \
  862   2        759.67 \
  863   3        784.67 \
  864   4        809.67 \
  865   5        834.67 \
  866   6        859.67 \
  867   7        884.67 \
  868   8        909.67 \
  869   9        934.67 \
  870   10       959.67
  871 
  872 # Units cannot handle wind chill or heat index because they are two variable
  873 # functions, but they are included here for your edification.  Clearly these
  874 # equations are the result of a model fitting operation.
  875 #
  876 # wind chill index (WCI) a measurement of the combined cooling effect of low
  877 #      air temperature and wind on the human body. The index was first defined
  878 #      by the American Antarctic explorer Paul Siple in 1939. As currently used
  879 #      by U.S. meteorologists, the wind chill index is computed from the
  880 #      temperature T (in °F) and wind speed V (in mi/hr) using the formula:
  881 #          WCI = 0.0817(3.71 sqrt(V) + 5.81 - 0.25V)(T - 91.4) + 91.4.
  882 #      For very low wind speeds, below 4 mi/hr, the WCI is actually higher than
  883 #      the air temperature, but for higher wind speeds it is lower than the air
  884 #      temperature.
  885 #
  886 # heat index (HI or HX) a measure of the combined effect of heat and
  887 #      humidity on the human body. U.S. meteorologists compute the index
  888 #      from the temperature T (in °F) and the relative humidity H (as a
  889 #      value from 0 to 1).
  890 #        HI = -42.379 + 2.04901523 T + 1014.333127 H - 22.475541 TH
  891 #             - .00683783 T^2 - 548.1717 H^2 + 0.122874 T^2 H + 8.5282 T H^2
  892 #             - 0.0199 T^2 H^2.
  893 
  894 #
  895 # Physical constants
  896 #
  897 
  898 # Basic constants
  899 
  900 pi                      3.14159265358979323846
  901 c                       2.99792458e8 m/s # speed of light in vacuum (exact)
  902 light                   c
  903 mu0                     4 pi 1e-7 H/m    # permeability of vacuum (exact)
  904 epsilon0                1/mu0 c^2        # permittivity of vacuum (exact)
  905 energy                  c^2              # convert mass to energy
  906 e                     1.6021766208e-19 C # electron charge
  907 h                   4.135667662e-15 eV s # Planck constant
  908 hbar                    h / 2 pi
  909 spin                    hbar
  910 G               6.67408e-11 N m^2 / kg^2 # Newtonian gravitational constant
  911                                          #    This is the NIST 2006 value.
  912                                          #    The relative uncertainty on this
  913                                          #    is 1e-4.
  914 coulombconst            1/4 pi epsilon0  # listed as "k" sometimes
  915 
  916 # Physico-chemical constants
  917 
  918 atomicmassunit        1.660539040e-27 kg # atomic mass unit (defined to be
  919 u                       atomicmassunit   #   1|12 of the mass of carbon 12)
  920 amu                     atomicmassunit
  921 amu_chem                1.66026e-27 kg   # 1|16 of the weighted average mass of
  922                                          #   the 3 naturally occuring neutral
  923                                          #   isotopes of oxygen
  924 amu_phys                1.65981e-27 kg   # 1|16 of the mass of a neutral
  925                                          #   oxygen 16 atom
  926 dalton                  u                # Maybe this should be amu_chem?
  927 avogadro                grams/amu mol    # size of a mole
  928 N_A                     avogadro
  929 gasconstant             k N_A            # molar gas constant
  930 R                       gasconstant
  931 boltzmann             1.38064852e-23 J/K # Boltzmann constant
  932 k                       boltzmann
  933 kboltzmann              boltzmann
  934 molarvolume         mol R stdtemp / atm  # Volume occupied by one mole of an
  935                                          #   ideal gas at STP.
  936 loschmidt     avogadro mol / molarvolume # Molecules per cubic meter of an
  937                                          #   ideal gas at STP.  Loschmidt did
  938                                          #   work similar to Avogadro.
  939 stefanboltzmann pi^2 k^4 / 60 hbar^3 c^2 # The power per area radiated by a
  940 sigma                   stefanboltzmann  #   blackbody at temperature T is
  941                                          #   given by sigma T^4.
  942 wiendisplacement        2.8977729e-3 m K # Wien's Displacement Law gives the
  943                                          #   frequency at which the the Planck
  944                                          #   spectrum has maximum intensity.
  945                                          #   The relation is lambda T = b where
  946                                          #   lambda is wavelength, T is
  947                                          #   temperature and b is the Wien
  948                                          #   displacement.  This relation is
  949                                          #   used to determine the temperature
  950                                          #   of stars.
  951 K_J90 483597.9 GHz/V    # Direct measurement of the volt is difficult.  Until
  952 K_J   483597.8525 GHz/V #   recently, laboratories kept Weston cadmium cells as
  953                         #   a reference, but they could drift.  In 1987 the
  954                         #   CGPM officially recommended the use of the
  955                         #   Josephson effect as a laboratory representation of
  956                         #   the volt.  The Josephson effect occurs when two
  957                         #   superconductors are separated by a thin insulating
  958                         #   layer.  A "supercurrent" flows across the insulator
  959                         #   with a frequency that depends on the potential
  960                         #   applied across the superconductors.  This frequency
  961                         #   can be very accurately measured.  The Josephson
  962                         #   constant K_J, which is equal to 2e/h, relates the
  963                         #   measured frequency to the potential.  Two values
  964                         #   given, the conventional (exact) value from 1990 and
  965                         #   the current CODATA measured value.  
  966 R_K90 25812.807 ohm     # Measurement of the ohm also presents difficulties.
  967 R_K   25812.8074555 ohm #   The old approach involved maintaining resistances
  968                         #   that were subject to drift.  The new standard is
  969                         #   based on the Hall effect.  When a current carrying
  970                         #   ribbon is placed in a magnetic field, a potential
  971                         #   difference develops across the ribbon.  The ratio
  972                         #   of the potential difference to the current is
  973                         #   called the Hall resistance.  Klaus von Klitzing
  974                         #   discovered in 1980 that the Hall resistance varies
  975                         #   in discrete jumps when the magnetic field is very
  976                         #   large and the temperature very low.  This enables
  977                         #   accurate realization of the resistance h/e^2 in the
  978                         #   lab.  Two values given, the conventional (exact)
  979                         #   value from 1990 and the current CODATA measured
  980                         #   value.
  981 
  982 # Various conventional values
  983 
  984 gravity                 9.80665 m/s^2    # std acceleration of gravity (exact)
  985 force                   gravity          # use to turn masses into forces
  986 atm                     101325 Pa        # Standard atmospheric pressure
  987 atmosphere              atm
  988 Hg             13.5951 gram force / cm^3 # Standard weight of mercury (exact)
  989 water                   gram force/cm^3  # Standard weight of water (exact)
  990 waterdensity            gram / cm^3      # Density of water
  991 H2O                     water
  992 wc                      water            # water column
  993 mach                    331.46 m/s       # speed of sound in dry air at STP
  994 standardtemp            273.15 K         # standard temperature
  995 stdtemp                 standardtemp
  996 normaltemp              tempF(70)        # for gas density, from NIST
  997 normtemp                normaltemp       # Handbook 44
  998 
  999 # Weight of mercury and water at different temperatures using the standard
 1000 # force of gravity.
 1001 
 1002 Hg10C         13.5708 force gram / cm^3  # These units, when used to form
 1003 Hg20C         13.5462 force gram / cm^3  # pressure measures, are not accurate
 1004 Hg23C         13.5386 force gram / cm^3  # because of considerations of the
 1005 Hg30C         13.5217 force gram / cm^3  # revised practical temperature scale.
 1006 Hg40C         13.4973 force gram / cm^3
 1007 Hg60F         13.5574 force gram / cm^3
 1008 H2O0C         0.99987 force gram / cm^3
 1009 H2O5C         0.99999 force gram / cm^3
 1010 H2O10C        0.99973 force gram / cm^3
 1011 H2O15C        0.99913 force gram / cm^3
 1012 H2O18C        0.99862 force gram / cm^3
 1013 H2O20C        0.99823 force gram / cm^3
 1014 H2O25C        0.99707 force gram / cm^3
 1015 H2O50C        0.98807 force gram / cm^3
 1016 H2O100C       0.95838 force gram / cm^3
 1017 
 1018 # Atomic constants
 1019 
 1020 Rinfinity            10973731.568539 /m  # The wavelengths of a spectral series
 1021 R_H                     10967760 /m      #   can be expressed as
 1022                                          #     1/lambda = R (1/m^2 - 1/n^2).
 1023                                          #   where R is a number that various
 1024                                          #   slightly from element to element.
 1025                                          #   For hydrogen, R_H is the value,
 1026                                          #   and for heavy elements, the value
 1027                                          #   approaches Rinfinity, which can be
 1028                                          #   computed from
 1029                                          #        m_e c alpha^2 / 2 h
 1030                                          #   with a loss of 4 digits
 1031                                          #   of precision.
 1032 alpha                   7.2973525664e-3  # The fine structure constant was
 1033                                          #   introduced to explain fine
 1034                                          #   structure visible in spectral
 1035                                          #   lines.  It can be computed from
 1036                                          #         mu0 c e^2 / 2 h
 1037                                          #   with a loss of 3 digits precision
 1038                                          #   and loss of precision in derived
 1039                                          #   values which use alpha.
 1040 bohrradius              alpha / 4 pi Rinfinity
 1041 prout                   185.5 keV        # nuclear binding energy equal to 1|12
 1042                                          #   binding energy of the deuteron
 1043 # Planck constants
 1044 
 1045 planckmass              2.17651e-8 kg     # sqrt(hbar c / G)
 1046 m_P                     planckmass
 1047 plancktime              hbar / planckmass c^2
 1048 t_P                     plancktime
 1049 plancklength            plancktime c
 1050 l_P                     plancklength
 1051 
 1052 # Particle radius
 1053 
 1054 electronradius    coulombconst e^2 / electronmass c^2   # Classical
 1055 deuteronchargeradius    2.1413e-15 m
 1056 protonchargeradius      0.8751e-15 m
 1057 
 1058 # Masses of elementary particles
 1059 
 1060 electronmass            5.48579909070e-4 u
 1061 m_e                     electronmass
 1062 protonmass              1.007276466879 u
 1063 m_p                     protonmass
 1064 neutronmass             1.00866491588 u
 1065 m_n                     neutronmass
 1066 muonmass                0.1134289257 u
 1067 m_mu                    muonmass
 1068 deuteronmass            2.013553212745 u
 1069 m_d                     deuteronmass
 1070 alphaparticlemass       4.001506179127 u
 1071 m_alpha                 alphaparticlemass
 1072 taumass                 1.90749 u
 1073 m_tau                   taumass
 1074 tritonmass              3.01550071632 u
 1075 m_t                     tritonmass
 1076 helionmass              3.01493224673 u
 1077 m_h                     helionmass
 1078 
 1079 
 1080 
 1081 # particle wavelengths: the compton wavelength of a particle is
 1082 # defined as h / m c where m is the mass of the particle.
 1083 
 1084 electronwavelength      h / m_e c
 1085 lambda_C                electronwavelength
 1086 protonwavelength        h / m_p c
 1087 lambda_C,p              protonwavelength
 1088 neutronwavelength       h / m_n c
 1089 lambda_C,n              neutronwavelength
 1090 
 1091 # Magnetic moments
 1092 
 1093 bohrmagneton            e hbar / 2 electronmass
 1094 mu_B                    bohrmagneton
 1095 nuclearmagneton         e hbar /  2 protonmass
 1096 mu_N                    nuclearmagneton
 1097 mu_mu                  -4.49044826e-26 J/T   # Muon magnetic moment
 1098 mu_p                    1.4106067873e-26 J/T # Proton magnetic moment
 1099 mu_e                   -928.4764620e-26 J/T  # Electron magnetic moment
 1100 mu_n                   -0.96623650e-26 J/T   # Neutron magnetic moment
 1101 mu_d                    0.4330735040e-26 J/T # Deuteron magnetic moment
 1102 mu_t                    1.504609503e-26 J/T  # Triton magnetic moment
 1103 mu_h                   -1.074617522e-26 J/T  # Helion magnetic moment
 1104 
 1105 
 1106 #
 1107 # Units derived from physical constants
 1108 #
 1109 
 1110 kgf                     kg force
 1111 technicalatmosphere     kgf / cm^2
 1112 at                      technicalatmosphere
 1113 hyl                     kgf s^2 / m   # Also gram-force s^2/m according to [15]
 1114 mmHg                    mm Hg
 1115 torr                    atm / 760  # The torr, named after Evangelista
 1116                                    # Torricelli, and is very close to the mm Hg
 1117 tor                     Pa         # Suggested in 1913 but seldom used [24].
 1118                                    # Eventually renamed the Pascal.  Don't 
 1119                                    # confuse the tor with the torr.  
 1120 inHg                    inch Hg    
 1121 inH2O                   inch water
 1122 mmH2O                   mm water
 1123 eV                      e V      # Energy acquired by a particle with charge e
 1124 electronvolt            eV       #   when it is accelerated through 1 V
 1125 lightyear               c julianyear # The 365.25 day year is specified in
 1126 ly                      lightyear    # NIST publication 811
 1127 lightsecond             c s
 1128 lightminute             c min
 1129 parsec                  au / tan(arcsec)    # Unit of length equal to distance
 1130 pc                      parsec              #   from the sun to a point having
 1131                                             #   heliocentric parallax of 1
 1132                                             #   arcsec (derived from parallax
 1133                                             #   second).  A distant object with
 1134                                             #   paralax theta will be about
 1135                                             #   (arcsec/theta) parsecs from the
 1136                                             #   sun (using the approximation
 1137                                             #   that tan(theta) = theta).
 1138 rydberg                 h c Rinfinity       # Rydberg energy
 1139 crith                   0.089885 gram       # The crith is the mass of one
 1140                                             #   liter of hydrogen at standard
 1141                                             #   temperature and pressure.
 1142 amagatvolume            molarvolume
 1143 amagat                  mol/amagatvolume    # Used to measure gas densities
 1144 lorentz                 bohrmagneton / h c  # Used to measure the extent
 1145                                             #   that the frequency of light
 1146                                             #   is shifted by a magnetic field.
 1147 cminv                   h c / cm            # Unit of energy used in infrared
 1148 invcm                   cminv               #   spectroscopy.
 1149 wavenumber              cminv
 1150 kcal_mol                kcal_th / mol N_A   # kcal/mol is used as a unit of
 1151                                             #   energy by physical chemists.
 1152 #
 1153 # CGS system based on centimeter, gram and second
 1154 #
 1155 
 1156 dyne                    cm gram / s^2   # force
 1157 dyn                     dyne
 1158 erg                     cm dyne         # energy
 1159 poise                   gram / cm s     # viscosity, honors Jean Poiseuille
 1160 P                       poise
 1161 rhe                     /poise          # reciprocal viscosity
 1162 stokes                  cm^2 / s        # kinematic viscosity
 1163 St                      stokes
 1164 stoke                   stokes
 1165 lentor                  stokes          # old name
 1166 Gal                     cm / s^2        # acceleration, used in geophysics
 1167 galileo                 Gal             # for earth's gravitational field
 1168                                         # (note that "gal" is for gallon
 1169                                         # but "Gal" is the standard symbol
 1170                                         # for the gal which is evidently a
 1171                                         # shortened form of "galileo".)
 1172 barye                   dyne/cm^2       # pressure
 1173 barad                   barye           # old name
 1174 kayser                  1/cm            # Proposed as a unit for wavenumber
 1175 balmer                  kayser          # Even less common name than "kayser"
 1176 kine                    cm/s            # velocity
 1177 bole                    g cm / s        # momentum
 1178 pond                    gram force
 1179 glug                gram force s^2 / cm # Mass which is accelerated at
 1180                                         #   1 cm/s^2 by 1 gram force
 1181 darcy           centipoise cm^2 / s atm # Measures permeability to fluid flow.
 1182                                         #   One darcy is the permeability of a
 1183                                         #   medium that allows a flow of cc/s
 1184                                         #   of a liquid of centipoise viscosity
 1185                                         #   under a pressure gradient of
 1186                                         #   atm/cm.  Named for H. Darcy.
 1187 mobileohm               cm / dyn s      # mobile ohm, measure of mechanical
 1188                                         #   mobility
 1189 mechanicalohm           dyn s / cm      # mechanical resistance
 1190 acousticalohm           dyn s / cm^5    # ratio of the sound pressure of
 1191                                         #   1 dyn/cm^2 to a source of strength
 1192                                         #   1 cm^3/s
 1193 ray                     acousticalohm
 1194 rayl                    dyn s / cm^3    # Specific acoustical resistance
 1195 eotvos                  1e-9 Gal/cm     # Change in gravitational acceleration
 1196                                         #   over horizontal distance
 1197 #
 1198 # Electromagnetic CGS Units
 1199 # 
 1200 # For measuring electromagnetic quantities in SI, we introduce the new base
 1201 # dimension of current, define the ampere to measure current, and derive the
 1202 # other electromagnetic units from the ampere.  With the CGS units one approach
 1203 # is to use the basic equations of electromagnetism to define units that
 1204 # eliminate constants from those equations.  Coulombs law has the form
 1205 #
 1206 #          F = k_C q1 q2 / r^2
 1207 #
 1208 # where k_C is the coulomb constant equal to 1|4 pi epsilon0 in SI units.
 1209 # Ampere's force law takes the form
 1210 #
 1211 #          dF/dl = 2 k_A I1 I2 / r
 1212 #
 1213 # where k_A is the ampere constant.  In the CGS system we force either k_C or
 1214 # k_A to 1 which then defines either a unit for charge or a unit for current.
 1215 # The other unit then becomes a derived unit.  When k_C is 1 the ESU system
 1216 # results.  When k_A is 1 the EMU system results.  Note that these parameters
 1217 # are not independent of each other: Maxwell's equations indicate that
 1218 #         
 1219 #           k_C / k_A = c^2
 1220 #
 1221 # where c is the speed of light. 
 1222 #
 1223 # One more choice is needed to define a complete system.  Using Coulomb's law
 1224 # we define the electric field as the force per unit charge
 1225 #
 1226 #           E = k_C 1 / r^2.
 1227 #
 1228 # But what about the magnetic field?  It is derived from Ampere's law but we
 1229 # have the option of adding a proportionality constant, k_B, that may have
 1230 # dimensions:
 1231 #
 1232 #           B = 2 k_A k_B I / r
 1233 #
 1234 # We can choose k_B = 1, which is done in the SI, ESU and EMU systems.  But if
 1235 # instead we give k_B units of length/time then the magnetic field has
 1236 # the same units as the electric field.  This choice leads to the Gaussian
 1237 # system.
 1238 #
 1239 # The relations above are used to determine the dimensions, but the units are
 1240 # derived from the base units of CGS, not directly from those formulas.  We
 1241 # will use the notation [unit] to refer to the dimension of the unit in
 1242 # brackets.  This same process gives rise to the SI units such as the tesla, 
 1243 # which is defined by
 1244 #
 1245 #          B = 2              
 1246 #
 1247 # References:
 1248 #
 1249 # Classical Electrodynamics by John David Jackson, 3rd edition. 
 1250 # Cardarelli, Francois. 1999.  Scientific Unit Conversion. 2nd ed.  Trans.
 1251 #     M.J.  Shields.  London: Springer-Verlag. ISBN 1-85233-043-0
 1252 #
 1253 #
 1254 # All of these systems result in electromagnetic units that involve the square
 1255 # roots of the centimeter and gram.  This requires a change in the primitive
 1256 # units.
 1257 # 
 1258 
 1259 !var UNITS_SYSTEM esu emu gaussian gauss
 1260 sqrt_cm                 ! 
 1261 sqrt_centimeter         sqrt_cm
 1262 +m                      100 sqrt_cm^2
 1263 sqrt_g                  !
 1264 sqrt_gram               sqrt_g
 1265 +kg                     kilo sqrt_g^2
 1266 !endvar
 1267 
 1268 # Electrostatic CGS (ESU)
 1269 #
 1270 # This system uses the statcoulomb as the fundamental unit of charge, with
 1271 # derived units that parallel the conventional terminology but use the stat-
 1272 # prefix.  The statcoulomb is designed by setting k_C=1, which means
 1273 #
 1274 #                      dyne = statcoulomb^2 / cm^2. 
 1275 #
 1276 # The statcoulomb is also called the franklin or esu.
 1277 #
 1278 # The ESU system was specified by a committee report in 1873 and rarely used.
 1279 
 1280 statcoulomb             10 coulomb cm / s c   # Charge such that two charges 
 1281 esu                     statcoulomb           # of 1 statC separated by 1 cm
 1282 statcoul                statcoulomb           # exert a force of 1 dyne
 1283 statC                   statcoulomb
 1284 stC                     statcoulomb
 1285 franklin                statcoulomb
 1286 Fr                      franklin
 1287 
 1288 !var UNITS_SYSTEM esu
 1289 !message CGS-ESU units selected
 1290 !prompt (ESU)
 1291 +statcoulomb            sqrt(dyne) cm
 1292 +A                      0.1 statamp c/(cm/s)
 1293 +mu0                    1/c^2
 1294 +coulombconst           1
 1295 !endvar
 1296 
 1297 statampere              statcoulomb / s
 1298 statamp                 statampere
 1299 statA                   statampere
 1300 stA                     statampere
 1301 statvolt                dyne cm / statamp sec
 1302 statV                   statvolt
 1303 stV                     statvolt
 1304 statfarad               statamp sec / statvolt
 1305 statF                   statfarad
 1306 stF                     statfarad
 1307 cmcapacitance           statfarad
 1308 stathenry               statvolt sec / statamp
 1309 statH                   stathenry
 1310 stH                     stathenry
 1311 statohm                 statvolt / statamp
 1312 stohm                   statohm
 1313 statmho                 /statohm
 1314 stmho                   statmho
 1315 statweber               statvolt sec
 1316 statWb                  statweber
 1317 stWb                    statweber
 1318 stattesla               statWb/cm^2   # Defined by analogy with SI; rarely
 1319 statT                   stattesla     #   if ever used
 1320 stT                     stattesla
 1321 debye                   1e-10 statC angstrom # unit of electrical dipole moment
 1322 helmholtz               debye/angstrom^2     # Dipole moment per area
 1323 jar                     1000 statfarad       # approx capacitance of Leyden jar
 1324 
 1325 # Electromagnetic CGS (EMU)
 1326 #
 1327 # The abampere is the fundamental unit of this system, with the derived units
 1328 # using the ab- prefix.  The dimensions of the abampere are defined by assuming
 1329 # that k_A=1, which 
 1330 #
 1331 #            [dyne / cm]  = [2 abampere^2 / cm]
 1332 #
 1333 # where the brackets indicate taking the dimension of the unit in base units
 1334 # and discarding any constant factors.  This results in the definition from
 1335 # base CGS units of:
 1336 #
 1337 #            abampere = sqrt(dyne). 
 1338 #
 1339 # The abampere is also called the biot.  The magnetic field unit (the gauss)
 1340 # follows from the assumption that k_B=1, which means
 1341 #
 1342 #            B = 2 I / r,
 1343 #
 1344 # and hence the dimensions of the gauss are given by
 1345 #
 1346 #            [gauss] = [2 abampere / cm]
 1347 #
 1348 # or rewriting in terms of the base units
 1349 #
 1350 #            gauss = abampere / cm.
 1351 #
 1352 # The definition given below is different because it is in a form that
 1353 # gives a valid reduction for SI and ESU and still gives the correct 
 1354 # result in EMU.  (It can be derived from Faraday's law.)  
 1355 #
 1356 # The EMU system was developed by Gauss and Weber and formalized as a system in
 1357 # a committee report by the British Association for the Advancement of Science
 1358 # in 1873.  
 1359 
 1360 abampere                10 A            # Current which produces a force of
 1361 abamp                   abampere        #   2 dyne/cm between two infinitely
 1362 aA                      abampere        #   long wires that are 1 cm apart
 1363 abA                     abampere
 1364 biot                    abampere
 1365 Bi                      biot
 1366 
 1367 !var UNITS_SYSTEM emu
 1368 !message CGS-EMU units selected
 1369 !prompt (EMU)
 1370 +abampere               sqrt(dyne)
 1371 +A                      0.1 abamp
 1372 +mu0                    1
 1373 +coulombconst           c^2
 1374 !endvar
 1375 
 1376 abcoulomb               abamp sec
 1377 abcoul                  abcoulomb
 1378 abC                     abcoulomb
 1379 abfarad                 abampere sec / abvolt
 1380 abF                     abfarad
 1381 abhenry                 abvolt sec / abamp
 1382 abH                     abhenry
 1383 abvolt                  dyne cm  / abamp sec
 1384 abV                     abvolt
 1385 abohm                   abvolt / abamp
 1386 abmho                   /abohm
 1387 gauss                   abvolt sec / cm^2 # The magnetic field 2 cm from a wire
 1388 Gs                      gauss             # carrying a current of 1 abampere
 1389 maxwell                 gauss cm^2        # Also called the "line"
 1390 Mx                      maxwell
 1391 oersted                 gauss / mu0   # From the relation H = B / mu
 1392 Oe                      oersted      
 1393 gilbert                 gauss cm / mu0
 1394 Gb                      gilbert
 1395 Gi                      gilbert
 1396 unitpole                4 pi maxwell	# unit magnetic pole
 1397 emu                     erg/gauss  # "electro-magnetic unit", a measure of
 1398                                    # magnetic moment, often used as emu/cm^3
 1399                                    # to specify magnetic moment density.
 1400 
 1401 # Electromagnetic CGS (Gaussian)
 1402 #
 1403 # The Gaussian system uses the statcoulomb and statamp from the ESU system
 1404 # derived by setting k_C=1, but it defines the magnetic field unit differently
 1405 # by taking k_B=c instead of k_B=1.  As noted above, k_C and k_A are not
 1406 # independent.  With k_C=1 we must have k_A=c^-2.  This results in the magnetic
 1407 # field unit, the gauss, having dimensions give by:
 1408 #
 1409 #         [gauss] = [2 (c^-2) c statamp / cm] = [statamp / c cm]
 1410 #
 1411 # We then define the gauss using base CGS units to obtain
 1412 #
 1413 #         gauss = statamp / ((cm/s) cm) = statcoulomb / cm^2.
 1414 #
 1415 # Note that this definition happens to give the same result as the definition
 1416 # for the EMU system, so the definitions of the gauss are consistent.
 1417 #
 1418 # This definition gives the same dimensions for the E and B fields and was also
 1419 # known as the "symmetric system".  This system was proposed by Hertz in 1888.
 1420 
 1421 !var UNITS_SYSTEM gaussian gauss
 1422 !message CGS-Gaussian units selected
 1423 !prompt (Gaussian)
 1424 +statcoulomb            sqrt(dyne) cm
 1425 +A                      0.1 statamp c/(cm/s)
 1426 +mu0                    1
 1427 +epsilon0               1
 1428 +coulombconst           1                  # The gauss is the B field produced
 1429 +gauss                  statcoulomb / cm^2 # 1 cm from a wire carrying a current
 1430 +weber                  1e8 maxwell        # of 0.5*(c/(cm/s)) stA = 1.5e10 stA
 1431 +bohrmagneton           e hbar / 2 electronmass c
 1432 +nuclearmagneton        e hbar / 2 protonmass c
 1433 !endvar
 1434 
 1435 #
 1436 # Some historical electromagnetic units
 1437 #
 1438 
 1439 intampere               0.999835 A    # Defined as the current which in one
 1440 intamp                  intampere     #   second deposits .001118 gram of
 1441                                       #   silver from an aqueous solution of
 1442                                       #   silver nitrate.
 1443 intfarad                0.999505 F
 1444 intvolt                 1.00033 V
 1445 intohm                  1.000495 ohm  # Defined as the resistance of a
 1446                                       #   uniform column of mercury containing
 1447                                       #   14.4521 gram in a column 1.063 m
 1448                                       #   long and maintained at 0 degC.
 1449 daniell                 1.042 V       # Meant to be electromotive force of a
 1450                                       #   Daniell cell, but in error by .04 V
 1451 faraday                 N_A e mol     # Charge that must flow to deposit or
 1452 faraday_phys            96521.9 C     #   liberate one gram equivalent of any
 1453 faraday_chem            96495.7 C     #   element.  (The chemical and physical
 1454                                       #   values are off slightly from what is
 1455                                       #   obtained by multiplying by amu_chem
 1456                                       #   or amu_phys.  These values are from
 1457                                       #   a 1991 NIST publication.)  Note that
 1458                                       #   there is a Faraday constant which is
 1459                                       #   equal to N_A e and hence has units of
 1460                                       #   C/mol.
 1461 kappline                6000 maxwell  # Named by and for Gisbert Kapp
 1462 siemensunit             0.9534 ohm    # Resistance of a meter long column of
 1463                                       #   mercury with a 1 mm cross section.
 1464 #
 1465 # Printed circuit board units.  
 1466 #
 1467 # http://www.ndt-ed.org/GeneralResources/IACS/IACS.htm.  
 1468 #
 1469 # Conductivity is often expressed as a percentage of IACS.  A copper wire a
 1470 # meter long with a 1 mm^2 cross section has a resistance of 1|58 ohm at 
 1471 # 20 deg C.  Copper density is also standarized at that temperature. 
 1472 #
 1473 
 1474 copperconductivity      58 siemens m / mm^2     # A wire a meter long with
 1475 IACS                    copperconductivity      #   a 1 mm^2 cross section
 1476 copperdensity           8.89 g/cm^3             # The "ounce" measures the     
 1477 ouncecopper             oz / ft^2 copperdensity #   thickness of copper used   
 1478 ozcu                    ouncecopper             #   in circuitboard fabrication
 1479                                                 
 1480 #
 1481 # Photometric units
 1482 #
 1483 
 1484 LUMINOUS_INTENSITY      candela
 1485 LUMINOUS_FLUX           lumen
 1486 LUMINOUS_ENERGY         talbot
 1487 ILLUMINANCE             lux
 1488 EXITANCE                lux
 1489 
 1490 candle                  1.02 candela  # Standard unit for luminous intensity
 1491 hefnerunit              0.9 candle    #   in use before candela
 1492 hefnercandle            hefnerunit    #
 1493 violle                  20.17 cd      # luminous intensity of 1 cm^2 of
 1494                                       #   platinum at its temperature of
 1495                                       #   solidification (2045 K)
 1496 
 1497 lumen                   cd sr         # Luminous flux (luminous energy per
 1498 lm                      lumen         #    time unit)
 1499 
 1500 talbot                  lumen s       # Luminous energy
 1501 lumberg                 talbot        # References give these values for
 1502 lumerg                  talbot        #    lumerg and lumberg both.  Note that
 1503                                       #    a paper from 1948 suggests that
 1504                                       #    lumerg should be 1e-7 talbots so
 1505                                       #    that lumergs/erg = talbots/joule.
 1506                                       #    lumerg = luminous erg
 1507 lux                     lm/m^2        # Illuminance or exitance (luminous
 1508 lx                      lux           #   flux incident on or coming from
 1509 phot                    lumen / cm^2  #   a surface)
 1510 ph                      phot          #
 1511 footcandle              lumen/ft^2    # Illuminance from a 1 candela source
 1512                                       #    at a distance of one foot
 1513 metercandle             lumen/m^2     # Illuminance from a 1 candela source
 1514                                       #    at a distance of one meter
 1515 
 1516 mcs                     metercandle s # luminous energy per area, used to
 1517                                       #    measure photographic exposure
 1518 
 1519 nox                     1e-3 lux      # These two units were proposed for
 1520 skot                    1e-3 apostilb # measurements relating to dark adapted
 1521                                       # eyes.
 1522 # Luminance measures
 1523 
 1524 LUMINANCE               nit
 1525 
 1526 nit                     cd/m^2        # Luminance: the intensity per projected
 1527 stilb                   cd / cm^2     # area of an extended luminous source.
 1528 sb                      stilb         # (nit is from latin nitere = to shine.)
 1529 
 1530 apostilb                cd/pi m^2
 1531 asb                     apostilb
 1532 blondel                 apostilb      # Named after a French scientist.
 1533 
 1534 # Equivalent luminance measures.  These units are units which measure
 1535 # the luminance of a surface with a specified exitance which obeys
 1536 # Lambert's law.  (Lambert's law specifies that luminous intensity of
 1537 # a perfectly diffuse luminous surface is proportional to the cosine
 1538 # of the angle at which you view the luminous surface.)
 1539 
 1540 equivalentlux           cd / pi m^2   # luminance of a 1 lux surface
 1541 equivalentphot          cd / pi cm^2  # luminance of a 1 phot surface
 1542 lambert                 cd / pi cm^2
 1543 footlambert             cd / pi ft^2
 1544 
 1545 # The bril is used to express "brilliance" of a source of light on a
 1546 # logarithmic scale to correspond to subjective perception.  An increase of 1
 1547 # bril means doubling the luminance.  A luminance of 1 lambert is defined to
 1548 # have a brilliance of 1 bril.
 1549 
 1550 bril(x) units=[1;lambert]  2^(x+-100) lamberts ;log2(bril/lambert)+100
 1551 
 1552 # Some luminance data from the IES Lighting Handbook, 8th ed, 1993
 1553 
 1554 sunlum                  1.6e9 cd/m^2  # at zenith
 1555 sunillum                100e3 lux     # clear sky
 1556 sunillum_o              10e3 lux      # overcast sky
 1557 sunlum_h                6e6 cd/m^2    # value at horizon
 1558 skylum                  8000 cd/m^2   # average, clear sky
 1559 skylum_o                2000 cd/m^2   # average, overcast sky
 1560 moonlum                 2500 cd/m^2
 1561 
 1562 #
 1563 # Photographic Exposure Value
 1564 # This section by Jeff Conrad (jeff_conrad@msn.com)
 1565 #
 1566 # The Additive system of Photographic EXposure (APEX) proposed in ASA
 1567 # PH2.5-1960 was an attempt to simplify exposure determination for people who
 1568 # relied on exposure tables rather than exposure meters.  Shortly thereafter,
 1569 # nearly all cameras incorporated exposure meters, so the APEX system never
 1570 # caught on, but the concept of exposure value remains in use.  Though given as
 1571 # 'Ev' in ASA PH2.5-1960, it is now more commonly indicated by 'EV'.  EV is
 1572 # related to exposure parameters by
 1573 #
 1574 #            A^2   LS   ES
 1575 #     2^EV = --- = -- = --
 1576 #             t    K    C
 1577 #
 1578 # Where
 1579 #     A = Relative aperture (f-number)
 1580 #     t = Exposure time in seconds
 1581 #     L = Scene luminance in cd/m2
 1582 #     E = Scene illuminance in lux
 1583 #     S = Arithmetic ISO speed
 1584 #     K = Reflected-light meter calibration constant
 1585 #     C = Incident-light meter calibration constant
 1586 #
 1587 # Strictly, an exposure value is a combination of aperture and exposure time,
 1588 # but it's also commonly used to indicate luminance (or illuminance).
 1589 # Conversion to luminance or illuminance units depends on the ISO speed and the
 1590 # meter calibration constant.  Common practice is to use an ISO speed of 100.
 1591 # Calibration constants vary among camera and meter manufacturers: Canon,
 1592 # Nikon, and Sekonic use a value of 12.5 for reflected-light meters, while
 1593 # Kenko (formerly Minolta) and Pentax use a value of 14.  Kenko and Sekonic use
 1594 # a value of 250 for incident-light meters with flat receptors.
 1595 #
 1596 # The values for in-camera meters apply only averaging, weighted-averaging, or
 1597 # spot metering--the multi-segment metering incorporated in most current
 1598 # cameras uses proprietary algorithms that evaluate many factors related to the
 1599 # luminance distribution of what is being metered; they are not amenable to
 1600 # simple conversions, and are usually not disclosed by the manufacturers.
 1601 
 1602 s100                    100 / lx s            # ISO 100 speed
 1603 iso100                  s100
 1604 
 1605 # Reflected-light meter calibration constant with ISO 100 speed
 1606 
 1607 k1250                   12.5 (cd/m2) / lx s   # For Canon, Nikon, and Sekonic
 1608 k1400                   14   (cd/m2) / lx s   # For Kenko (Minolta) and Pentax
 1609 
 1610 # Incident-light meter calibration constant with ISO 100 film
 1611 
 1612 c250                    250 lx / lx s         # flat-disc receptor
 1613 
 1614 # Exposure value to scene luminance with ISO 100 imaging media
 1615 
 1616 # For Kenko (Minolta) or Pentax
 1617 #ev100(x) units=[;cd/m^2] range=(0,) 2^x k1400 / s100; log2(ev100 s100/k1400)
 1618 # For Canon, Nikon, or Sekonic
 1619 ev100(x) units=[1;cd/m^2] range=(0,) 2^x k1250 / s100; log2(ev100 s100/k1250)
 1620 EV100()  ev100
 1621 
 1622 # Exposure value to scene illuminance with ISO 100 imaging media
 1623 
 1624 iv100(x) units=[1;lx] range=(0,) 2^x c250 / s100; log2(iv100 s100 / c250)
 1625 
 1626 # Other Photographic Exposure Conversions
 1627 # 
 1628 # As part of APEX, ASA PH2.5-1960 proposed several logarithmic quantities
 1629 # related by
 1630 #
 1631 #    Ev = Av + Tv = Bv + Sv
 1632 #
 1633 # where
 1634 #  Av = log2(A^2)       Aperture value
 1635 #  Tv = log2(1/t)       Time value
 1636 #  Sv = log2(N Sx)      Speed value
 1637 #  Bv = log2(B S / K)   Luminance ("brightness") value
 1638 #  Iv = log2(I S / C)   Illuminance value
 1639 #
 1640 # and
 1641 #  A  = Relative aperture (f-number)
 1642 #  t  = Exposure time in seconds
 1643 #  Sx = Arithmetic ISO speed in 1/lux s
 1644 #  B  = luminance in cd/m2
 1645 #  I  = luminance in lux
 1646 
 1647 # The constant N derives from the arcane relationship between arithmetic
 1648 # and logarithmic speed given in ASA PH2.5-1960.  That relationship
 1649 # apparently was not obvious--so much so that it was thought necessary
 1650 # to explain it in PH2.12-1961.  The constant has had several values
 1651 # over the years, usually without explanation for the changes.  Although
 1652 # APEX had little impact on consumer cameras, it has seen a partial
 1653 # resurrection in the Exif standards published by the Camera & Imaging
 1654 # Products Association of Japan.
 1655 
 1656 #N_apex         2^-1.75 lx s    # precise value implied in ASA PH2.12-1961,
 1657                                 # derived from ASA PH2.5-1960.
 1658 #N_apex         0.30 lx s       # rounded value in ASA PH2.5-1960, 
 1659                                 # ASA PH2.12-1961, and ANSI PH2.7-1986
 1660 #N_apex         0.3162 lx s     # value in ANSI PH2.7-1973
 1661 N_exif          1|3.125 lx s    # value in Exif 2.3 (2010), making Sv(5) = 100
 1662 K_apex1961      11.4 (cd/m2) / lx s    # value in ASA PH2.12-1961
 1663 K_apex1971      12.5 (cd/m2) / lx s    # value in ANSI PH3.49-1971; more common
 1664 C_apex1961      224 lx / lx s   # value in PH2.12-1961 (20.83 for I in 
 1665                                 #   footcandles; flat sensor?)
 1666 C_apex1971      322 lx / lx s   # mean value in PH3.49-1971 (30 +/- 5 for I in
 1667                                 # footcandles; hemispherical sensor?)
 1668 N_speed         N_exif
 1669 K_lum           K_apex1971
 1670 C_illum         C_apex1961
 1671 
 1672 # Units for Photographic Exposure Variables
 1673 #
 1674 # Practical photography sometimes pays scant attention to units for exposure
 1675 # variables.  In particular, the "speed" of the imaging medium is treated as if
 1676 # it were dimensionless when it should have units of reciprocal lux seconds;
 1677 # this practice works only because "speed" is almost invariably given in
 1678 # accordance with international standards (or similar ones used by camera
 1679 # manufacturers)--so the assumed units are invariant.  In calculating
 1680 # logarithmic quantities--especially the time value Tv and the exposure value
 1681 # EV--the units for exposure time ("shutter speed") are often ignored; this
 1682 # practice works only because the units of exposure time are assumed to be in
 1683 # seconds, and the missing units that make the argument to the logarithmic
 1684 # function dimensionless are silently provided.
 1685 #
 1686 # In keeping with common practice, the definitions that follow treat "speeds"
 1687 # as dimensionless, so ISO 100 speed is given simply as '100'.  When
 1688 # calculating the logarithmic APEX quantities Av and Tv, the definitions
 1689 # provide the missing units, so the times can be given with any appropriate
 1690 # units.  For example, giving an exposure time of 1 minute as either '1 min' or
 1691 # '60 s' will result in Tv of -5.9068906.
 1692 #
 1693 # Exposure Value from f-number and Exposure Time
 1694 # 
 1695 # Because nonlinear unit conversions only accept a single quantity,
 1696 # there is no direct conversion from f-number and exposure time to
 1697 # exposure value EV.  But the EV can be obtained from a combination of
 1698 # Av and Tv.  For example, the "sunny 16" rule states that correct
 1699 # exposure for a sunlit scene can achieved by using f/16 and an exposure
 1700 # time equal to the reciprocal of the ISO speed in seconds; this can be
 1701 # calculated as
 1702 #
 1703 #    ~Av(16) + ~Tv(1|100 s),
 1704 #
 1705 # which gives 14.643856.  These conversions may be combined with the
 1706 # ev100 conversion:
 1707 #
 1708 #    ev100(~Av(16) + ~Tv(1|100 s))
 1709 #
 1710 # to yield the assumed average scene luminance of 3200 cd/m^2.
 1711 
 1712 # convert relative aperture (f-number) to aperture value
 1713 Av(A)           units=[1;1] domain=[-2,) range=[0.5,)  2^(A/2); 2 log2(Av)
 1714 # convert exposure time to time value
 1715 Tv(t)           units=[1;s] range=(0,)  2^(-t) s; log2(s / Tv)
 1716 # convert logarithmic speed Sv in ASA PH2.5-1960 to ASA/ISO arithmetic speed;
 1717 # make arithmetic speed dimensionless
 1718 # 'Sv' conflicts with the symbol for sievert; you can uncomment this function
 1719 # definition if you don't need that symbol
 1720 #Sv(S)    units=[1;1] range=(0,) 2^S / (N_speed/lx s); log2((N_speed/lx s) Sv)
 1721 Sval(S)   units=[1;1] range=(0,) 2^S / (N_speed/lx s); log2((N_speed/lx s) Sval)
 1722 
 1723 # convert luminance value Bv in ASA PH2.12-1961 to luminance
 1724 Bv(x)           units=[1;cd/m^2] range=(0,) \
 1725                 2^x K_lum N_speed ; log2(Bv / (K_lum N_speed))
 1726 
 1727 # convert illuminance value Iv in ASA PH2.12-1961 to illuminance
 1728 Iv(x)           units=[1;lx] range=(0,) \
 1729                 2^x C_illum N_speed ; log2(Iv / (C_illum N_speed))
 1730 
 1731 # convert ASA/ISO arithmetic speed Sx to ASA logarithmic speed in 
 1732 # ASA PH2.5-1960; make arithmetic speed dimensionless
 1733 Sx(S)           units=[1;1] domain=(0,) \
 1734                 log2((N_speed/lx s) S); 2^Sx / (N_speed/lx s)
 1735 
 1736 # convert DIN speed/ISO logarithmic speed in ISO 6:1993 to arithmetic speed
 1737 # for convenience, speed is treated here as if it were dimensionless
 1738 Sdeg(S)         units=[1;1] range=(0,) 10^((S - 1) / 10) ; (1 + 10 log(Sdeg))
 1739 Sdin()          Sdeg
 1740 
 1741 # Numerical Aperture and f-Number of a Lens
 1742 #
 1743 # The numerical aperture (NA) is given by
 1744 #
 1745 #   NA = n sin(theta)
 1746 #
 1747 # where n is the index of refraction of the medium and theta is half
 1748 # of the angle subtended by the aperture stop from a point in the image
 1749 # or object plane. For a lens in air, n = 1, and
 1750 #
 1751 #   NA = 0.5 / f-number
 1752 #
 1753 # convert NA to f-number
 1754 numericalaperture(x) units=[1;1] domain=(0,1] range=[0.5,) \
 1755                      0.5 / x ; 0.5 / numericalaperture
 1756 NA()            numericalaperture
 1757 #
 1758 # convert f-number to itself; restrict values to those possible
 1759 fnumber(x)      units=[1;1] domain=[0.5,) range=[0.5,) x ; fnumber
 1760 
 1761 # Referenced Photographic Standards
 1762 #
 1763 # ASA PH-2.5-1960. USA Standard, Method for Determining (Monochrome,
 1764 #    Continuous-Tone) Speed of Photographic Negative Materials.
 1765 # ASA PH2.12-1961. American Standard, General-Purpose Photographic
 1766 #    Exposure Meters (photoelectric type).
 1767 # ANSI PH3.49-1971. American National Standard for general-purpose
 1768 #    photographic exposure meters (photoelectric type).
 1769 # ANSI PH2.7-1973. American National Standard Photographic Exposure Guide.
 1770 # ANSI PH2.7-1986. American National Standard for Photography --
 1771 #    Photographic Exposure Guide.
 1772 # CIPA DC-008-2010. Exchangeable image file format for digital still
 1773 #    cameras: Exif Version 2.3
 1774 # ISO 6:1993.  International Standard, Photography -- Black-and-white
 1775 #    pictorial still camera negative film/process systems --
 1776 #    Determination of ISO Speed.
 1777 
 1778 
 1779 #
 1780 # Astronomical time measurements
 1781 #
 1782 # Astronomical time measurement is a complicated matter.  The length of the
 1783 # true day at a given place can be 21 seconds less than 24 hours or 30 seconds
 1784 # over 24 hours.  The two main reasons for this are the varying speed of the
 1785 # earth in its elliptical orbit and the fact that the sun moves on the ecliptic
 1786 # instead of along the celestial equator.  To devise a workable system for time
 1787 # measurement, Simon Newcomb (1835-1909) used a fictitious "mean sun".
 1788 # Consider a first fictitious sun traveling along the ecliptic at a constant
 1789 # speed and coinciding with the true sun at perigee and apogee.  Then
 1790 # considering a second fictitious sun traveling along the celestial equator at
 1791 # a constant speed and coinciding with the first fictitious sun at the
 1792 # equinoxes.  The second fictitious sun is the "mean sun".  From this equations
 1793 # can be written out to determine the length of the mean day, and the tropical
 1794 # year.  The length of the second was determined based on the tropical year
 1795 # from such a calculation and was officially used from 1960-1967 until atomic
 1796 # clocks replaced astronomical measurements for a standard of time.  All of the
 1797 # values below give the mean time for the specified interval.
 1798 #
 1799 # See "Mathematical Astronomy Morsels" by Jean Meeus for more details
 1800 # and a description of how to compute the correction to mean time.
 1801 #
 1802 
 1803 TIME                    second
 1804 
 1805 anomalisticyear         365.2596 days       # The time between successive
 1806                                             #   perihelion passages of the
 1807                                             #   earth.
 1808 siderealyear            365.256360417 day   # The time for the earth to make
 1809                                             #   one revolution around the sun
 1810                                             #   relative to the stars.
 1811 tropicalyear            365.242198781 day   # The time needed for the mean sun
 1812                                             #   as defined above to increase
 1813                                             #   its longitude by 360 degrees.
 1814                                             #   Most references defined the
 1815                                             #   tropical year as the interval
 1816                                             #   between vernal equinoxes, but
 1817                                             #   this is misleading.  The length
 1818                                             #   of the season changes over time
 1819                                             #   because of the eccentricity of
 1820                                             #   the earth's orbit.  The time
 1821                                             #   between vernal equinoxes is
 1822                                             #   approximately 365.24237 days
 1823                                             #   around the year 2000.  See
 1824                                             #   "Mathematical Astronomy
 1825                                             #   Morsels" for more details.
 1826 eclipseyear             346.62 days         # The line of nodes is the
 1827                                             #   intersection of the plane of
 1828                                             #   Earth's orbit around the sun
 1829                                             #   with the plane of the moon's
 1830                                             #   orbit around earth.  Eclipses
 1831                                             #   can only occur when the moon
 1832                                             #   and sun are close to this
 1833                                             #   line.  The line rotates and
 1834                                             #   appearances of the sun on the
 1835                                             #   line of nodes occur every
 1836                                             #   eclipse year.
 1837 saros                   223 synodicmonth    # The earth, moon and sun appear in
 1838                                             #   the same arrangement every
 1839                                             #   saros, so if an eclipse occurs,
 1840                                             #   then one saros later, a similar
 1841                                             #   eclipse will occur.  (The saros
 1842                                             #   is close to 19 eclipse years.)
 1843                                             #   The eclipse will occur about
 1844                                             #   120 degrees west of the
 1845                                             #   preceeding one because the
 1846                                             #   saros is not an even number of
 1847                                             #   days.  After 3 saros, an
 1848                                             #   eclipse will occur at
 1849                                             #   approximately the same place.
 1850 siderealday             86164.09054 s       # The sidereal day is the interval
 1851 siderealhour            1|24 siderealday    #   between two successive transits
 1852 siderealminute          1|60 siderealhour   #   of a star over the meridian,
 1853 siderealsecond          1|60 siderealminute #   or the time required  for the
 1854                                             #   earth to make one rotation
 1855                                             #   relative to the stars.  The
 1856                                             #   more usual solar day is the
 1857                                             #   time required to make a
 1858                                             #   rotation relative to the sun.
 1859                                             #   Because the earth moves in its
 1860                                             #   orbit, it has to turn a bit
 1861                                             #   extra to face the sun again,
 1862                                             #   hence the solar day is slightly
 1863                                             #   longer.
 1864 anomalisticmonth        27.55454977 day     # Time for the moon to travel from
 1865                                             #   perigee to perigee
 1866 nodicalmonth            27.2122199 day      # The nodes are the points where
 1867 draconicmonth           nodicalmonth        #   an orbit crosses the ecliptic.
 1868 draconiticmonth         nodicalmonth        #   This is the time required to
 1869                                             #   travel from the ascending node
 1870                                             #   to the next ascending node.
 1871 siderealmonth           27.321661 day       # Time required for the moon to
 1872                                             #   orbit the earth
 1873 lunarmonth              29 days + 12 hours + 44 minutes + 2.8 seconds
 1874                                             # Mean time between full moons.
 1875 synodicmonth            lunarmonth          #   Full moons occur when the sun
 1876 lunation                synodicmonth        #   and moon are on opposite sides
 1877 lune                    1|30 lunation       #   of the earth.  Since the earth
 1878 lunour                  1|24 lune           #   moves around the sun, the moon
 1879                                             #   has to revolve a bit extra to
 1880                                             #   get into the full moon
 1881                                             #   configuration.
 1882 year                    tropicalyear
 1883 yr                      year
 1884 month                   1|12 year
 1885 mo                      month
 1886 lustrum                 5 years             # The Lustrum was a Roman
 1887                                             #   purification ceremony that took
 1888                                             #   place every five years.
 1889                                             #   Classically educated Englishmen
 1890                                             #   used this term.
 1891 decade                  10 years
 1892 century                 100 years
 1893 millennium              1000 years
 1894 millennia               millennium
 1895 solaryear               year
 1896 lunaryear               12 lunarmonth
 1897 calendaryear            365 day
 1898 commonyear              365 day
 1899 leapyear                366 day
 1900 julianyear              365.25 day
 1901 gregorianyear           365.2425 day
 1902 islamicyear             354 day          # A year of 12 lunar months. They
 1903 islamicleapyear         355 day          # began counting on July 16, AD 622
 1904                                          # when Muhammad emigrated to Medina
 1905                                          # (the year of the Hegira).  They need
 1906                                          # 11 leap days in 30 years to stay in
 1907                                          # sync with the lunar year which is a
 1908                                          # bit longer than the 29.5 days of the
 1909                                          # average month.  The months do not
 1910                                          # keep to the same seasons, but
 1911                                          # regress through the seasons every
 1912                                          # 32.5 years.
 1913 islamicmonth            1|12 islamicyear # They have 29 day and 30 day months.
 1914 
 1915 # The Hewbrew year is also based on lunar months, but synchronized to the solar
 1916 # calendar.  The months vary irregularly between 29 and 30 days in length, and
 1917 # the years likewise vary.  The regular year is 353, 354, or 355 days long.  To
 1918 # keep up with the solar calendar, a leap month of 30 days is inserted every
 1919 # 3rd, 6th, 8th, 11th, 14th, 17th, and 19th years of a 19 year cycle.  This
 1920 # gives leap years that last 383, 384, or 385 days.
 1921 
 1922 
 1923 # Sidereal days
 1924 
 1925 mercuryday              58.6462 day
 1926 venusday                243.01 day        # retrograde
 1927 earthday                siderealday
 1928 marsday                 1.02595675 day
 1929 jupiterday              0.41354 day
 1930 saturnday               0.4375 day
 1931 uranusday               0.65 day          # retrograde
 1932 neptuneday              0.768 day
 1933 plutoday                6.3867 day
 1934 
 1935 # Sidereal years from http://ssd.jpl.nasa.gov/phys_props_planets.html.  Data
 1936 # was updated in May 2001 based on the 1992 Explanatory Supplement to the
 1937 # Astronomical Almanac and the mean longitude rates.  Apparently the table of
 1938 # years in that reference is incorrect.
 1939 
 1940 mercuryyear             0.2408467 julianyear
 1941 venusyear               0.61519726 julianyear
 1942 earthyear               siderealyear
 1943 marsyear                1.8808476 julianyear
 1944 jupiteryear             11.862615 julianyear
 1945 saturnyear              29.447498 julianyear
 1946 uranusyear              84.016846 julianyear
 1947 neptuneyear             164.79132 julianyear
 1948 plutoyear               247.92065 julianyear
 1949 
 1950 # Objects on the earth are charted relative to a perfect ellipsoid whose
 1951 # dimensions are specified by different organizations.  The ellipsoid is
 1952 # specified by an equatorial radius and a flattening value which defines the
 1953 # polar radius.  These values are the 1996 values given by the International
 1954 # Earth Rotation Service (IERS) whose reference documents can be found at
 1955 # http://maia.usno.navy.mil/
 1956 
 1957 earthflattening         1|298.25642
 1958 earthradius_equatorial  6378136.49 m
 1959 earthradius_polar       (-earthflattening+1) earthradius_equatorial
 1960 
 1961 landarea                148.847e6 km^2
 1962 oceanarea               361.254e6 km^2
 1963 
 1964 moonradius              1738 km         # mean value
 1965 sunradius               6.96e8 m
 1966 
 1967 # Many astronomical values can be measured most accurately in a system of units
 1968 # using the astronomical unit and the mass of the sun as base units.  The
 1969 # uncertainty in the gravitational constant makes conversion to SI units
 1970 # significantly less accurate.
 1971 
 1972 # The astronomical unit was defined to be the length of the of the semimajor
 1973 # axis of a massless object with the same year as the earth.  With such a
 1974 # definition in force, and with the mass of the sun set equal to one, Kepler's
 1975 # third law can be used to solve for the value of the gravitational constant.
 1976 
 1977 # Kepler's third law says that (2 pi / T)^2 a^3 = G M where T is the orbital
 1978 # period, a is the size of the semimajor axis, G is the gravitational constant
 1979 # and M is the mass.  With M = 1 and T and a chosen for the earth's orbit, we
 1980 # find sqrt(G) = (2 pi / T) sqrt(AU^3).  This constant is called the Gaussian
 1981 # gravitational constant, apparently because Gauss originally did the
 1982 # calculations.  However, when the original calculation was done, the value
 1983 # for the length of the earth's year was inaccurate.  The value used is called
 1984 # the Gaussian year.  Changing the astronomical unit to bring it into
 1985 # agreement with more accurate values for the year would have invalidated a
 1986 # lot of previous work, so instead the astronomical unit has been kept equal
 1987 # to this original value.  This is accomplished by using a standard value for
 1988 # the Gaussian gravitational constant.  This constant is called k.
 1989 # Many values below are from http://ssd.jpl.nasa.gov/?constants
 1990 
 1991 gauss_k                 0.01720209895   # This beast has dimensions of
 1992                                         # au^(3|2) / day and is exact.
 1993 gaussianyear      (2 pi / gauss_k) days # Year that corresponds to the Gaussian
 1994                                         # gravitational constant. This is a
 1995                                         # fictional year, and doesn't
 1996                                         # correspond to any celestial event.
 1997 astronomicalunit         149597870700 m # IAU definition from 2012, exact
 1998 au                     astronomicalunit # ephemeris for the above described
 1999                                         # astronomical unit.  (See the NASA
 2000                                         # site listed above.)
 2001 solarmass                  1.9891e30 kg
 2002 sunmass                       solarmass
 2003 
 2004 
 2005 sundist                 1.0000010178 au # mean earth-sun distance
 2006 moondist                3.844e8 m       # mean earth-moon distance
 2007 sundist_near            1.471e11 m      # earth-sun distance at perihelion
 2008 sundist_far             1.521e11 m      # earth-sun distance at aphelion
 2009 moondist_min		3.564e8 m	# approximate least distance at
 2010                                         #    perigee 1901-2300
 2011 moondist_max		4.067e8 m	# approximate greatest distance at
 2012                                         #    apogee 1901-2300
 2013 
 2014 
 2015 # The following are masses for planetary systems, not just the planet itself.
 2016 # The comments give the uncertainty in the denominators.  As noted above,
 2017 # masses are given relative to the solarmass because this is more accurate.
 2018 # The conversion to SI is uncertain because of uncertainty in G, the
 2019 # gravitational constant.
 2020 #
 2021 # Values are from http://ssd.jpl.nasa.gov/astro_constants.html
 2022 
 2023 mercurymass             solarmass / 6023600   # 250
 2024 venusmass               solarmass / 408523.71 # 0.06
 2025 earthmoonmass           solarmass / 328900.56 # 0.02
 2026 marsmass                solarmass / 3098708   # 9
 2027 jupitermass             solarmass / 1047.3486 # 0.0008
 2028 saturnmass              solarmass / 3497.898  # 0.018
 2029 uranusmass              solarmass / 22902.98  # 0.03
 2030 neptunemass             solarmass / 19412.24  # 0.04
 2031 plutomass               solarmass / 1.35e8    # 0.07e8
 2032 
 2033 moonearthmassratio      0.012300034 # uncertainty 3e-9
 2034 earthmass               earthmoonmass / ( 1 + moonearthmassratio)
 2035 moonmass                moonearthmassratio earthmass
 2036 
 2037 # These are the old values for the planetary masses.  They may give
 2038 # the masses of the planets alone.
 2039 
 2040 oldmercurymass             0.33022e24 kg
 2041 oldvenusmass               4.8690e24 kg
 2042 oldmarsmass                0.64191e24 kg
 2043 oldjupitermass             1898.8e24 kg
 2044 oldsaturnmass              568.5e24 kg
 2045 olduranusmass              86.625e24 kg
 2046 oldneptunemass             102.78e24 kg
 2047 oldplutomass               0.015e24 kg
 2048 
 2049 # Mean radius from http://ssd.jpl.nsaa.gov/phys_props_planets.html which in
 2050 # turn cites Global Earth Physics by CF Yoder, 1995.
 2051 
 2052 mercuryradius           2440 km
 2053 venusradius             6051.84 km
 2054 earthradius             6371.01 km
 2055 marsradius              3389.92 km
 2056 jupiterradius           69911 km
 2057 saturnradius            58232 km
 2058 uranusradius            25362 km
 2059 neptuneradius           24624 km
 2060 plutoradius             1151 km
 2061 
 2062 moongravity             1.62 m/s^2
 2063 
 2064 # The Hubble constant gives the speed at which distance galaxies are moving
 2065 # away from the earth according to v = H0*d, where H0 is the hubble constant
 2066 # and d is the distance to the galaxy.
 2067 
 2068 hubble                  70 km/s/Mpc        # approximate
 2069 H0                      hubble
 2070 
 2071 # Parallax is the angular difference between the topocentric (on Earth's
 2072 # surface) and geocentric (at Earth's center) direction toward a celestial body
 2073 # when the body is at a given altitude.  When the body is on the horizon, the
 2074 # parallax is the horizontal parallax; when the body is on the horizon and the
 2075 # observer is on the equator, the parallax is the equatorial horizontal
 2076 # parallax.  When the body is at zenith, the parallax is zero.
 2077 
 2078 lunarparallax  asin(earthradius_equatorial / moondist) # Moon equatorial 
 2079 moonhp         lunarparallax                           # horizontal parallax
 2080                                                        # at mean distance
 2081 
 2082 # Light from celestial objects is attenuated by passage through Earth's
 2083 # atmosphere.  A body near the horizon passes through much more air than an
 2084 # object at zenith, and is consequently less bright.  Air mass is the ratio of
 2085 # the length of the optical path at a given altitude (angle above the horizon)
 2086 # to the length at zenith.  Air mass at zenith is by definition unity; at the
 2087 # horizon, air mass is approximately 38, though the latter value can vary
 2088 # considerably with atmospheric conditions.  The general formula is # E = E0
 2089 # exp(-c X), where E0 is the value outside Earth's atmosphere, E is the value
 2090 # seen by an observer, X is the air mass and c is the extinction coefficient.
 2091 # A common value for c in reasonably clear air is 0.21, but values can be
 2092 # considerably greater in urban areas.  Apparent altitude is that perceived by
 2093 # an observer; it includes the effect of atmospheric refraction.  There is no
 2094 # shortage of formulas for air mass
 2095 # (https://en.wikipedia.org/wiki/Air_mass_(astronomy)); all are subject to
 2096 # variations in local atmospheric conditions.  The formula used here is simple
 2097 # and is in good agreement with rigorously calculated values under standard
 2098 # conditions.
 2099 #
 2100 # Extraterrestrial illuminance or luminance of an object at a given altitude
 2101 # determined with vmag() or SB_xxx() below can be multiplied by
 2102 # atm_transmission() or atm_transmissionz() to estimate the terrestrial value.
 2103 #
 2104 # Kasten and Young (1989) air mass formula. alt is apparent altitude
 2105 # Reference:
 2106 # Kasten, F., and A.T. Young. 1989. "Revised Optical Air Mass Tables
 2107 #     and Approximation Formula."  Applied Optics.  Vol. 28, 4735–4738.
 2108 #     Bibcode:1989ApOpt..28.4735K. doi:10.1364/AO.28.004735.
 2109 
 2110 airmass(alt) units=[degree;1] domain=[0,90] noerror \
 2111     1 / (sin(alt) + 0.50572 (alt / degree + 6.07995)^-1.6364)
 2112 
 2113 # zenith is apparent zenith angle (zenith = 90 deg - alt)
 2114 airmassz(zenith) units=[degree;1] domain=[0,90] noerror \
 2115     1 / (cos(zenith) + 0.50572 (96.07995 - zenith / degree)^-1.6364)
 2116 
 2117 # For reasonably clear air at sea level; values may need adjustment for
 2118 # elevation and local atmospheric conditions
 2119 # for scotopic vision (510 nm), appropriate for the dark-adapted eye
 2120 # extinction_coeff           0.26
 2121 # for photopic vision, appropriate for observing brighter objects such
 2122 # as the full moon
 2123 extinction_coeff	0.21
 2124 
 2125 atm_transmission(alt) units=[degree;1] domain=[0,90] noerror \
 2126     exp(-extinction_coeff airmass(alt))
 2127 
 2128 # in terms of zenith angle (zenith = 90 deg - alt)
 2129 atm_transmissionz(zenith) units=[degree;1] domain=[0,90] noerror \
 2130     exp(-extinction_coeff airmassz(zenith))
 2131 
 2132 # Moon and Sun data at mean distances
 2133 moonvmag	-12.74	# Moon apparent visual magnitude at mean distance
 2134 sunvmag		-26.74	# Sun apparent visual magnitude at mean distance
 2135 moonsd	asin(moonradius / moondist) # Moon angular semidiameter at mean distance
 2136 sunsd	asin(sunradius / sundist)   # Sun angular semidiameter at mean distance
 2137 
 2138 # Visual magnitude of star or other celestial object.  The system of stellar
 2139 # magnitudes, developed in ancient Greece, assigned magnitudes from 1
 2140 # (brightest) to 6 (faintest visible to the naked eye).  In 1856, British
 2141 # astronomer Norman Pogson made the system precise, with a magnitude 1 object
 2142 # 100 times as bright as a magnitude 6 object, and each magnitude differing
 2143 # from the next by a constant ratio; the ratio, sometimes known as Pogson's
 2144 # ratio, is thus 100^0.2, or approximately 2.5119.  The logarithm of 100^0.2 is
 2145 # 0.4, hence the common use of powers of 10 and base-10 logarithms.
 2146 #
 2147 # Reference:
 2148 # Allen, C.W. 1976.  Astrophysical Quantities, 3rd ed. 1973, reprinted
 2149 #     with corrections, 1976.  London: Athlone.
 2150 #
 2151 # The function argument is the (dimensionless) visual magnitude; reference
 2152 # illuminance of 2.54e-6 lx is from Allen (2000, 21), and is for outside
 2153 # Earth's atmosphere.  Illuminance values can be adjusted to terrestrial values
 2154 # by multiplying by one of the atm_transmission functions above.
 2155 
 2156 # Illuminance from apparent visual magnitude
 2157 vmag(mag) units=[1;lx] domain=[,]  range=(0,] \
 2158     2.54e-6 lx 10^(-0.4 mag); -2.5 log(vmag / (2.54e-6 lx))
 2159 
 2160 # Surface brightness of a celestial object of a given visual magnitude
 2161 # is a logarithmic measure of the luminance the object would have if its
 2162 # light were emitted by an object of specified solid angle; it is
 2163 # expressed in magnitudes per solid angle.  Surface brightness can be
 2164 # obtained from the visual magnitude by
 2165 #    S = m + 2.5 log(pi pi k a b),
 2166 # where k is the phase (fraction illuminated), a is the equatorial
 2167 # radius, and b is the polar radius.  For 100% illumination (e.g., full
 2168 # moon), this is often simplified to
 2169 #    S = m + 2.5 log(pi k s^2),
 2170 # where s is the object's angular semidiameter; the units of s determine
 2171 # the units of solid angle.  The visual magnitude and semidiameter must
 2172 # be appropriate for the object's distance; for other than 100%
 2173 # illumination, the visual magnitude must be appropriate for the phase.
 2174 # Luminance values are for outside Earth's atmosphere; they can be
 2175 # adjusted to terrestrial values by multiplying by one of the atm_transmission
 2176 # functions above.
 2177 
 2178 # luminance from surface brightness in magnitudes per square degree
 2179 SB_degree(sb) units=[1;cd/m^2] domain=[,] range=(0,] \
 2180     vmag(sb) / squaredegree ; \
 2181     ~vmag(SB_degree squaredegree)
 2182 
 2183 # luminance from surface brightness in magnitudes per square minute
 2184 SB_minute(sb) units=[1;cd/m^2] domain=[,] range=(0,] \
 2185     vmag(sb) / squareminute ; \
 2186     ~vmag(SB_minute squareminute)
 2187 
 2188 # luminance from surface brightness in magnitudes per square second
 2189 SB_second(sb) units=[1;cd/m^2] domain=[,] range=(0,] \
 2190     vmag(sb) / squaresecond ; \
 2191     ~vmag(SB_second squaresecond)
 2192 
 2193 # luminance from surface brightness in magnitudes per steradian
 2194 SB_sr(sb) units=[1;cd/m^2] domain=[,] range=(0,] \
 2195     vmag(sb) / sr ; \
 2196     ~vmag(SB_sr sr)
 2197 
 2198 SB()		SB_second
 2199 SB_sec()	SB_second
 2200 SB_min()	SB_minute
 2201 SB_deg()	SB_degree
 2202 
 2203 # The brightness of one tenth-magnitude star per square degree outside
 2204 # Earth's atmosphere; often used for night sky brightness.
 2205 S10	SB_degree(10)
 2206 
 2207 # Examples for magnitude and surface brightness functions
 2208 # Sun illuminance from visual magnitude
 2209 #     You have: sunvmag
 2210 #     You want:
 2211 # 	    Definition: -26.74 = -26.74
 2212 #     You have: vmag(sunvmag)
 2213 #     You want: lx
 2214 # 	    * 126134.45
 2215 # 	    / 7.9280482e-06
 2216 #
 2217 # Moon surface brightness from visual magnitude and semidiameter at 100%
 2218 # illumination (full moon):
 2219 #     You have: moonvmag
 2220 #     You want:
 2221 # 	    Definition: -12.74 = -12.74
 2222 #     You have: moonsd
 2223 #     You want: arcsec
 2224 # 	    * 932.59484
 2225 # 	    / 0.001072277
 2226 #     You have: moonvmag + 2.5 log(pi 932.59484^2)
 2227 #     You want:
 2228 # 	    Definition: 3.3513397
 2229 #
 2230 # Similar example with specific data obtained from another source (JPL
 2231 # Horizons, https://ssd.jpl.nasa.gov/horizons.cgi); semidiameter is in
 2232 # arcseconds
 2233 #
 2234 #     You have: -12.9 + 2.5 log(pi 2023.201|2^2)
 2235 #     You want:
 2236 # 	    Definition: 3.3679199
 2237 #     You have: SB_second(-12.9 + 2.5 log(pi 2023.201|2^2))
 2238 #     You want:
 2239 # 	    Definition: 4858.6547 cd / m^2
 2240 #
 2241 # If surface brightness is provided by another source (e.g., Horizons),
 2242 # it can simply be used directly:
 2243 # You have: SB_second(3.3679199)
 2244 # You want: cd/m^2
 2245 #         * 4858.6546
 2246 #         / 0.0002058183
 2247 # The illuminance and luminance values are extraterrestrial (outside
 2248 # Earth's atmosphere).  The values at Earth's surface are less than these
 2249 # because of atmospheric extinction.  For example, in the last example
 2250 # above, if the Moon were at an altitude of 55 degrees, the terrestrial
 2251 # luminance could be calculated with
 2252 #     You have: SB_second(3.3679199)
 2253 #     You want: cd/m^2
 2254 # 	    * 4858.6546
 2255 # 	    / 0.0002058183
 2256 #     You have: _ atm_transmission(55 deg)
 2257 #     You want: cd/m^2
 2258 # 	    * 3760.6356
 2259 # 	    / 0.0002659125
 2260 # If desired, photographic exposure can be determined with EV100(),
 2261 # leading to acceptable combinations of aperture and exposure time.
 2262 # For the example above, but with the Moon at 10 degrees,
 2263 #     You have: SB_second(3.3679199) atm_transmission(10 deg)
 2264 #     You want: EV100
 2265 # 	    13.553962
 2266 
 2267 
 2268 
 2269 #
 2270 # The Hartree system of atomic units, derived from fundamental units
 2271 # of mass (of electron), action (planck's constant), charge, and
 2272 # the coulomb constant.
 2273 
 2274 # Fundamental units
 2275 
 2276 atomicmass              electronmass
 2277 atomiccharge            e
 2278 atomicaction            hbar
 2279 
 2280 # derived units (Warning: accuracy is lost from deriving them this way)
 2281 
 2282 atomiclength            bohrradius
 2283 atomictime              hbar^3/coulombconst^2 atomicmass e^4 # Period of first
 2284                                                              # bohr orbit
 2285 atomicvelocity          atomiclength / atomictime
 2286 atomicenergy            hbar / atomictime
 2287 hartree                 atomicenergy
 2288 
 2289 #
 2290 # These thermal units treat entropy as charge, from [5]
 2291 #
 2292 
 2293 thermalcoulomb          J/K        # entropy
 2294 thermalampere           W/K        # entropy flow
 2295 thermalfarad            J/K^2
 2296 thermalohm              K^2/W      # thermal resistance
 2297 fourier                 thermalohm
 2298 thermalhenry            J K^2/W^2  # thermal inductance
 2299 thermalvolt             K          # thermal potential difference
 2300 
 2301 
 2302 #
 2303 # United States units
 2304 #
 2305 
 2306 # linear measure
 2307 
 2308 # The US Metric Law of 1866 legalized the metric system in the USA and
 2309 # defined the meter in terms of the British system with the exact
 2310 # 1 meter = 39.37 inches.  On April 5, 1893 Thomas Corwin Mendenhall,
 2311 # Superintendent of Weights and Measures, decided, in what has become
 2312 # known as the "Mendenhall Order" that the meter and kilogram would be the
 2313 # fundamental standards in the USA.  The definition from 1866 was turned
 2314 # around to give an exact definition of the yard as 3600|3937 meters This
 2315 # definition was used until July of 1959 when the definition was changed
 2316 # to bring the US and other English-speaking countries into agreement; the
 2317 # Canadian value of 1 yard = 0.9144 meter (exactly) was chosen because it
 2318 # was approximately halfway between the British and US values; it had the
 2319 # added advantage of making 1 inch = 25.4 mm (exactly).  Since 1959, the
 2320 # "international" foot has been exactly 0.3048 meters.  At the same time,
 2321 # it was decided that any data expressed in feet derived from geodetic
 2322 # surveys within the US would continue to use the old definition and call
 2323 # the old unit the "survey foot." The US continues to define the statute
 2324 # mile, furlong, chain, rod, link, and fathom in terms of the US survey
 2325 # foot.
 2326 # Sources:
 2327 # NIST Special Publication 447, Sects. 5, 7, and 8.
 2328 # NIST Handbook 44, 2011 ed., Appendix C.
 2329 # Canadian Journal of Physics, 1959, 37:(1) 84, 10.1139/p59-014.
 2330 
 2331 US                      1200|3937 m/ft   # These four values will convert
 2332 US-                     US               #   international measures to
 2333 survey-                 US               #   US Survey measures
 2334 geodetic-               US
 2335 int                     3937|1200 ft/m   # Convert US Survey measures to
 2336 int-                    int              #   international measures
 2337 
 2338 inch                    2.54 cm
 2339 in                      inch
 2340 foot                    12 inch
 2341 feet                    foot
 2342 ft                      foot
 2343 yard                    3 ft
 2344 yd                      yard
 2345 mile                    5280 ft          # The mile was enlarged from 5000 ft
 2346                                          # to this number in order to make
 2347                                          # it an even number of furlongs.
 2348                                          # (The Roman mile is 5000 romanfeet.)
 2349 line                    1|12 inch  # Also defined as '.1 in' or as '1e-8 Wb'
 2350 rod                     5.5 yard
 2351 perch                   rod
 2352 furlong                 40 rod           # From "furrow long"
 2353 statutemile             mile
 2354 league                  3 mile           # Intended to be an an hour's walk
 2355 
 2356 # surveyor's measure
 2357 
 2358 surveyorschain          66 surveyft
 2359 surveychain             surveyorschain
 2360 surveyorspole           1|4 surveyorschain
 2361 surveyorslink           1|100 surveyorschain
 2362 chain                   66 ft
 2363 link                    1|100 chain
 2364 ch                      chain
 2365 USacre                  10 surveychain^2
 2366 intacre                 10 chain^2       # Acre based on international ft
 2367 intacrefoot             acre foot
 2368 USacrefoot              USacre surveyfoot
 2369 acrefoot                intacrefoot
 2370 acre                    intacre
 2371 section                 mile^2
 2372 township                36 section
 2373 homestead               160 acre # Area of land granted by the 1862 Homestead
 2374                                  # Act of the United States Congress
 2375 gunterschain            surveyorschain
 2376 
 2377 engineerschain          100 ft
 2378 engineerslink           1|100 engineerschain
 2379 ramsdenschain           engineerschain
 2380 ramsdenslink            engineerslink
 2381 
 2382 gurleychain             33 feet           # Andrew Ellicott chain is the
 2383 gurleylink              1|50 gurleychain  # same length
 2384 
 2385 wingchain               66 feet           # Chain from 1664, introduced by
 2386 winglink                1|80 wingchain    # Vincent Wing, also found in a
 2387                                           # 33 foot length with 40 links.
 2388 # early US length standards
 2389 
 2390 # The US has had four standards for the yard: one by Troughton of London
 2391 # (1815); bronze yard #11 (1856); the Mendhall yard (1893), consistent
 2392 # with the definition of the meter in the metric joint resolution of
 2393 # Congress in 1866, but defining the yard in terms of the meter; and the
 2394 # international yard (1959), which standardized definitions for Australia,
 2395 # Canada, New Zealand, South Africa, the UK, and the US.
 2396 # Sources: Pat Naughtin (2009), Which Inch?, www.metricationmatters.com;
 2397 # Lewis E.  Barbrow and Lewis V.  Judson (1976).  NBS Special Publication
 2398 # 447, Weights and Measures Standards of the United States: A Brief
 2399 # History.
 2400 
 2401 troughtonyard           914.42190 mm
 2402 bronzeyard11            914.39980 mm
 2403 mendenhallyard          surveyyard
 2404 internationalyard       yard
 2405 
 2406 # nautical measure
 2407 
 2408 fathom                  6 ft     # Originally defined as the distance from
 2409                                  #   fingertip to fingertip with arms fully
 2410                                  #   extended.
 2411 nauticalmile            1852 m   # Supposed to be one minute of latitude at
 2412                                  # the equator.  That value is about 1855 m.
 2413                                  # Early estimates of the earth's circumference
 2414                                  # were a bit off.  The value of 1852 m was
 2415                                  # made the international standard in 1929.
 2416                                  # The US did not accept this value until
 2417                                  # 1954.  The UK switched in 1970.
 2418 
 2419 cable                   1|10 nauticalmile
 2420 intcable                cable              # international cable
 2421 cablelength             cable
 2422 UScable                 100 USfathom
 2423 navycablelength         720 USft           # used for depth in water
 2424 marineleague            3 nauticalmile
 2425 geographicalmile        brnauticalmile
 2426 knot                    nauticalmile / hr
 2427 click                   km       # US military slang
 2428 klick                   click
 2429 
 2430 # Avoirdupois weight
 2431 
 2432 pound                   0.45359237 kg   # The one normally used
 2433 lb                      pound           # From the latin libra
 2434 grain                   1|7000 pound    # The grain is the same in all three
 2435                                         # weight systems.  It was originally
 2436                                         # defined as the weight of a barley
 2437                                         # corn taken from the middle of the
 2438                                         # ear.
 2439 ounce                   1|16 pound
 2440 oz                      ounce
 2441 dram                    1|16 ounce
 2442 dr                      dram
 2443 ushundredweight         100 pounds
 2444 cwt                     hundredweight
 2445 shorthundredweight      ushundredweight
 2446 uston                   shortton
 2447 shortton                2000 lb
 2448 quarterweight           1|4 uston
 2449 shortquarterweight      1|4 shortton
 2450 shortquarter            shortquarterweight
 2451 
 2452 # Troy Weight.  In 1828 the troy pound was made the first United States
 2453 # standard weight.  It was to be used to regulate coinage.
 2454 
 2455 troypound               5760 grain
 2456 troyounce               1|12 troypound
 2457 ozt                     troyounce
 2458 pennyweight             1|20 troyounce  # Abbreviated "d" in reference to a
 2459 dwt                     pennyweight     #   Frankish coin called the "denier"
 2460                                         #   minted in the late 700's.  There
 2461                                         #   were 240 deniers to the pound.
 2462 assayton                mg ton / troyounce  # mg / assayton = troyounce / ton
 2463 usassayton              mg uston / troyounce
 2464 brassayton              mg brton / troyounce
 2465 fineounce               troyounce       # A troy ounce of 99.5% pure gold
 2466 
 2467 # Some other jewelers units
 2468 
 2469 metriccarat             0.2 gram        # Defined in 1907
 2470 metricgrain             50 mg
 2471 carat                   metriccarat
 2472 ct                      carat
 2473 jewelerspoint           1|100 carat
 2474 silversmithpoint        1|4000 inch
 2475 momme                   3.75 grams      # Traditional Japanese unit based
 2476                                         # on the chinese mace.  It is used for
 2477                                         # pearls in modern times and also for
 2478                                         # silk density.  The definition here
 2479                                         # was adopted in 1891.
 2480 # Apothecaries' weight
 2481 
 2482 appound                 troypound
 2483 apounce                 troyounce
 2484 apdram                  1|8 apounce
 2485 apscruple               1|3 apdram
 2486 
 2487 # Liquid measure
 2488 
 2489 usgallon                231 in^3        # US liquid measure is derived from
 2490 gal                     gallon          # the British wine gallon of 1707.
 2491 quart                   1|4 gallon      # See the "winegallon" entry below
 2492 pint                    1|2 quart       # more historical information.
 2493 gill                    1|4 pint
 2494 usquart                 1|4 usgallon
 2495 uspint                  1|2 usquart
 2496 usgill                  1|4 uspint
 2497 usfluidounce            1|16 uspint
 2498 fluiddram               1|8 usfloz
 2499 minimvolume             1|60 fluiddram
 2500 qt                      quart
 2501 pt                      pint
 2502 floz                    fluidounce
 2503 usfloz                  usfluidounce
 2504 fldr                    fluiddram
 2505 liquidbarrel            31.5 usgallon
 2506 usbeerbarrel            2 beerkegs
 2507 beerkeg                 15.5 usgallon   # Various among brewers
 2508 ponykeg                 1|2 beerkeg
 2509 winekeg                 12 usgallon
 2510 petroleumbarrel         42 usgallon     # Originated in Pennsylvania oil
 2511 barrel                  petroleumbarrel # fields, from the winetierce
 2512 bbl                     barrel
 2513 ushogshead              2 liquidbarrel
 2514 usfirkin                9 usgallon
 2515 
 2516 # Dry measures: The Winchester Bushel was defined by William III in 1702 and
 2517 # legally adopted in the US in 1836.
 2518 
 2519 usbushel                2150.42 in^3  # Volume of 8 inch cylinder with 18.5
 2520 bu                      bushel        # inch diameter (rounded)
 2521 peck                    1|4 bushel
 2522 uspeck                  1|4 usbushel
 2523 brpeck                  1|4 brbushel
 2524 pk                      peck
 2525 drygallon               1|2 uspeck
 2526 dryquart                1|4 drygallon
 2527 drypint                 1|2 dryquart
 2528 drybarrel               7056 in^3     # Used in US for fruits, vegetables,
 2529                                       #   and other dry commodities except for
 2530                                       #   cranberries.
 2531 cranberrybarrel         5826 in^3     # US cranberry barrel
 2532 heapedbushel            1.278 usbushel# The following explanation for this
 2533                                       #   value was provided by Wendy Krieger
 2534                                       #   <os2fan2@yahoo.com> based on
 2535                                       #   guesswork.  The cylindrical vessel is
 2536                                       #   18.5 inches in diameter and 1|2 inch
 2537                                       #   thick.  A heaped bushel includes the
 2538                                       #   contents of this cylinder plus a heap
 2539                                       #   on top.  The heap is a cone 19.5
 2540                                       #   inches in diameter and 6 inches
 2541                                       #   high.  With these values, the volume
 2542                                       #   of the bushel is 684.5 pi in^3 and
 2543                                       #   the heap occupies 190.125 pi in^3.
 2544                                       #   Therefore, the heaped bushel is
 2545                                       #   874.625|684.5 bushels.  This value is
 2546                                       #   approximately 1.2777575 and it rounds
 2547                                       #   to the value listed for the size of
 2548                                       #   the heaped bushel.  Sometimes the
 2549                                       #   heaped bushel is reported as 1.25
 2550                                       #   bushels.  This same explanation gives
 2551                                       #   that value if the heap is taken to
 2552                                       #   have an 18.5 inch diameter.
 2553 
 2554 # Grain measures.  The bushel as it is used by farmers in the USA is actually
 2555 # a measure of mass which varies for different commodities.  Canada uses the
 2556 # same bushel masses for most commodities, but not for oats.
 2557 
 2558 wheatbushel             60 lb
 2559 soybeanbushel           60 lb
 2560 cornbushel              56 lb
 2561 ryebushel               56 lb
 2562 barleybushel            48 lb
 2563 oatbushel               32 lb
 2564 ricebushel              45 lb
 2565 canada_oatbushel        34 lb
 2566 
 2567 # Wine and Spirits measure
 2568 
 2569 ponyvolume              1 usfloz
 2570 jigger                  1.5 usfloz   # Can vary between 1 and 2 usfloz
 2571 shot                    jigger     # Sometimes 1 usfloz
 2572 eushot                  25 ml      # EU standard spirits measure
 2573 fifth                   1|5 usgallon
 2574 winebottle              750 ml     # US industry standard, 1979
 2575 winesplit               1|4 winebottle
 2576 magnum                  1.5 liter  # Standardized in 1979, but given
 2577                                    # as 2 qt in some references
 2578 metrictenth             375 ml
 2579 metricfifth             750 ml
 2580 metricquart             1 liter
 2581 
 2582 # Old British bottle size
 2583 
 2584 reputedquart            1|6 brgallon
 2585 reputedpint             1|2 reputedquart
 2586 brwinebottle            reputedquart       # Very close to 1|5 winegallon
 2587 
 2588 # French champagne bottle sizes
 2589 
 2590 split                   200 ml
 2591 jeroboam                2 magnum
 2592 rehoboam                3 magnum
 2593 methuselah              4 magnum
 2594 imperialbottle          4 magnum
 2595 salmanazar              6 magnum
 2596 balthazar               8 magnum
 2597 nebuchadnezzar          10 magnum
 2598 solomon                 12 magnum
 2599 melchior                12 magnum
 2600 sovereign               17.5 magnum
 2601 primat                  18 magnum
 2602 goliath                 18 magnum
 2603 melchizedek             20 magnum
 2604 midas                   20 magnum
 2605 
 2606 # The wine glass doesn't seem to have an official standard, but the same value
 2607 # is suggested by several organization. 
 2608 
 2609 # https://www.rethinkingdrinking.niaaa.nih.gov/
 2610 # http://www.rethinkyourdrinking.ca/what-is-a-standard-drink/
 2611 # https://www.drinkaware.co.uk/
 2612 # https://www.gov.uk/government/uploads/system/uploads/attachment_data/file/545937/UK_CMOs__report.pdf
 2613 # http://www.alcohol.gov.au/internet/alcohol/publishing.nsf/content/drinksguide-cnt
 2614 
 2615 wineglass               150 mL     # the size of a "typical" serving
 2616 
 2617 # A unit of alcohol is a specified mass of pure ethyl alcohol.
 2618 # The term is used officially in the UK, but other countries use the same
 2619 # concept but with different values.  For example, the UK value of 8 g is
 2620 # nominally the amount of alcohol that a typical adult can metabolize in
 2621 # one hour.  Values for several countries, converted to a volumetric basis:
 2622 
 2623 alcoholunitus           14 g   / ethanoldensity
 2624 alcoholunitca           13.6 g / ethanoldensity
 2625 alcoholunituk            8 g   / ethanoldensity
 2626 alcoholunitau           10 g   / ethanoldensity
 2627 
 2628 # Example: for 12% ABV (alcohol by volume)
 2629 # alcoholunitus / 12% = 147.8 mL, close to the “standard” serving of 150 mL.
 2630 
 2631 
 2632 # Coffee 
 2633 #
 2634 # The recommended ratio of coffee to water. Values vary considerably;
 2635 # one is from the  Specialty Coffee Association of America
 2636 # http://scaa.org/?page=resources&d=brewing-best-practices
 2637 
 2638 coffeeratio             55 g/L  # ± 10%
 2639 
 2640 # other recommendations are more loose, e.g.,
 2641 # http://www.ncausa.org/About-Coffee/How-to-Brew-Coffee
 2642 
 2643 
 2644 #
 2645 # Water is "hard" if it contains various minerals, expecially calcium
 2646 # carbonate.
 2647 #
 2648 
 2649 clarkdegree     grains/brgallon # Content by weigh of calcium carbonate
 2650 gpg             grains/usgallon # Divide by water's density to convert to
 2651                                 #   a dimensionless concentration measure
 2652 #
 2653 # Shoe measures
 2654 #
 2655 
 2656 shoeiron                1|48 inch    # Used to measure leather in soles
 2657 shoeounce               1|64 inch    # Used to measure non-sole shoe leather
 2658 
 2659 # USA shoe sizes.  These express the length of the shoe or the length
 2660 # of the "last", the form that the shoe is made on.  But note that
 2661 # this only captures the length.  It appears that widths change 1/4
 2662 # inch for each letter within the same size, and if you change the
 2663 # length by half a size then the width changes between 1/8 inch and
 2664 # 1/4 inch.  But this may not be standard.  If you know better, please
 2665 # contact me.
 2666 
 2667 shoesize_delta          1|3 inch     # USA shoe sizes differ by this amount
 2668 shoe_men0               8.25 inch
 2669 shoe_women0             (7+11|12) inch
 2670 shoe_boys0              (3+11|12) inch
 2671 shoe_girls0             (3+7|12) inch
 2672 
 2673 shoesize_men(n) units=[1;inch]   shoe_men0 + n shoesize_delta ; \
 2674                                 (shoesize_men+(-shoe_men0))/shoesize_delta
 2675 shoesize_women(n) units=[1;inch] shoe_women0 + n shoesize_delta ; \
 2676                                 (shoesize_women+(-shoe_women0))/shoesize_delta
 2677 shoesize_boys(n) units=[1;inch]  shoe_boys0 + n shoesize_delta ; \
 2678                                 (shoesize_boys+(-shoe_boys0))/shoesize_delta
 2679 shoesize_girls(n) units=[1;inch] shoe_girls0 + n shoesize_delta ; \
 2680                                 (shoesize_girls+(-shoe_girls0))/shoesize_delta
 2681 
 2682 # European shoe size.  According to
 2683 #      http://www.shoeline.com/footnotes/shoeterm.shtml
 2684 # shoe sizes in Europe are measured with Paris points which simply measure
 2685 # the length of the shoe.
 2686 
 2687 europeshoesize          2|3 cm
 2688 
 2689 #
 2690 # USA slang units
 2691 #
 2692 
 2693 buck                    US$
 2694 fin                     5 US$
 2695 sawbuck                 10 US$
 2696 usgrand                 1000 US$
 2697 greenback               US$
 2698 key                     kg           # usually of marijuana, 60's
 2699 lid                     1 oz         # Another 60's weed unit
 2700 footballfield           usfootballfield
 2701 usfootballfield         100 yards
 2702 canadafootballfield     110 yards    # And 65 yards wide
 2703 marathon                26 miles + 385 yards
 2704 
 2705 #
 2706 # British
 2707 #
 2708 
 2709 # The length measure in the UK was defined by a bronze bar manufactured in
 2710 # 1844.  Various conversions were sanctioned for convenience at different
 2711 # times, which makes conversions before 1963 a confusing matter.  Apparently
 2712 # previous conversions were never explicitly revoked.  Four different
 2713 # conversion factors appear below.  Multiply them times an imperial length
 2714 # units as desired.  The Weights and Measures Act of 1963 switched the UK away
 2715 # from their bronze standard and onto a definition of the yard in terms of the
 2716 # meter.  This happened after an international agreement in 1959 to align the
 2717 # world's measurement systems.
 2718 
 2719 UK                      UKlength_SJJ
 2720 UK-                     UK
 2721 british-                UK
 2722 
 2723 UKlength_B            0.9143992 meter / yard  # Benoit found the yard to be
 2724                                               #   0.9143992 m at a weights and
 2725                                               #   measures conference around
 2726                                               #   1896.   Legally sanctioned
 2727                                               #   in 1898.
 2728 UKlength_SJJ          0.91439841 meter / yard # In 1922, Seers, Jolly and
 2729                                               #   Johnson found the yard to be
 2730                                               #   0.91439841 meters.
 2731                                               #   Used starting in the 1930's.
 2732 UKlength_K              meter / 39.37079 inch # In 1816 Kater found this ratio
 2733                                               #   for the meter and inch.  This
 2734                                               #   value was used as the legal
 2735                                               #   conversion ratio when the
 2736                                               #   metric system was legalized
 2737                                               #   for contract in 1864.
 2738 UKlength_C            meter / 1.09362311 yard # In 1866 Clarke found the meter
 2739                                               #   to be 1.09362311 yards.  This
 2740                                               #   conversion was legalized
 2741                                               #   around 1878.
 2742 brnauticalmile          6080 ft               # Used until 1970 when the UK
 2743 brknot                  brnauticalmile / hr   #   switched to the international
 2744 brcable                 1|10 brnauticalmile   #   nautical mile.
 2745 admiraltymile           brnauticalmile
 2746 admiraltyknot           brknot
 2747 admiraltycable          brcable
 2748 seamile                 6000 ft
 2749 shackle                 15 fathoms            # Adopted 1949 by British navy
 2750 
 2751 # British Imperial weight is mostly the same as US weight.  A few extra
 2752 # units are added here.
 2753 
 2754 clove                   7 lb
 2755 stone                   14 lb
 2756 tod                     28 lb
 2757 brquarterweight         1|4 brhundredweight
 2758 brhundredweight         8 stone
 2759 longhundredweight       brhundredweight
 2760 longton                 20 brhundredweight
 2761 brton                   longton
 2762 
 2763 # British Imperial volume measures
 2764 
 2765 brminim                 1|60 brdram
 2766 brscruple               1|3 brdram
 2767 fluidscruple            brscruple
 2768 brdram                  1|8 brfloz
 2769 brfluidounce            1|20 brpint
 2770 brfloz                  brfluidounce
 2771 brgill                  1|4 brpint
 2772 brpint                  1|2 brquart
 2773 brquart                 1|4 brgallon
 2774 brgallon                4.54609 l      # The British Imperial gallon was
 2775                                        # defined in 1824 to be the volume of
 2776                                        # water which weighed 10 pounds at 62
 2777                                        # deg F with a pressure of 30 inHg.
 2778                                        # It was also defined as 277.274 in^3,
 2779                                        # Which is slightly in error.  In
 2780                                        # 1963 it was defined to be the volume
 2781                                        # occupied by 10 pounds of distilled
 2782                                        # water of density 0.998859 g/ml weighed
 2783                                        # in air of density 0.001217 g/ml
 2784                                        # against weights of density 8.136 g/ml.
 2785                                        # This gives a value of approximately
 2786                                        # 4.5459645 liters, but the old liter
 2787                                        # was in force at this time.  In 1976
 2788                                        # the definition was changed to exactly
 2789                                        # 4.54609 liters using the new
 2790                                        # definition of the liter (1 dm^3).
 2791 brbarrel                36 brgallon    # Used for beer
 2792 brbushel                8 brgallon
 2793 brheapedbushel          1.278 brbushel
 2794 brquarter               8 brbushel
 2795 brchaldron              36 brbushel
 2796 
 2797 # Obscure British volume measures.  These units are generally traditional
 2798 # measures whose definitions have fluctuated over the years.  Often they
 2799 # depended on the quantity being measured.  They are given here in terms of
 2800 # British Imperial measures.  For example, the puncheon may have historically
 2801 # been defined relative to the wine gallon or beer gallon or ale gallon
 2802 # rather than the British Imperial gallon.
 2803 
 2804 bag                     4 brbushel
 2805 bucket                  4 brgallon
 2806 kilderkin               2 brfirkin
 2807 last                    40 brbushel
 2808 noggin                  brgill
 2809 pottle                  0.5 brgallon
 2810 pin                     4.5 brgallon
 2811 puncheon                72 brgallon
 2812 seam                    8 brbushel
 2813 coomb                   4 brbushel
 2814 boll                    6 brbushel
 2815 firlot                  1|4 boll
 2816 brfirkin                9 brgallon     # Used for ale and beer
 2817 cran                    37.5 brgallon  # measures herring, about 750 fish
 2818 brwinehogshead          52.5 brgallon  # This value is approximately equal
 2819 brhogshead              brwinehogshead #   to the old wine hogshead of 63
 2820                                        #   wine gallons.  This adjustment
 2821                                        #   is listed in the OED and in
 2822                                        #   "The Weights and Measures of
 2823                                        #   England" by R. D. Connor
 2824 brbeerhogshead          54 brgallon
 2825 brbeerbutt              2 brbeerhogshead
 2826 registerton             100 ft^3  # Used for internal capacity of ships
 2827 shippington             40 ft^3   # Used for ship's cargo freight or timber
 2828 brshippington           42 ft^3   #
 2829 freightton            shippington # Both register ton and shipping ton derive
 2830                                   # from the "tun cask" of wine.
 2831 displacementton         35 ft^3   # Approximate volume of a longton weight of
 2832                                   # sea water.  Measures water displaced by
 2833                                   # ships.
 2834 waterton                224 brgallon
 2835 strike                  70.5 l    # 16th century unit, sometimes
 2836                                   #   defined as .5, 2, or 4 bushels
 2837                                   #   depending on the location.  It
 2838                                   #   probably doesn't make a lot of
 2839                                   #   sense to define in terms of imperial
 2840                                   #   bushels.  Zupko gives a value of
 2841                                   #   2 Winchester grain bushels or about
 2842                                   #   70.5 liters.
 2843 amber                   4 brbushel# Used for dry and liquid capacity [18]
 2844 
 2845 # British volume measures with "imperial"
 2846 
 2847 imperialminim           brminim
 2848 imperialscruple         brscruple
 2849 imperialdram            brdram
 2850 imperialfluidounce      brfluidounce
 2851 imperialfloz            brfloz
 2852 imperialgill            brgill
 2853 imperialpint            brpint
 2854 imperialquart           brquart
 2855 imperialgallon          brgallon
 2856 imperialbarrel          brbarrel
 2857 imperialbushel          brbushel
 2858 imperialheapedbushel    brheapedbushel
 2859 imperialquarter         brquarter
 2860 imperialchaldron        brchaldron
 2861 imperialwinehogshead    brwinehogshead
 2862 imperialhogshead        brhogshead
 2863 imperialbeerhogshead    brbeerhogshead
 2864 imperialbeerbutt        brbeerbutt
 2865 imperialfirkin          brfirkin
 2866 
 2867 # obscure British lengths
 2868 
 2869 barleycorn              1|3 UKinch   # Given in Realm of Measure as the
 2870                                      # difference between successive shoe sizes
 2871 nail                    1|16 UKyard  # Originally the width of the thumbnail,
 2872                                      #   or 1|16 ft.  This took on the general
 2873                                      #   meaning of 1|16 and settled on the
 2874                                      #   nail of a yard or 1|16 yards as its
 2875                                      #   final value.  [12]
 2876 pole                    16.5 UKft    # This was 15 Saxon feet, the Saxon
 2877 rope                    20 UKft      #   foot (aka northern foot) being longer
 2878 englishell              45 UKinch
 2879 flemishell              27 UKinch
 2880 ell                     englishell   # supposed to be measure from elbow to
 2881                                      #   fingertips
 2882 span                    9 UKinch     # supposed to be distance from thumb
 2883                                      #   to pinky with full hand extension
 2884 goad                    4.5 UKft     # used for cloth, possibly named after the
 2885                                      #   stick used for prodding animals.
 2886 
 2887 # misc obscure British units
 2888 
 2889 hide                    120 acre  # English unit of land area dating to the 7th
 2890                                   #   century, originally the amount of land
 2891                                   #   that a single plowman could cultivate,
 2892                                   #   which varied from 60-180 acres regionally.
 2893                                   #   Standardized at Normon conquest.
 2894 virgate                 1|4 hide
 2895 nook                    1|2 virgate
 2896 rood                    furlong rod  # Area of a strip a rod by a furlong
 2897 englishcarat            troyounce/151.5 # Originally intended to be 4 grain
 2898                                         #   but this value ended up being
 2899                                         #   used in the London diamond market
 2900 mancus                  2 oz
 2901 mast                    2.5 lb
 2902 nailkeg                 100 lbs
 2903 basebox                 31360 in^2      # Used in metal plating
 2904 
 2905 # alternate spellings
 2906 
 2907 metre                   meter
 2908 gramme                  gram
 2909 litre                   liter
 2910 dioptre                 diopter
 2911 aluminium               aluminum
 2912 sulphur                 sulfur
 2913 
 2914 #
 2915 # Units derived the human body (may not be very accurate)
 2916 #
 2917 
 2918 geometricpace           5 ft   # distance between points where the same
 2919                                # foot hits the ground
 2920 pace                    2.5 ft # distance between points where alternate
 2921                                # feet touch the ground
 2922 USmilitarypace          30 in  # United States official military pace
 2923 USdoubletimepace        36 in  # United States official doubletime pace
 2924 fingerbreadth           7|8 in # The finger is defined as either the width
 2925 fingerlength            4.5 in #   or length of the finger
 2926 finger                  fingerbreadth
 2927 palmwidth               hand   # The palm is a unit defined as either the width
 2928 palmlength              8 in   #   or the length of the hand
 2929 hand                    4 inch # width of hand
 2930 shaftment               6 inch # Distance from tip of outstretched thumb to the
 2931                                #   opposite side of the palm of the hand.  The
 2932                                #   ending -ment is from the old English word
 2933                                #   for hand. [18]
 2934 smoot              5 ft + 7 in # Created as part of an MIT fraternity prank.
 2935                                #   In 1958 Oliver Smoot was used to measure
 2936                                #   the length of the Harvard Bridge, which was
 2937                                #   marked off in Smoot lengths.  These
 2938                                #   markings have been maintained on the bridge
 2939                                #   since then and repainted by subsequent
 2940                                #   incoming fraternity members.  During a
 2941                                #   bridge renovation the new sidewalk was
 2942                                #   scored every Smoot rather than at the
 2943                                #   customary 6 ft spacing.
 2944 #
 2945 # Cooking measures
 2946 #
 2947 
 2948 # Common abbreviations
 2949 
 2950 tbl                     tablespoon
 2951 tbsp                    tablespoon
 2952 tblsp                   tablespoon
 2953 Tb                      tablespoon
 2954 tsp                     teaspoon
 2955 saltspoon               1|4 tsp
 2956 
 2957 # US measures
 2958 
 2959 uscup                   8 usfloz
 2960 ustablespoon            1|16 uscup
 2961 usteaspoon              1|3 ustablespoon
 2962 ustbl                   ustablespoon
 2963 ustbsp                  ustablespoon
 2964 ustblsp                 ustablespoon
 2965 ustsp                   usteaspoon
 2966 metriccup               250 ml
 2967 stickbutter             1|4 lb            # Butter in the USA is sold in one
 2968                                           # pound packages that contain four
 2969                                           # individually wrapped pieces.  The
 2970                                           # pieces are marked into tablespoons,
 2971                                           # making it possible to measure out
 2972                                           # butter by volume by slicing the
 2973                                           # butter.
 2974 
 2975 legalcup                240 ml            # The cup used on nutrition labeling
 2976 legaltablespoon         1|16 legalcup
 2977 legaltbsp               legaltablespoon
 2978 
 2979 # Scoop size.  Ice cream scoops in the US are marked with numbers
 2980 # indicating the number of scoops requird to fill a US quart.
 2981 
 2982 scoop(n)  units=[1;cup] domain=[4,100] range=[0.04,1] \
 2983            32 usfloz / n ; 32 usfloz / scoop
 2984 
 2985 
 2986 # US can sizes.
 2987 
 2988 number1can              10 usfloz
 2989 number2can              19 usfloz
 2990 number2.5can            3.5 uscups
 2991 number3can              4 uscups
 2992 number5can              7 uscups
 2993 number10can             105 usfloz
 2994 
 2995 # British measures
 2996 
 2997 brcup                   1|2 brpint
 2998 brteacup                1|3 brpint
 2999 brtablespoon            15 ml             # Also 5|8 brfloz, approx 17.7 ml
 3000 brteaspoon              1|3 brtablespoon  # Also 1|4 brtablespoon
 3001 brdessertspoon          2 brteaspoon
 3002 dessertspoon            brdessertspoon
 3003 dsp                     dessertspoon
 3004 brtsp                   brteaspoon
 3005 brtbl                   brtablespoon
 3006 brtbsp                  brtablespoon
 3007 brtblsp                 brtablespoon
 3008 
 3009 # Australian
 3010 
 3011 australiatablespoon     20 ml
 3012 austbl                  australiatablespoon
 3013 austbsp                 australiatablespoon
 3014 austblsp                australiatablespoon
 3015 australiateaspoon       1|4 australiatablespoon
 3016 austsp                  australiateaspoon
 3017 
 3018 # Italian
 3019 
 3020 etto                    100 g          # Used for buying items like meat and
 3021 etti                    etto           #   cheese.
 3022 
 3023 # Chinese
 3024 
 3025 catty                   0.5 kg
 3026 oldcatty                4|3 lbs        # Before metric conversion.
 3027 tael                    1|16 oldcatty  # Should the tael be defined both ways?
 3028 mace                    0.1 tael
 3029 oldpicul                100 oldcatty
 3030 picul                   100 catty      # Chinese usage
 3031 
 3032 # Indian
 3033 
 3034 seer                    14400 grain    # British Colonial standard
 3035 ser                     seer
 3036 maund                   40 seer
 3037 pakistanseer            1 kg
 3038 pakistanmaund           40 pakistanseer
 3039 chittak                 1|16 seer
 3040 tola                    1|5 chittak
 3041 ollock                  1|4 liter      # Is this right?
 3042 
 3043 # Japanese
 3044 
 3045 japancup                200 ml
 3046 
 3047 # densities of cooking ingredients from The Cake Bible by Rose Levy Beranbaum
 3048 # so you can convert '2 cups sugar' to grams, for example, or in the other
 3049 # direction grams could be converted to 'cup flour_scooped'.
 3050 
 3051 butter                  8 oz/uscup
 3052 butter_clarified        6.8 oz/uscup
 3053 cocoa_butter            9 oz/uscup
 3054 shortening              6.75 oz/uscup   # vegetable shortening
 3055 oil                     7.5 oz/uscup
 3056 cakeflour_sifted        3.5 oz/uscup    # The density of flour depends on the
 3057 cakeflour_spooned       4 oz/uscup      # measuring method.  "Scooped",  or
 3058 cakeflour_scooped       4.5 oz/uscup    # "dip and sweep" refers to dipping a
 3059 flour_sifted            4 oz/uscup      # measure into a bin, and then sweeping
 3060 flour_spooned           4.25 oz/uscup   # the excess off the top.  "Spooned"
 3061 flour_scooped           5 oz/uscup      # means to lightly spoon into a measure
 3062 breadflour_sifted       4.25 oz/uscup   # and then sweep the top.  Sifted means
 3063 breadflour_spooned      4.5 oz/uscup    # sifting the flour directly into a
 3064 breadflour_scooped      5.5 oz/uscup    # measure and then sweeping the top.
 3065 cornstarch              120 grams/uscup
 3066 dutchcocoa_sifted       75 g/uscup      # These are for Dutch processed cocoa
 3067 dutchcocoa_spooned      92 g/uscup
 3068 dutchcocoa_scooped      95 g/uscup
 3069 cocoa_sifted            75 g/uscup      # These are for nonalkalized cocoa
 3070 cocoa_spooned           82 g/uscup
 3071 cocoa_scooped           95 g/uscup
 3072 heavycream              232 g/uscup
 3073 milk                    242 g/uscup
 3074 sourcream               242 g/uscup
 3075 molasses                11.25 oz/uscup
 3076 cornsyrup               11.5 oz/uscup
 3077 honey                   11.75 oz/uscup
 3078 sugar                   200 g/uscup
 3079 powdered_sugar          4 oz/uscup
 3080 brownsugar_light        217 g/uscup     # packed
 3081 brownsugar_dark         239 g/uscup
 3082 
 3083 baking_powder           4.6 grams / ustsp
 3084 salt                    6 g / ustsp
 3085 koshersalt              2.8 g / ustsp   # Diamond Crystal kosher salt
 3086 koshersalt_morton       4.8 g / ustsp   # Morton kosher salt
 3087                                         # Values are from the nutrition info
 3088                                         # on the packages
 3089 
 3090 
 3091 # Egg weights and volumes for a USA large egg
 3092 
 3093 egg                     50 grams        # without shell
 3094 eggwhite                30 grams
 3095 eggyolk                 18.6 grams
 3096 eggvolume               3 ustablespoons + 1|2 ustsp
 3097 eggwhitevolume          2 ustablespoons
 3098 eggyolkvolume           3.5 ustsp
 3099 
 3100 # Alcohol density
 3101 
 3102 ethanoldensity          0.7893 g/cm^3   # From CRC Handbook, 91st Edition
 3103 alcoholdensity          ethanoldensity
 3104 
 3105 #
 3106 # Density measures.  Density has traditionally been measured on a variety of
 3107 # bizarre nonlinear scales.
 3108 #
 3109 
 3110 # Density of a sugar syrup is frequently measured in candy making procedures.
 3111 # In the USA the boiling point of the syrup is measured.  Some recipes instead
 3112 # specify the density using degrees Baume.  Conversion between degrees Baume
 3113 # and the boiling point measure has proved elusive.  This table appeared in one
 3114 # text, and provides a fragmentary relationship to the concentration.
 3115 #
 3116 # temp(C)  conc (%)
 3117 #   100      30
 3118 #   101      40
 3119 #   102      50
 3120 #   103      60
 3121 #   106      70
 3122 #   112      80
 3123 #   123      90
 3124 #   140      95
 3125 #   151      97
 3126 #   160      98.2
 3127 #   166      99.5
 3128 #   171      99.6
 3129 #
 3130 # The best source identified to date came from "Boiling point elevation of
 3131 # technical sugarcane solutions and its use in automatic pan boiling" by
 3132 # Michael Saska.  International Sugar Journal, 2002, 104, 1247, pp 500-507.
 3133 #
 3134 # But I'm using equation (3) which is credited to Starzak and Peacock,
 3135 # "Water activity coefficient in aqueous solutions of sucrose--A comprehensive
 3136 # data analyzis.  Zuckerindustrie, 122, 380-387.  (I couldn't find this
 3137 # document.)
 3138 #
 3139 # Note that the range of validity is uncertain, but answers are in agreement
 3140 # with the above table all the way to 99.6.
 3141 #
 3142 # The original equation has a parameter for the boiling point of water, which
 3143 # of course varies with altitude.  It also includes various other model
 3144 # parameters.  The input is the molar concentration of sucrose in the solution,
 3145 # (moles sucrose) / (total moles).
 3146 #
 3147 # Bsp 3797.06 degC
 3148 # Csp 226.28 degC
 3149 # QQ -17638 J/mol
 3150 # asp -1.0038
 3151 # bsp -0.24653
 3152 # tbw 100 degC     # boiling point of water
 3153 # sugar_bpe_orig(x) ((1-QQ/R Bsp * x^2 (1+asp x + bsp x^2) (tbw + Csp) \
 3154 #           /(tbw+stdtemp)) /  (1+(tbw + Csp)/Bsp *ln(1-x))-1) * (tbw + Csp)
 3155 #
 3156 # To convert mass concentration (brix) to molar concentration
 3157 #
 3158 # sc(x)  (x / 342.3) / (( x/342.3) + (100-x)/18.02); \
 3159 #        100 sc 342.3|18.02 / (sc (342.3|18.02-1)+1)
 3160 #
 3161 # Here is a simplfied version of this equation where the temperature of boiling
 3162 # water has been fixed at 100 degrees Celcius and the argument is now the
 3163 # concentration (brix).
 3164 #
 3165 # sugar_bpe(x) ((1+ 0.48851085 * sc(x)^2 (1+ -1.0038 sc(x) + -0.24653 sc(x)^2)) \
 3166 #                   / (1+0.08592964 ln(1-sc(x)))-1) 326.28 K
 3167 #
 3168 #
 3169 # The formula is not invertible, so to implement it in units we unfortunately
 3170 # must turn it into a table.
 3171 
 3172 # This table gives the boiling point elevation as a function of the sugar syrup
 3173 # concentration expressed as a percentage.
 3174 
 3175 sugar_conc_bpe[K] \
 3176  0 0.0000   5 0.0788  10 0.1690  15 0.2729  20 0.3936  25 0.5351  \
 3177 30 0.7027  35 0.9036  40 1.1475  42 1.2599  44 1.3825  46 1.5165  \
 3178 48 1.6634  50 1.8249  52 2.0031  54 2.2005  56 2.4200  58 2.6651  \
 3179 60 2.9400  61 3.0902  62 3.2499  63 3.4198  64 3.6010  65 3.7944  \
 3180 66 4.0012  67 4.2227  68 4.4603  69 4.7156  70 4.9905  71 5.2870  \
 3181 72 5.6075  73 5.9546  74 6.3316  75 6.7417  76 7.1892  77 7.6786  \
 3182 78.0  8.2155  79.0  8.8061  80.0  9.4578  80.5  9.8092  81.0 10.1793  \
 3183 81.5 10.5693  82.0 10.9807  82.5 11.4152  83.0 11.8743  83.5 12.3601  \
 3184 84.0 12.8744  84.5 13.4197  85.0 13.9982  85.5 14.6128  86.0 15.2663  \
 3185 86.5 15.9620  87.0 16.7033  87.5 17.4943  88.0 18.3391  88.5 19.2424  \
 3186 89.0 20.2092  89.5 21.2452  90.0 22.3564  90.5 23.5493  91.0 24.8309  \
 3187 91.5 26.2086  92.0 27.6903  92.5 29.2839  93.0 30.9972  93.5 32.8374  \
 3188 94.0 34.8104  94.5 36.9195  95.0 39.1636  95.5 41.5348  96.0 44.0142  \
 3189 96.5 46.5668  97.0 49.1350  97.5 51.6347  98.0 53.9681  98.1 54.4091  \
 3190 98.2 54.8423  98.3 55.2692  98.4 55.6928  98.5 56.1174  98.6 56.5497  \
 3191 98.7 56.9999  98.8 57.4828  98.9 58.0206  99.0 58.6455  99.1 59.4062  \
 3192 99.2 60.3763  99.3 61.6706  99.4 63.4751  99.5 66.1062  99.6 70.1448  \
 3193 99.7 76.7867
 3194 
 3195 # Using the brix table we can use this to produce a mapping from boiling point
 3196 # to density which makes all of the units interconvertible.  Because the brix
 3197 # table stops at 95 this approach works up to a boiling point elevation of 39 K
 3198 # or a boiling point of 139 C / 282 F, which is the "soft crack" stage in candy
 3199 # making.  The "hard crack" stage continues up to 310 F.
 3200 
 3201 # Boiling point elevation
 3202 sugar_bpe(T) units=[K;g/cm^3] domain=[0,39.1636] range=[0.99717,1.5144619] \
 3203                brix(~sugar_conc_bpe(T)); sugar_conc_bpe(~brix(sugar_bpe))
 3204 # Absolute boiling point (produces an absolute temperature)
 3205 sugar_bp(T) units=[K;g/cm^3] domain=[373.15,412.3136] \
 3206                                          range=[0.99717,1.5144619] \
 3207                         brix(~sugar_conc_bpe(T-tempC(100))) ;\
 3208                         sugar_conc_bpe(~brix(sugar_bp))+tempC(100)
 3209 
 3210 # In practice dealing with the absolute temperature is annoying because it is
 3211 # not possible to convert to a nested function, so you're stuck retyping the
 3212 # absolute temperature in Kelvins to convert to celsius or Fahrenheit.  To
 3213 # prevent this we supply definitions that build in the temperature conversion
 3214 # and produce results in the Fahrenheit and Celcius scales.  So using these
 3215 # measures, to convert 46 degrees Baume to a Fahrenheit boiling point:
 3216 #
 3217 #      You have: baume(45)
 3218 #      You want: sugar_bpF
 3219 #              239.05647
 3220 #
 3221 sugar_bpF(T) units=[1;g/cm^3] domain=[212,282.49448] range=[0.99717,1.5144619]\
 3222                         brix(~sugar_conc_bpe(tempF(T)+-tempC(100))) ;\
 3223                         ~tempF(sugar_conc_bpe(~brix(sugar_bpF))+tempC(100))
 3224 sugar_bpC(T) units=[1;g/cm^3] domain=[100,139.1636] range=[0.99717,1.5144619]\
 3225                         brix(~sugar_conc_bpe(tempC(T)+-tempC(100))) ;\
 3226                         ~tempC(sugar_conc_bpe(~brix(sugar_bpC))+tempC(100))
 3227 
 3228 # Degrees Baume is used in European recipes to specify the density of a sugar
 3229 # syrup.  An entirely different definition is used for densities below
 3230 # 1 g/cm^3.  An arbitrary constant appears in the definition.  This value is
 3231 # equal to 145 in the US, but was according to [], the old scale used in
 3232 # Holland had a value of 144, and the new scale or Gerlach scale used 146.78.
 3233 
 3234 baumeconst 145      # US value
 3235 baume(d) units=[1;g/cm^3] domain=[0,145) range=[1,) \
 3236                           (baumeconst/(baumeconst+-d)) g/cm^3 ; \
 3237                           (baume+((-g)/cm^3)) baumeconst / baume
 3238 
 3239 # It's not clear if this value was ever used with negative degrees.
 3240 twaddell(x) units=[1;g/cm^3] domain=[-200,) range=[0,) \
 3241                              (1 + 0.005 x) g / cm^3 ; \
 3242                              200 (twaddell / (g/cm^3) +- 1)
 3243 
 3244 # The degree quevenne is a unit for measuring the density of milk.
 3245 # Similarly it's unclear if negative values were allowed here.
 3246 quevenne(x) units=[1;g/cm^3] domain=[-1000,) range=[0,) \
 3247                              (1 + 0.001 x) g / cm^3 ; \
 3248                              1000 (quevenne / (g/cm^3) +- 1)
 3249 
 3250 # Degrees brix measures sugar concentration by weigh as a percentage, so a
 3251 # solution that is 3 degrees brix is 3% sugar by weight.  This unit was named
 3252 # after Adolf Brix who invented a hydrometer that read this percentage
 3253 # directly.  This data is from Table 114 of NIST Circular 440, "Polarimetry,
 3254 # Saccharimetry and the Sugars".  It gives apparent specific gravity at 20
 3255 # degrees Celsius of various sugar concentrations.  As rendered below this
 3256 # data is converted to apparent density at 20 degrees Celsius using the
 3257 # density figure for water given in the same NIST reference.  They use the
 3258 # word "apparent" to refer to measurements being made in air with brass
 3259 # weights rather than vacuum.
 3260 
 3261 brix[0.99717g/cm^3]\
 3262     0 1.00000  1 1.00390  2 1.00780  3 1.01173  4 1.01569  5 1.01968 \
 3263     6 1.02369  7 1.02773  8 1.03180  9 1.03590 10 1.04003 11 1.04418 \
 3264    12 1.04837 13 1.05259 14 1.05683 15 1.06111 16 1.06542 17 1.06976 \
 3265    18 1.07413 19 1.07853 20 1.08297 21 1.08744 22 1.09194 23 1.09647 \
 3266    24 1.10104 25 1.10564 26 1.11027 27 1.11493 28 1.11963 29 1.12436 \
 3267    30 1.12913 31 1.13394 32 1.13877 33 1.14364 34 1.14855 35 1.15350 \
 3268    36 1.15847 37 1.16349 38 1.16853 39 1.17362 40 1.17874 41 1.18390 \
 3269    42 1.18910 43 1.19434 44 1.19961 45 1.20491 46 1.21026 47 1.21564 \
 3270    48 1.22106 49 1.22652 50 1.23202 51 1.23756 52 1.24313 53 1.24874 \
 3271    54 1.25439 55 1.26007 56 1.26580 57 1.27156 58 1.27736 59 1.28320 \
 3272    60 1.28909 61 1.29498 62 1.30093 63 1.30694 64 1.31297 65 1.31905 \
 3273    66 1.32516 67 1.33129 68 1.33748 69 1.34371 70 1.34997 71 1.35627 \
 3274    72 1.36261 73 1.36900 74 1.37541 75 1.38187 76 1.38835 77 1.39489 \
 3275    78 1.40146 79 1.40806 80 1.41471 81 1.42138 82 1.42810 83 1.43486 \
 3276    84 1.44165 85 1.44848 86 1.45535 87 1.46225 88 1.46919 89 1.47616 \
 3277    90 1.48317 91 1.49022 92 1.49730 93 1.50442 94 1.51157 95 1.51876
 3278 
 3279 # Density measure invented by the American Petroleum Institute.  Lighter
 3280 # petroleum products are more valuable, and they get a higher API degree.
 3281 #
 3282 # The intervals of range and domain should be open rather than closed.
 3283 #
 3284 apidegree(x) units=[1;g/cm^3] domain=[-131.5,) range=[0,) \
 3285                               141.5 g/cm^3 / (x+131.5) ; \
 3286                               141.5 (g/cm^3) / apidegree + (-131.5)
 3287 
 3288 #
 3289 # Units derived from imperial system
 3290 #
 3291 
 3292 ouncedal                oz ft / s^2     # force which accelerates an ounce
 3293                                         #    at 1 ft/s^2
 3294 poundal                 lb ft / s^2     # same thing for a pound
 3295 tondal                  longton ft / s^2    # and for a ton
 3296 pdl                     poundal
 3297 osi                     ounce force / inch^2   # used in aviation
 3298 psi                     pound force / inch^2
 3299 psia                    psi             # absolute pressure
 3300                                         #   Note that gauge pressure can be given
 3301                                         #   using the gaugepressure() and
 3302                                         #   psig() nonlinear unit definitions
 3303 tsi                     ton force / inch^2
 3304 reyn                    psi sec
 3305 slug                    lbf s^2 / ft
 3306 slugf                   slug force
 3307 slinch                  lbf s^2 / inch  # Mass unit derived from inch second
 3308 slinchf                 slinch force    #   pound-force system.  Used in space
 3309                                         #   applications where in/sec^2 was a
 3310                                         #   natural acceleration measure.
 3311 geepound                slug
 3312 lbf                     lb force
 3313 tonf                    ton force
 3314 lbm                     lb
 3315 kip                     1000 lbf     # from kilopound
 3316 ksi                     kip / in^2
 3317 mil                     0.001 inch
 3318 thou                    0.001 inch
 3319 tenth                   0.0001 inch  # one tenth of one thousandth of an inch
 3320 millionth               1e-6 inch    # one millionth of an inch
 3321 circularinch            1|4 pi in^2  # area of a one-inch diameter circle
 3322 circleinch              circularinch #    A circle with diameter d inches has
 3323                                      #    an area of d^2 circularinches
 3324 cylinderinch         circleinch inch # Cylinder h inch tall, d inches diameter
 3325                                      #    has volume d^2 h cylinder inches
 3326 circularmil             1|4 pi mil^2 # area of one-mil diameter circle
 3327 cmil                    circularmil
 3328 
 3329 cental                  100 pound
 3330 centner                 cental
 3331 caliber                 0.01 inch    # for measuring bullets
 3332 duty                    ft lbf
 3333 celo                    ft / s^2
 3334 jerk                    ft / s^3
 3335 australiapoint          0.01 inch    # The "point" is used to measure rainfall
 3336                                      #   in Australia
 3337 sabin                   ft^2         # Measure of sound absorption equal to the
 3338                                      #   absorbing power of one square foot of
 3339                                      #   a perfectly absorbing material.  The
 3340                                      #   sound absorptivity of an object is the
 3341                                      #   area times a dimensionless
 3342                                      #   absorptivity coefficient.
 3343 standardgauge          4 ft + 8.5 in # Standard width between railroad track
 3344 flag                   5 ft^2        # Construction term referring to sidewalk.
 3345 rollwallpaper          30 ft^2       # Area of roll of wall paper
 3346 fillpower              in^3 / ounce  # Density of down at standard pressure.
 3347                                      #   The best down has 750-800 fillpower.
 3348 pinlength              1|16 inch     # A #17 pin is 17/16 in long in the USA.
 3349 buttonline             1|40 inch     # The line was used in 19th century USA
 3350                                      #   to measure width of buttons.
 3351 beespace               1|4 inch      # Bees will fill any space that is smaller
 3352                                      #   than the bee space and leave open
 3353                                      #   spaces that are larger.  The size of
 3354                                      #   the space varies with species.
 3355 diamond                8|5 ft        # Marking on US tape measures that is
 3356                                      #   useful to carpenters who wish to place
 3357                                      #   five studs in an 8 ft distance.  Note
 3358                                      #   that the numbers appear in red every
 3359                                      #   16 inches as well, giving six
 3360                                      #   divisions in 8 feet.
 3361 retmaunit              1.75 in       # Height of rack mountable equipment.
 3362 U                      retmaunit     #   Equipment should be 1|32 inch narrower
 3363 RU                     U             #   than its U measurement indicates to
 3364                                      #   allow for clearance, so 4U=(6+31|32)in
 3365                                      #   RETMA stands for the former name of
 3366                                      #   the standardizing organization, Radio
 3367                                      #   Electronics Television Manufacturers
 3368                                      #   Association.  This organization is now
 3369                                      #   called the Electronic Industries
 3370                                      #   Alliance (EIA) and the rack standard
 3371                                      #   is specified in EIA RS-310-D.
 3372 count                  per pound     # For measuring the size of shrimp
 3373 
 3374 #
 3375 # Other units of work, energy, power, etc
 3376 #
 3377 
 3378 ENERGY                  joule
 3379 WORK                    joule
 3380 
 3381 # Calorie: approximate energy to raise a gram of water one degree celsius
 3382 
 3383 calorie                 cal_th       # Default is the thermochemical calorie
 3384 cal                     calorie
 3385 calorie_th              4.184 J      # Thermochemical calorie, defined in 1930
 3386 thermcalorie            calorie_th   #   by Frederick Rossini as 4.1833 J to 
 3387 cal_th                  calorie_th   #   avoid difficulties associated with the 
 3388                                      #   uncertainty in the heat capacity of 
 3389                                      #   water.  In 1948 the value of the joule 
 3390                                      #   was changed, so the thermochemical
 3391                                      #   calorie was redefined to 4.184 J.
 3392                                      #   This kept the energy measured by this
 3393                                      #   unit the same. 
 3394 calorie_IT              4.1868 J     # International (Steam) Table calorie,
 3395 cal_IT                  calorie_IT   #   defined in 1929 as watt-hour/860 or
 3396                                      #   equivalently 180|43 joules.  At this
 3397                                      #   time the international joule had a
 3398                                      #   different value than the modern joule,
 3399                                      #   and the values were different in the
 3400                                      #   USA and in Europe.  In 1956 at the
 3401                                      #   Fifth International Conference on
 3402                                      #   Properties of Steam the exact
 3403                                      #   definition given here was adopted. 
 3404 calorie_15              4.18580 J    # Energy to go from 14.5 to 15.5 degC
 3405 cal_15                  calorie_15
 3406 calorie_fifteen         cal_15
 3407 calorie_20              4.18190 J    # Energy to go from 19.5 to 20.5 degC
 3408 cal_20                  calorie_20
 3409 calorie_twenty          calorie_20
 3410 calorie_4               4.204 J      # Energy to go from 3.5 to 4.5 degC
 3411 cal_4                   calorie_4
 3412 calorie_four            calorie_4
 3413 cal_mean                4.19002 J    # 1|100 energy to go from 0 to 100 degC
 3414 Calorie                 kilocalorie  # the food Calorie
 3415 thermie              1e6 cal_15      # Heat required to raise the
 3416                                      # temperature of a tonne of
 3417                                      # water from 14.5 to 15.5 degC.
 3418 
 3419 # btu definitions: energy to raise a pound of water 1 degF
 3420 
 3421 btu                     btu_IT       # International Table BTU is the default
 3422 britishthermalunit      btu
 3423 btu_IT                  cal_IT lb degF / gram K
 3424 btu_th                  cal_th lb degF / gram K
 3425 btu_mean                cal_mean lb degF / gram K
 3426 btu_15                  cal_15 lb degF / gram K
 3427 btu_ISO                 1055.06 J    # Exact, rounded ISO definition based
 3428                                      #    on the IT calorie
 3429 quad                    quadrillion btu
 3430 
 3431 ECtherm                 1e5 btu_ISO    # Exact definition
 3432 UStherm                 1.054804e8 J   # Exact definition, 
 3433 therm                   UStherm
 3434 
 3435 # Water latent heat from [23]
 3436 
 3437 water_fusion_heat       6.01 kJ/mol / (18.015 g/mol) # At 0 deg C
 3438 water_vaporization_heat 2256.4 J/g  # At saturation, 100 deg C, 101.42 kPa
 3439 
 3440 # Specific heat capacities of various substances
 3441 
 3442 specificheat_water      calorie / g K
 3443 water_specificheat      specificheat_water
 3444      # Values from www.engineeringtoolbox.com/specific-heat-metals-d_152.html
 3445 specificheat_aluminum   0.91 J/g K
 3446 specificheat_antimony   0.21 J/g K
 3447 specificheat_barium     0.20 J/g K
 3448 specificheat_beryllium  1.83 J/g K
 3449 specificheat_bismuth    0.13 J/g K
 3450 specificheat_cadmium    0.23 J/g K
 3451 specificheat_cesium     0.24 J/g K
 3452 specificheat_chromium   0.46 J/g K
 3453 specificheat_cobalt     0.42 J/g K
 3454 specificheat_copper     0.39 J/g K
 3455 specificheat_gallium    0.37 J/g K
 3456 specificheat_germanium  0.32 J/g K
 3457 specificheat_gold       0.13 J/g K
 3458 specificheat_hafnium    0.14 J/g K
 3459 specificheat_indium     0.24 J/g K
 3460 specificheat_iridium    0.13 J/g K
 3461 specificheat_iron       0.45 J/g K
 3462 specificheat_lanthanum  0.195 J/g K
 3463 specificheat_lead       0.13 J/g K
 3464 specificheat_lithium    3.57 J/g K
 3465 specificheat_lutetium   0.15 J/g K
 3466 specificheat_magnesium  1.05 J/g K
 3467 specificheat_manganese  0.48 J/g K
 3468 specificheat_mercury    0.14 J/g K
 3469 specificheat_molybdenum 0.25 J/g K
 3470 specificheat_nickel     0.44 J/g K
 3471 specificheat_osmium     0.13 J/g K
 3472 specificheat_palladium  0.24 J/g K
 3473 specificheat_platinum   0.13 J/g K
 3474 specificheat_plutonum   0.13 J/g K
 3475 specificheat_potassium  0.75 J/g K
 3476 specificheat_rhenium    0.14 J/g K
 3477 specificheat_rhodium    0.24 J/g K
 3478 specificheat_rubidium   0.36 J/g K
 3479 specificheat_ruthenium  0.24 J/g K
 3480 specificheat_scandium   0.57  J/g K
 3481 specificheat_selenium   0.32 J/g K
 3482 specificheat_silicon    0.71 J/g K
 3483 specificheat_silver     0.23 J/g K
 3484 specificheat_sodium     1.21 J/g K
 3485 specificheat_strontium  0.30 J/g K
 3486 specificheat_tantalum   0.14 J/g K
 3487 specificheat_thallium   0.13 J/g K
 3488 specificheat_thorium    0.13 J/g K
 3489 specificheat_tin        0.21 J/g K
 3490 specificheat_titanium   0.54 J/g K
 3491 specificheat_tungsten   0.13 J/g K
 3492 specificheat_uranium    0.12 J/g K
 3493 specificheat_vanadium   0.39 J/g K
 3494 specificheat_yttrium    0.30 J/g K
 3495 specificheat_zinc       0.39 J/g K
 3496 specificheat_zirconium  0.27 J/g K
 3497 specificheat_ethanol    2.3  J/g K
 3498 specificheat_ammonia    4.6 J/g K
 3499 specificheat_freon      0.91 J/g K   # R-12 at 0 degrees Fahrenheit
 3500 specificheat_gasoline   2.22 J/g K
 3501 specificheat_iodine     2.15 J/g K
 3502 specificheat_oliveoil   1.97 J/g K
 3503 
 3504 #  en.wikipedia.org/wiki/Heat_capacity#Table_of_specific_heat_capacities
 3505 specificheat_hydrogen   14.3 J/g K
 3506 specificheat_helium     5.1932 J/g K
 3507 specificheat_argon      0.5203 J/g K
 3508 specificheat_tissue     3.5 J/g K
 3509 specificheat_diamond    0.5091 J/g K
 3510 specificheat_granite    0.79 J/g K
 3511 specificheat_graphite   0.71 J/g K
 3512 specificheat_ice        2.11 J/g K
 3513 specificheat_asphalt    0.92 J/g K
 3514 specificheat_brick      0.84 J/g K
 3515 specificheat_concrete   0.88 J/g K
 3516 specificheat_glass_silica 0.84 J/g K
 3517 specificheat_glass_flint  0.503 J/g K
 3518 specificheat_glass_pyrex  0.753 J/g K
 3519 specificheat_gypsum     1.09 J/g K
 3520 specificheat_marble     0.88 J/g K
 3521 specificheat_sand       0.835 J/g K
 3522 specificheat_soil       0.835 J/g K
 3523 specificheat_wood       1.7 J/g K
 3524 
 3525 specificheat_sucrose    1.244 J/g K #www.sugartech.co.za/heatcapacity/index.php
 3526 
 3527 
 3528 # Energy densities of various fuels
 3529 #
 3530 # Most of these fuels have varying compositions or qualities and hence their
 3531 # actual energy densities vary.  These numbers are hence only approximate.
 3532 #
 3533 # E1. http://bioenergy.ornl.gov/papers/misc/energy_conv.html
 3534 # E2. http://www.aps.org/policy/reports/popa-reports/energy/units.cfm
 3535 # E3. http://www.ior.com.au/ecflist.html
 3536 
 3537 tonoil                  1e10 cal_IT    # Ton oil equivalent.  A conventional
 3538                                        # value for the energy released by
 3539 toe                     tonoil         # burning one metric ton of oil. [18,E2]
 3540                                        # Note that energy per mass of petroleum
 3541                                        # products is fairly constant.
 3542                                        # Variations in volumetric energy
 3543                                        # density result from variations in the
 3544                                        # density (kg/m^3) of different fuels.
 3545                                        # This definition is given by the
 3546                                        # IEA/OECD.
 3547 toncoal                 7e9 cal_IT     # Energy in metric ton coal from [18].
 3548                                        # This is a nominal value which
 3549                                        # is close to the heat content
 3550                                        # of coal used in the 1950's
 3551 barreloil               5.8 Mbtu       # Conventional value for barrel of crude
 3552                                        # oil [E2].  Actual range is 5.6 - 6.3.
 3553 naturalgas_HHV          1027 btu/ft3   # Energy content of natural gas.  HHV
 3554 naturalgas_LHV          930 btu/ft3    # is for Higher Heating Value and
 3555 naturalgas              naturalgas_HHV # includes energy from condensation
 3556                                        # combustion products.  LHV is for Lower
 3557                                        # Heating Value and excludes these.
 3558                                        # American publications typically report
 3559                                        # HHV whereas European ones report LHV.
 3560 charcoal                30 GJ/tonne
 3561 woodenergy_dry          20 GJ/tonne    # HHV, a cord weights about a tonne
 3562 woodenergy_airdry       15 GJ/tonne    # 20% moisture content
 3563 coal_bituminous         27 GJ / tonne
 3564 coal_lignite            15 GJ / tonne
 3565 coal_US                 22 GJ / uston  # Average for US coal (short ton), 1995
 3566 ethanol_HHV         84000 btu/usgallon
 3567 ethanol_LHV         75700 btu/usgallon
 3568 diesel             130500 btu/usgallon
 3569 gasoline_LHV       115000 btu/usgallon
 3570 gasoline_HHV       125000 btu/usgallon
 3571 gasoline                gasoline_HHV
 3572 heating                 37.3 MJ/liter
 3573 fueloil                 39.7 MJ/liter  # low sulphur
 3574 propane                 93.3 MJ/m^3
 3575 butane                  124 MJ/m^3
 3576 
 3577 # These values give total energy from uranium fission.  Actual efficiency
 3578 # of nuclear power plants is around 30%-40%.  Note also that some reactors
 3579 # use enriched uranium around 3% U-235.  Uranium during processing or use
 3580 # may be in a compound of uranium oxide or uranium hexafluoride, in which
 3581 # case the energy density would be lower depending on how much uranium is
 3582 # in the compound.
 3583 
 3584 uranium_pure     200 MeV avogadro / (235.0439299 g/mol)  # Pure U-235
 3585 uranium_natural         0.7% uranium_pure        # Natural uranium: 0.7% U-235
 3586 
 3587 # Celsius heat unit: energy to raise a pound of water 1 degC
 3588 
 3589 celsiusheatunit         cal lb degC / gram K
 3590 chu                     celsiusheatunit
 3591 
 3592 POWER                   watt
 3593 
 3594 # "Apparent" average power in an AC circuit, the product of rms voltage
 3595 # and rms current, equal to the true power in watts when voltage and
 3596 # current are in phase.  In a DC circuit, always equal to the true power.
 3597 
 3598 VA                      volt ampere
 3599 
 3600 kWh                     kilowatt hour
 3601 
 3602 # The horsepower is supposedly the power of one horse pulling.   Obviously
 3603 # different people had different horses.
 3604 
 3605 horsepower              550 foot pound force / sec    # Invented by James Watt
 3606 mechanicalhorsepower    horsepower
 3607 hp                      horsepower
 3608 metrichorsepower        75 kilogram force meter / sec # PS=Pferdestaerke in
 3609 electrichorsepower      746 W                         # Germany
 3610 boilerhorsepower        9809.50 W
 3611 waterhorsepower         746.043 W
 3612 brhorsepower            745.70 W
 3613 donkeypower             250 W
 3614 chevalvapeur            metrichorsepower
 3615 
 3616 #
 3617 # Heat Transfer
 3618 #
 3619 # Thermal conductivity, K, measures the rate of heat transfer across
 3620 # a material.  The heat transfered is
 3621 #     Q = K dT A t / L
 3622 # where dT is the temperature difference across the material, A is the
 3623 # cross sectional area, t is the time, and L is the length (thickness).
 3624 # Thermal conductivity is a material property.
 3625 
 3626 THERMAL_CONDUCTIVITY    POWER / AREA (TEMPERATURE_DIFFERENCE/LENGTH)
 3627 THERMAL_RESISTIVITY     1/THERMAL_CONDUCTIVITY
 3628 
 3629 # Thermal conductance is the rate at which heat flows across a given
 3630 # object, so the area and thickness have been fixed.  It depends on
 3631 # the size of the object and is hence not a material property.
 3632 
 3633 THERMAL_CONDUCTANCE     POWER / TEMPERATURE_DIFFERENCE
 3634 THERMAL_RESISTANCE      1/THERMAL_CONDUCTANCE
 3635 
 3636 # Thermal admittance is the rate of heat flow per area across an
 3637 # object whose thickness has been fixed.  Its reciprocal, thermal
 3638 # insulation, is used to for measuring the heat transfer per area
 3639 # of sheets of insulation or cloth that are of specified thickness.
 3640 
 3641 THERMAL_ADMITTANCE      THERMAL_CONDUCTIVITY / LENGTH
 3642 THERMAL_INSULANCE       THERMAL_RESISTIVITY LENGTH
 3643 THERMAL_INSULATION      THERMAL_RESISTIVITY LENGTH
 3644 
 3645 Rvalue                  degF ft^2 hr / btu
 3646 Uvalue                  1/Rvalue
 3647 europeanUvalue          watt / m^2 K
 3648 RSI                     degC m^2 / W
 3649 clo                     0.155 degC m^2 / W # Supposed to be the insulance
 3650                                            # required to keep a resting person
 3651                                            # comfortable indoors.  The value
 3652                                            # given is from NIST and the CRC,
 3653                                            # but [5] gives a slightly different
 3654                                            # value of 0.875 ft^2 degF hr / btu.
 3655 tog                     0.1 degC m^2 / W   # Also used for clothing.
 3656 
 3657 
 3658 # The bel was defined by engineers of Bell Laboratories to describe the
 3659 # reduction in audio level over a length of one mile. It was originally
 3660 # called the transmission unit (TU) but was renamed around 1923 to honor
 3661 # Alexander Graham Bell. The bel proved inconveniently large so the decibel
 3662 # has become more common.  The decibel is dimensionless since it reports a
 3663 # ratio, but it is used in various contexts to report a signal's power
 3664 # relative to some reference level.
 3665 
 3666 bel(x)     units=[1;1] range=(0,) 10^(x);    log(bel)    # Basic bel definition
 3667 decibel(x) units=[1;1] range=(0,) 10^(x/10); 10 log(decibel) # Basic decibel
 3668 dB()       decibel                                           # Abbreviation
 3669 dBW(x)     units=[1;W] range=(0,) dB(x) W ;  ~dB(dBW/W)      # Reference = 1 W
 3670 dBk(x)     units=[1;W] range=(0,) dB(x) kW ; ~dB(dBk/kW)     # Reference = 1 kW
 3671 dBf(x)     units=[1;W] range=(0,) dB(x) fW ; ~dB(dBf/fW)     # Reference = 1 fW
 3672 dBm(x)     units=[1;W] range=(0,) dB(x) mW ; ~dB(dBm/mW)     # Reference = 1 mW
 3673 dBmW(x)    units=[1;W] range=(0,) dBm(x) ;   ~dBm(dBmW)      # Reference = 1 mW
 3674 dBJ(x)     units=[1;J] range=(0,) dB(x) J; ~dB(dBJ/J)        # Energy relative
 3675                                      # to 1 joule.  Used for power spectral
 3676                                      # density since W/Hz = J
 3677 
 3678 # When used to measure amplitude, voltage, or current the signal is squared
 3679 # because power is proportional to the square of these measures.  The root
 3680 # mean square (RMS) voltage is typically used with these units.
 3681 
 3682 dBV(x)  units=[1;V] range=(0,) dB(0.5 x) V;~dB(dBV^2 / V^2) # Reference = 1 V
 3683 dBmV(x) units=[1;V] range=(0,) dB(0.5 x) mV;~dB(dBmV^2/mV^2)# Reference = 1 mV
 3684 dBuV(x) units=[1;V] range=(0,) dB(0.5 x) microV ; ~dB(dBuV^2 / microV^2)
 3685                                    # Reference = 1 microvolt
 3686 
 3687 # Referenced to the voltage that causes 1 mW dissipation in a 600 ohm load.
 3688 # Originally defined as dBv but changed to prevent confusion with dBV.
 3689 # The "u" is for unloaded.
 3690 dBu(x) units=[1;V] range=(0,) dB(0.5 x) sqrt(mW 600 ohm) ; \
 3691                               ~dB(dBu^2 / mW 600 ohm)
 3692 dBv(x) units=[1;V] range=(0,) dBu(x) ; ~dBu(dBv)  # Synonym for dBu
 3693 
 3694 
 3695 # Measurements for sound in air, referenced to the threshold of human hearing
 3696 # Note that sound in other media typically uses 1 micropascal as a reference
 3697 # for sound pressure.  Units dBA, dBB, dBC, refer to different frequency
 3698 # weightings meant to approximate the human ear's response.
 3699 
 3700 dBSPL(x) units=[1;Pa] range=(0,) dB(0.5 x) 20 microPa ;  \
 3701                                  ~dB(dBSPL^2 / (20 microPa)^2) # pressure
 3702 dBSIL(x) units=[1;W/m^2] range=(0,) dB(x) 1e-12 W/m^2; \
 3703                                     ~dB(dBSIL / (1e-12 W/m^2)) # intensity
 3704 dBSWL(x) units=[1;W] range=(0,) dB(x) 1e-12 W; ~dB(dBSWL/1e-12 W)
 3705 
 3706 
 3707 # Misc other measures
 3708 
 3709 ENTROPY                 ENERGY / TEMPERATURE
 3710 clausius                1e3 cal/K       # A unit of physical entropy
 3711 langley                 thermcalorie/cm^2    # Used in radiation theory
 3712 poncelet                100 kg force m / s
 3713 tonrefrigeration        uston 144 btu / lb day # One ton refrigeration is
 3714                                         # the rate of heat extraction required
 3715                                         # turn one ton of water to ice in
 3716                                         # a day.  Ice is defined to have a
 3717                                         # latent heat of 144 btu/lb.
 3718 tonref                  tonrefrigeration
 3719 refrigeration           tonref / ton
 3720 frigorie                1000 cal_15     # Used in refrigeration engineering.
 3721 tnt                     1e9 cal_th / ton# So you can write tons tnt. This
 3722                                         # is a defined, not measured, value.
 3723 airwatt                 8.5 (ft^3/min) inH2O # Measure of vacuum power as
 3724                                              # pressure times air flow.
 3725 
 3726 # Nuclear weapon yields 
 3727 
 3728 davycrocket             10 ton tnt         # lightest US tactical nuclear weapon
 3729 hiroshima               15.5 kiloton tnt   # Uranium-235 fission bomb
 3730 nagasaki                21 kiloton tnt     # Plutonium-239 fission bomb
 3731 fatman                  nagasaki
 3732 littleboy               hiroshima
 3733 ivyking                 500 kiloton tnt    # most powerful fission bomb
 3734 castlebravo             15 megaton tnt     # most powerful US test
 3735 b53bomb                 9 megaton tnt
 3736                  # http://rarehistoricalphotos.com/gadget-first-atomic-bomb/
 3737 trinity                 18 kiloton tnt     # July 16, 1945
 3738 gadget                  trinity
 3739 
 3740 #
 3741 # Permeability: The permeability or permeance, n, of a substance determines
 3742 # how fast vapor flows through the substance.  The formula W = n A dP
 3743 # holds where W is the rate of flow (in mass/time), n is the permeability,
 3744 # A is the area of the flow path, and dP is the vapor pressure difference.
 3745 #
 3746 
 3747 perm_0C                 grain / hr ft^2 inHg
 3748 perm_zero               perm_0C
 3749 perm_0                  perm_0C
 3750 perm                    perm_0C
 3751 perm_23C                grain / hr ft^2 in Hg23C
 3752 perm_twentythree        perm_23C
 3753 
 3754 #
 3755 # Counting measures
 3756 #
 3757 
 3758 pair                    2
 3759 brace                   2
 3760 nest                    3     # often used for items like bowls that
 3761                               #   nest together
 3762 hattrick                3     # Used in sports, especially cricket and ice
 3763                               #   hockey to report the number of goals.
 3764 dicker                  10
 3765 dozen                   12
 3766 bakersdozen             13
 3767 score                   20
 3768 flock                   40
 3769 timer                   40
 3770 shock                   60
 3771 toncount                100   # Used in sports in the UK
 3772 longhundred             120   # From a germanic counting system
 3773 gross                   144
 3774 greatgross              12 gross
 3775 tithe                   1|10  # From Anglo-Saxon word for tenth
 3776 
 3777 # Paper counting measure
 3778 
 3779 shortquire              24
 3780 quire                   25
 3781 shortream               480
 3782 ream                    500
 3783 perfectream             516
 3784 bundle                  2 reams
 3785 bale                    5 bundles
 3786 
 3787 #
 3788 # Paper measures
 3789 #
 3790 
 3791 # USA paper sizes
 3792 
 3793 lettersize              8.5 inch 11 inch
 3794 legalsize               8.5 inch 14 inch
 3795 ledgersize              11 inch 17 inch
 3796 executivesize           7.25 inch 10.5 inch
 3797 Apaper                  8.5 inch 11 inch
 3798 Bpaper                  11 inch 17 inch
 3799 Cpaper                  17 inch 22 inch
 3800 Dpaper                  22 inch 34 inch
 3801 Epaper                  34 inch 44 inch
 3802 
 3803 # Correspondence envelope sizes.  #10 is the standard business
 3804 # envelope in the USA. 
 3805 
 3806 envelope6_25size        3.5 inch 6 inch
 3807 envelope6_75size        3.625 inch 6.5 inch
 3808 envelope7size           3.75 inch 6.75 inch
 3809 envelope7_75size        3.875 inch 7.5 inch
 3810 envelope8_625size       3.625 inch 8.625 inch
 3811 envelope9size           3.875 inch 8.875 inch
 3812 envelope10size          4.125 inch 9.5 inch
 3813 envelope11size          4.5 inch 10.375 inch
 3814 envelope12size          4.75 inch 11 inch
 3815 envelope14size          5 inch 11.5 inch
 3816 envelope16size          6 inch 12 inch
 3817 
 3818 # Announcement envelope sizes (no relation to metric paper sizes like A4)
 3819 
 3820 envelopeA1size          3.625 inch 5.125 inch  # same as 4bar
 3821 envelopeA2size          4.375 inch 5.75 inch
 3822 envelopeA6size          4.75 inch 6.5 inch
 3823 envelopeA7size          5.25 inch 7.25 inch
 3824 envelopeA8size          5.5 inch 8.125 inch   
 3825 envelopeA9size          5.75 inch 8.75 inch
 3826 envelopeA10size         6 inch 9.5 inch
 3827 
 3828 # Baronial envelopes
 3829 
 3830 envelope4bar            3.625 inch 5.125 inch  # same as A1
 3831 envelope5_5bar          4.375 inch 5.75 inch
 3832 envelope6bar            4.75 inch 6.5 inch
 3833 
 3834 # Coin envelopes
 3835 
 3836 envelope1baby           2.25 inch 3.5 inch     # same as #1 coin
 3837 envelope00coin          1.6875 inch 2.75 inch
 3838 envelope1coin           2.25 inch 3.5 inch
 3839 envelope3coin           2.5 inch 4.25 inch
 3840 envelope4coin           3 inch 4.5 inch
 3841 envelope4_5coin         3 inch 4.875 inch
 3842 envelope5coin           2.875 inch 5.25 inch
 3843 envelope5_5coin         3.125 inch 5.5 inch
 3844 envelope6coin           3.375 inch 6 inch
 3845 envelope7coin           3.5 inch 6.5 inch
 3846 
 3847 # The metric paper sizes are defined so that if a sheet is cut in half
 3848 # along the short direction, the result is two sheets which are
 3849 # similar to the original sheet.  This means that for any metric size,
 3850 # the long side is close to sqrt(2) times the length of the short
 3851 # side.  Each series of sizes is generated by repeated cuts in half,
 3852 # with the values rounded down to the nearest millimeter.
 3853 
 3854 A0paper                 841 mm 1189 mm   # The basic size in the A series
 3855 A1paper                 594 mm  841 mm   # is defined to have an area of
 3856 A2paper                 420 mm  594 mm   # one square meter.
 3857 A3paper                 297 mm  420 mm
 3858 A4paper                 210 mm  297 mm
 3859 A5paper                 148 mm  210 mm
 3860 A6paper                 105 mm  148 mm
 3861 A7paper                  74 mm  105 mm
 3862 A8paper                  52 mm   74 mm
 3863 A9paper                  37 mm   52 mm
 3864 A10paper                 26 mm   37 mm
 3865 
 3866 B0paper                1000 mm 1414 mm   # The basic B size has an area
 3867 B1paper                 707 mm 1000 mm   # of sqrt(2) square meters.
 3868 B2paper                 500 mm  707 mm
 3869 B3paper                 353 mm  500 mm
 3870 B4paper                 250 mm  353 mm
 3871 B5paper                 176 mm  250 mm
 3872 B6paper                 125 mm  176 mm
 3873 B7paper                  88 mm  125 mm
 3874 B8paper                  62 mm   88 mm
 3875 B9paper                  44 mm   62 mm
 3876 B10paper                 31 mm   44 mm
 3877 
 3878 C0paper                 917 mm 1297 mm   # The basic C size has an area
 3879 C1paper                 648 mm  917 mm   # of sqrt(sqrt(2)) square meters.
 3880 C2paper                 458 mm  648 mm
 3881 C3paper                 324 mm  458 mm   # Intended for envelope sizes
 3882 C4paper                 229 mm  324 mm
 3883 C5paper                 162 mm  229 mm
 3884 C6paper                 114 mm  162 mm
 3885 C7paper                  81 mm  114 mm
 3886 C8paper                  57 mm   81 mm
 3887 C9paper                  40 mm   57 mm
 3888 C10paper                 28 mm   40 mm
 3889 
 3890 # gsm (Grams per Square Meter), a sane, metric paper weight measure
 3891 
 3892 gsm                     grams / meter^2
 3893 
 3894 # In the USA, a collection of crazy historical paper measures are used.  Paper
 3895 # is measured as a weight of a ream of that particular type of paper.  This is
 3896 # sometimes called the "substance" or "basis" (as in "substance 20" paper).
 3897 # The standard sheet size or "basis size" varies depending on the type of
 3898 # paper.  As a result, 20 pound bond paper and 50 pound text paper are actually
 3899 # about the same weight.  The different sheet sizes were historically the most
 3900 # convenient for printing or folding in the different applications.  These
 3901 # different basis weights are standards maintained by American Society for
 3902 # Testing Materials (ASTM) and the American Forest and Paper Association
 3903 # (AF&PA).
 3904 
 3905 poundbookpaper          lb / 25 inch 38 inch ream
 3906 lbbook                  poundbookpaper
 3907 poundtextpaper          poundbookpaper
 3908 lbtext                  poundtextpaper
 3909 poundoffsetpaper        poundbookpaper    # For offset printing
 3910 lboffset                poundoffsetpaper
 3911 poundbiblepaper         poundbookpaper    # Designed to be lightweight, thin,
 3912 lbbible                 poundbiblepaper   # strong and opaque.
 3913 poundtagpaper           lb / 24 inch 36 inch ream
 3914 lbtag                   poundtagpaper
 3915 poundbagpaper           poundtagpaper
 3916 lbbag                   poundbagpaper
 3917 poundnewsprintpaper     poundtagpaper
 3918 lbnewsprint             poundnewsprintpaper
 3919 poundposterpaper        poundtagpaper
 3920 lbposter                poundposterpaper
 3921 poundtissuepaper        poundtagpaper
 3922 lbtissue                poundtissuepaper
 3923 poundwrappingpaper      poundtagpaper
 3924 lbwrapping              poundwrappingpaper
 3925 poundwaxingpaper        poundtagpaper
 3926 lbwaxing                poundwaxingpaper
 3927 poundglassinepaper      poundtagpaper
 3928 lbglassine              poundglassinepaper
 3929 poundcoverpaper         lb / 20 inch 26 inch ream
 3930 lbcover                 poundcoverpaper
 3931 poundindexpaper         lb / 25.5 inch 30.5 inch ream
 3932 lbindex                 poundindexpaper
 3933 poundindexbristolpaper  poundindexpaper
 3934 lbindexbristol          poundindexpaper
 3935 poundbondpaper          lb / 17 inch 22 inch ream  # Bond paper is stiff and
 3936 lbbond                  poundbondpaper             # durable for repeated
 3937 poundwritingpaper       poundbondpaper             # filing, and it resists
 3938 lbwriting               poundwritingpaper          # ink penetration.
 3939 poundledgerpaper        poundbondpaper
 3940 lbledger                poundledgerpaper
 3941 poundcopypaper          poundbondpaper
 3942 lbcopy                  poundcopypaper
 3943 poundblottingpaper      lb / 19 inch 24 inch ream
 3944 lbblotting              poundblottingpaper
 3945 poundblankspaper        lb / 22 inch 28 inch ream
 3946 lbblanks                poundblankspaper
 3947 poundpostcardpaper      lb / 22.5 inch 28.5 inch ream
 3948 lbpostcard              poundpostcardpaper
 3949 poundweddingbristol     poundpostcardpaper
 3950 lbweddingbristol        poundweddingbristol
 3951 poundbristolpaper       poundweddingbristol
 3952 lbbristol               poundbristolpaper
 3953 poundboxboard           lb / 1000 ft^2
 3954 lbboxboard              poundboxboard
 3955 poundpaperboard         poundboxboard
 3956 lbpaperboard            poundpaperboard
 3957 
 3958 # When paper is marked in units of M, it means the weight of 1000 sheets of the
 3959 # given size of paper.  To convert this to paper weight, divide by the size of
 3960 # the paper in question.
 3961 
 3962 paperM                  lb / 1000
 3963 
 3964 # In addition paper weight is reported in "caliper" which is simply the
 3965 # thickness of one sheet, typically in inches.  Thickness is also reported in
 3966 # "points" where a point is 1|1000 inch.  These conversions are supplied to
 3967 # convert these units roughly (using an approximate density) into the standard
 3968 # paper weight values.
 3969 
 3970 pointthickness          0.001 in
 3971 paperdensity            0.8 g/cm^3        # approximate--paper densities vary!
 3972 papercaliper            in paperdensity
 3973 paperpoint              pointthickness paperdensity
 3974 
 3975 #
 3976 # Printing
 3977 #
 3978 
 3979 fournierpoint           0.1648 inch / 12  # First definition of the printers
 3980                                           # point made by Pierre Fournier who
 3981                                           # defined it in 1737 as 1|12 of a
 3982                                           # cicero which was 0.1648 inches.
 3983 olddidotpoint           1|72 frenchinch   # François Ambroise Didot, one of
 3984                                           # a family of printers, changed
 3985                                           # Fournier's definition around 1770
 3986                                           # to fit to the French units then in
 3987                                           # use.
 3988 bertholdpoint           1|2660 m          # H. Berthold tried to create a
 3989                                           # metric version of the didot point
 3990                                           # in 1878.
 3991 INpoint                 0.4 mm            # This point was created by a
 3992                                           # group directed by Fermin Didot in
 3993                                           # 1881 and is associated with the
 3994                                           # imprimerie nationale.  It doesn't
 3995                                           # seem to have been used much.
 3996 germandidotpoint        0.376065 mm       # Exact definition appears in DIN
 3997                                           # 16507, a German standards document
 3998                                           # of 1954.  Adopted more broadly  in
 3999                                           # 1966 by ???
 4000 metricpoint             3|8 mm            # Proposed in 1977 by Eurograf
 4001 oldpoint                1|72.27 inch      # The American point was invented
 4002 printerspoint           oldpoint          # by Nelson Hawks in 1879 and
 4003 texpoint                oldpoint          # dominates USA publishing.
 4004                                           # It was standardized by the American
 4005                                           # Typefounders Association at the
 4006                                           # value of 0.013837 inches exactly.
 4007                                           # Knuth uses the approximation given
 4008                                           # here (which is very close).  The
 4009                                           # comp.fonts FAQ claims that this
 4010                                           # value is supposed to be 1|12 of a
 4011                                           # pica where 83 picas is equal to 35
 4012                                           # cm.  But this value differs from
 4013                                           # the standard.
 4014 texscaledpoint          1|65536 texpoint  # The TeX typesetting system uses
 4015 texsp                   texscaledpoint    # this for all computations.
 4016 computerpoint           1|72 inch         # The American point was rounded
 4017 point                   computerpoint
 4018 computerpica            12 computerpoint  # to an even 1|72 inch by computer
 4019 postscriptpoint         computerpoint     # people at some point.
 4020 pspoint                 postscriptpoint
 4021 twip                    1|20 point        # TWentieth of an Imperial Point
 4022 Q                       1|4 mm            # Used in Japanese phototypesetting
 4023                                           # Q is for quarter
 4024 frenchprinterspoint     olddidotpoint
 4025 didotpoint              germandidotpoint  # This seems to be the dominant value
 4026 europeanpoint           didotpoint        # for the point used in Europe
 4027 cicero                  12 didotpoint
 4028 
 4029 stick                   2 inches
 4030 
 4031 # Type sizes
 4032 
 4033 excelsior               3 oldpoint
 4034 brilliant               3.5 oldpoint
 4035 diamondtype             4 oldpoint
 4036 pearl                   5 oldpoint
 4037 agate                   5.5 oldpoint  # Originally agate type was 14 lines per
 4038                                       #   inch, giving a value of 1|14 in.
 4039 ruby                    agate         # British
 4040 nonpareil               6 oldpoint
 4041 mignonette              6.5 oldpoint
 4042 emerald                 mignonette    # British
 4043 minion                  7 oldpoint
 4044 brevier                 8 oldpoint
 4045 bourgeois               9 oldpoint
 4046 longprimer              10 oldpoint
 4047 smallpica               11 oldpoint
 4048 pica                    12 oldpoint
 4049 english                 14 oldpoint
 4050 columbian               16 oldpoint
 4051 greatprimer             18 oldpoint
 4052 paragon                 20 oldpoint
 4053 meridian                44 oldpoint
 4054 canon                   48 oldpoint
 4055 
 4056 # German type sizes
 4057 
 4058 nonplusultra            2 didotpoint
 4059 brillant                3 didotpoint
 4060 diamant                 4 didotpoint
 4061 perl                    5 didotpoint
 4062 nonpareille             6 didotpoint
 4063 kolonel                 7 didotpoint
 4064 petit                   8 didotpoint
 4065 borgis                  9 didotpoint
 4066 korpus                  10 didotpoint
 4067 corpus                  korpus
 4068 garamond                korpus
 4069 mittel                  14 didotpoint
 4070 tertia                  16 didotpoint
 4071 text                    18 didotpoint
 4072 kleine_kanon            32 didotpoint
 4073 kanon                   36 didotpoint
 4074 grobe_kanon             42 didotpoint
 4075 missal                  48 didotpoint
 4076 kleine_sabon            72 didotpoint
 4077 grobe_sabon             84 didotpoint
 4078 
 4079 #
 4080 # Information theory units.  Note that the name "entropy" is used both
 4081 # to measure information and as a physical quantity.
 4082 #
 4083 
 4084 INFORMATION             bit
 4085 
 4086 nat                     (1/ln(2)) bits       # Entropy measured base e
 4087 hartley                 log2(10) bits        # Entropy of a uniformly
 4088 ban                     hartley              #   distributed random variable
 4089                                              #   over 10 symbols.
 4090 dit                     hartley              # from Decimal digIT
 4091 
 4092 #
 4093 # Computer
 4094 #
 4095 
 4096 bps                     bit/sec              # Sometimes the term "baud" is
 4097                                              #   incorrectly used to refer to
 4098                                              #   bits per second.  Baud refers
 4099                                              #   to symbols per second.  Modern
 4100                                              #   modems transmit several bits
 4101                                              #   per symbol.
 4102 byte                    8 bit                # Not all machines had 8 bit
 4103 B                       byte                 #   bytes, but these days most of
 4104                                              #   them do.  But beware: for
 4105                                              #   transmission over modems, a
 4106                                              #   few extra bits are used so
 4107                                              #   there are actually 10 bits per
 4108                                              #   byte.
 4109 octet                   8 bits               # The octet is always 8 bits
 4110 nybble                  4 bits               # Half of a byte. Sometimes
 4111                                              #   equal to different lengths
 4112                                              #   such as 3 bits.
 4113 nibble                  nybble
 4114 nyp                     2 bits               # Donald Knuth asks in an exercise
 4115                                              #   for a name for a 2 bit
 4116                                              #   quantity and gives the "nyp"
 4117                                              #   as a solution due to Gregor
 4118                                              #   Purdy.  Not in common use.
 4119 meg                     megabyte             # Some people consider these
 4120                                              # units along with the kilobyte
 4121 gig                     gigabyte             # to be defined according to
 4122                                              # powers of 2 with the kilobyte
 4123                                              # equal to 2^10 bytes, the
 4124                                              # megabyte equal to 2^20 bytes and
 4125                                              # the gigabyte equal to 2^30 bytes
 4126                                              # but these usages are forbidden
 4127                                              # by SI.  Binary prefixes have
 4128                                              # been defined by IEC to replace
 4129                                              # the SI prefixes.  Use them to
 4130                                              # get the binary values: KiB, MiB,
 4131                                              # and GiB.
 4132 jiffy                   0.01 sec     # This is defined in the Jargon File
 4133 jiffies                 jiffy        # (http://www.jargon.org) as being the
 4134                                      # duration of a clock tick for measuring
 4135                                      # wall-clock time.  Supposedly the value
 4136                                      # used to be 1|60 sec or 1|50 sec
 4137                                      # depending on the frequency of AC power,
 4138                                      # but then 1|100 sec became more common.
 4139                                      # On linux systems, this term is used and
 4140                                      # for the Intel based chips, it does have
 4141                                      # the value of .01 sec.  The Jargon File
 4142                                      # also lists two other definitions:
 4143                                      # millisecond, and the time taken for
 4144                                      # light to travel one foot.
 4145 cdaudiospeed      44.1 kHz 2*16 bits # CD audio data rate at 44.1 kHz with 2
 4146                                      # samples of sixteen bits each.
 4147 cdromspeed       75 2048 bytes / sec # For data CDs (mode1) 75 sectors are read
 4148                                      # each second with 2048 bytes per sector.
 4149                                      # Audio CDs do not have sectors, but
 4150                                      # people sometimes divide the bit rate by
 4151                                      # 75 and claim a sector length of 2352.
 4152                                      # Data CDs have a lower rate due to
 4153                                      # increased error correction overhead.
 4154                                      # There is a rarely used mode (mode2) with
 4155                                      # 2336 bytes per sector that has fewer
 4156                                      # error correction bits than mode1.
 4157 dvdspeed                 1385 kB/s   # This is the "1x" speed of a DVD using
 4158                                      # constant linear velocity (CLV) mode.
 4159                                      # Modern DVDs may vary the linear velocity
 4160                                      # as they go from the inside to the
 4161                                      # outside of the disc.
 4162                        # See http://www.osta.org/technology/dvdqa/dvdqa4.htm
 4163 #
 4164 # The IP address space is divided into subnets.  The number of hosts
 4165 # in a subnet depends on the length of the subnet prefix.  This is
 4166 # often written as /N where N is the number of bits in the prefix.
 4167 #
 4168 # https://en.wikipedia.org/wiki/Subnetwork
 4169 #
 4170 # These definitions gives the number of hosts for a subnet whose
 4171 # prefix has the specified length in bits.
 4172 #
 4173 
 4174 ipv4subnetsize(prefix_len) units=[1;1]  domain=[0,32] range=[1,4294967296] \
 4175                          2^(32-prefix_len) ; 32-log2(ipv4subnetsize)
 4176 ipv4classA               ipv4subnetsize(8)
 4177 ipv4classB               ipv4subnetsize(16)
 4178 ipv4classC               ipv4subnetsize(24)
 4179 
 4180 ipv6subnetsize(prefix_len) units=[1;1] domain=[0,128] \
 4181                          range=[1,340282366920938463463374607431768211456] \
 4182                          2^(128-prefix_len) ; 128-log2(ipv6subnetsize)
 4183 
 4184 #
 4185 # Musical measures.  Musical intervals expressed as ratios.  Multiply
 4186 # two intervals together to get the sum of the interval.  The function
 4187 # musicalcent can be used to convert ratios to cents.
 4188 #
 4189 
 4190 # Perfect intervals
 4191 
 4192 octave                  2
 4193 majorsecond             musicalfifth^2 / octave
 4194 majorthird              5|4
 4195 minorthird              6|5
 4196 musicalfourth           4|3
 4197 musicalfifth            3|2
 4198 majorsixth              musicalfourth majorthird
 4199 minorsixth              musicalfourth minorthird
 4200 majorseventh            musicalfifth majorthird
 4201 minorseventh            musicalfifth minorthird
 4202 
 4203 pythagoreanthird        majorsecond musicalfifth^2 / octave
 4204 syntoniccomma           pythagoreanthird / majorthird
 4205 pythagoreancomma        musicalfifth^12 / octave^7
 4206 
 4207 # Equal tempered definitions
 4208 
 4209 semitone                octave^(1|12)
 4210 musicalcent(x) units=[1;1] range=(0,) semitone^(x/100) ; \
 4211                                       100 log(musicalcent)/log(semitone)
 4212 
 4213 #
 4214 # Musical note lengths.
 4215 #
 4216 
 4217 wholenote               !
 4218 MUSICAL_NOTE_LENGTH     wholenote
 4219 halfnote                1|2 wholenote
 4220 quarternote             1|4 wholenote
 4221 eighthnote              1|8 wholenote
 4222 sixteenthnote           1|16 wholenote
 4223 thirtysecondnote        1|32 wholenote
 4224 sixtyfourthnote         1|64 wholenote
 4225 dotted                  3|2
 4226 doubledotted            7|4
 4227 breve                   doublewholenote
 4228 semibreve               wholenote
 4229 minimnote               halfnote
 4230 crotchet                quarternote
 4231 quaver                  eighthnote
 4232 semiquaver              sixteenthnote
 4233 demisemiquaver          thirtysecondnote
 4234 hemidemisemiquaver      sixtyfourthnote
 4235 semidemisemiquaver      hemidemisemiquaver
 4236 
 4237 #
 4238 # yarn and cloth measures
 4239 #
 4240 
 4241 # yarn linear density
 4242 
 4243 woolyarnrun             1600 yard/pound # 1600 yds of "number 1 yarn" weighs
 4244                                         # a pound.
 4245 yarncut                 300 yard/pound  # Less common system used in
 4246                                         # Pennsylvania for wool yarn
 4247 cottonyarncount         840 yard/pound
 4248 linenyarncount          300 yard/pound  # Also used for hemp and ramie
 4249 worstedyarncount        1680 ft/pound
 4250 metricyarncount         meter/gram
 4251 denier                  1|9 tex            # used for silk and rayon
 4252 manchesteryarnnumber    drams/1000 yards   # old system used for silk
 4253 pli                     lb/in
 4254 typp                    1000 yd/lb   # abbreviation for Thousand Yard Per Pound
 4255 asbestoscut             100 yd/lb    # used for glass and asbestos yarn
 4256 
 4257 tex                     gram / km    # rational metric yarn measure, meant
 4258 drex                    0.1 tex      # to be used for any kind of yarn
 4259 poumar                  lb / 1e6 yard
 4260 
 4261 # yarn and cloth length
 4262 
 4263 skeincotton             80*54 inch   # 80 turns of thread on a reel with a
 4264                                      #  54 in circumference (varies for other
 4265                                      #  kinds of thread)
 4266 cottonbolt              120 ft       # cloth measurement
 4267 woolbolt                210 ft
 4268 bolt                    cottonbolt
 4269 heer                    600 yards
 4270 cut                     300 yards    # used for wet-spun linen yarn
 4271 lea                     300 yards
 4272 
 4273 sailmakersyard          28.5 in
 4274 sailmakersounce         oz / sailmakersyard 36 inch
 4275 
 4276 silkmomme               momme / 25 yards 1.49 inch  # Traditional silk weight
 4277 silkmm                  silkmomme        # But it is also defined as
 4278                                          # lb/100 yd 45 inch.  The two
 4279                                          # definitions are slightly different
 4280                                          # and neither one seems likely to be
 4281                                          # the true source definition.
 4282 
 4283 #
 4284 # drug dosage
 4285 #
 4286 
 4287 mcg                     microgram        # Frequently used for vitamins
 4288 iudiptheria             62.8 microgram   # IU is for international unit
 4289 iupenicillin            0.6 microgram
 4290 iuinsulin               41.67 microgram
 4291 drop                    1|20 ml          # The drop was an old "unit" that was
 4292                                          # replaced by the minim.  But I was
 4293                                          # told by a pharmacist that in his
 4294                                          # profession, the conversion of 20
 4295                                          # drops per ml is actually used.
 4296 bloodunit               450 ml           # For whole blood.  For blood
 4297                                          # components, a blood unit is the
 4298                                          # quanity of the component found in a
 4299                                          # blood unit of whole blood.  The
 4300                                          # human body contains about 12 blood
 4301                                          # units of whole blood.
 4302 
 4303 #
 4304 # misc medical measure
 4305 #
 4306 
 4307 frenchcathetersize      1|3 mm           # measure used for the outer diameter
 4308                                          # of a catheter
 4309 charriere               frenchcathetersize
 4310 
 4311 
 4312 #
 4313 # fixup units for times when prefix handling doesn't do the job
 4314 #
 4315 
 4316 hectare                 hectoare
 4317 megohm                  megaohm
 4318 kilohm                  kiloohm
 4319 microhm                 microohm
 4320 megalerg                megaerg    # 'L' added to make it pronounceable [18].
 4321 
 4322 #
 4323 # Money
 4324 #
 4325 # Note that US$ is the primitive unit so other currencies are
 4326 # generally given in US$.
 4327 #
 4328 
 4329 unitedstatesdollar      US$
 4330 usdollar                US$
 4331 $                       dollar
 4332 mark                    germanymark
 4333 #bolivar                 venezuelabolivar       # Not all databases are 
 4334 #venezuelabolivarfuerte  1e-5 bolivar           #    supplying these
 4335 #bolivarfuerte           1e-5 bolivar           # The currency was revalued 
 4336 #oldbolivar              1|1000 bolivarfuerte   # twice
 4337 peseta                  spainpeseta
 4338 rand                    southafricarand
 4339 escudo                  portugalescudo
 4340 guilder                 netherlandsguilder
 4341 hollandguilder          netherlandsguilder
 4342 peso                    mexicopeso
 4343 yen                     japanyen
 4344 lira                    italylira
 4345 rupee                   indiarupee
 4346 drachma                 greecedrachma
 4347 franc                   francefranc
 4348 markka                  finlandmarkka
 4349 britainpound            unitedkingdompound
 4350 greatbritainpound       unitedkingdompound
 4351 unitedkingdompound      ukpound
 4352 poundsterling           britainpound
 4353 yuan                    chinayuan
 4354 
 4355 # Unicode Currency Names
 4356 
 4357 !utf8
 4358 icelandkróna            icelandkrona
 4359 polandzłoty             polandzloty
 4360 tongapa’anga            tongapa'anga
 4361 #venezuelabolívar        venezuelabolivar
 4362 vietnamđồng             vietnamdong
 4363 mongoliatögrög          mongoliatugrik
 4364 sãotomé&príncipedobra   saotome&principedobra
 4365 !endutf8
 4366 
 4367 UKP                     GBP        # Not an ISO code, but looks like one, and
 4368                                    # sometimes used on usenet.
 4369 
 4370 !include currency.units
 4371 
 4372 # Money on the gold standard, used in the late 19th century and early
 4373 # 20th century.
 4374 
 4375 olddollargold           23.22 grains goldprice  # Used until 1934
 4376 newdollargold           96|7 grains goldprice   # After Jan 31, 1934
 4377 dollargold              newdollargold
 4378 poundgold               113 grains goldprice    # British pound
 4379 
 4380 # Precious metals
 4381 
 4382 goldounce               goldprice troyounce
 4383 silverounce             silverprice troyounce
 4384 platinumounce           platinumprice troyounce
 4385 XAU                     goldounce
 4386 XPT                     platinumounce
 4387 XAG                     silverounce
 4388 
 4389 # Nominal masses of US coins.  Note that dimes, quarters and half dollars
 4390 # have weight proportional to value.  Before 1965 it was $40 / kg.
 4391 
 4392 USpennyweight           2.5 grams         # Since 1982, 48 grains before
 4393 USnickelweight          5 grams
 4394 USdimeweight            US$ 0.10 / (20 US$ / lb)   # Since 1965
 4395 USquarterweight         US$ 0.25 / (20 US$ / lb)   # Since 1965
 4396 UShalfdollarweight      US$ 0.50 / (20 US$ / lb)   # Since 1971
 4397 USdollarweight          8.1 grams         # Weight of Susan B. Anthony and
 4398                                           #   Sacagawea dollar coins
 4399 
 4400 # British currency
 4401 
 4402 quid                    britainpound        # Slang names
 4403 fiver                   5 quid
 4404 tenner                  10 quid
 4405 monkey                  500 quid
 4406 brgrand                 1000 quid
 4407 bob                     shilling
 4408 
 4409 shilling                1|20 britainpound   # Before decimalisation, there
 4410 oldpence                1|12 shilling       # were 20 shillings to a pound,
 4411 farthing                1|4 oldpence        # each of twelve old pence
 4412 guinea                  21 shilling         # Still used in horse racing
 4413 crown                   5 shilling
 4414 florin                  2 shilling
 4415 groat                   4 oldpence
 4416 tanner                  6 oldpence
 4417 brpenny                 0.01 britainpound
 4418 pence                   brpenny
 4419 tuppence                2 pence
 4420 tuppenny                tuppence
 4421 ha'penny                halfbrpenny
 4422 hapenny                 ha'penny
 4423 oldpenny                oldpence
 4424 oldtuppence             2 oldpence
 4425 oldtuppenny             oldtuppence
 4426 threepence              3 oldpence    # threepence never refers to new money
 4427 threepenny              threepence
 4428 oldthreepence           threepence
 4429 oldthreepenny           threepence
 4430 oldhalfpenny            halfoldpenny
 4431 oldha'penny             oldhalfpenny
 4432 oldhapenny              oldha'penny
 4433 brpony                  25 britainpound
 4434 
 4435 # Canadian currency
 4436 
 4437 loony                   1 canadadollar    # This coin depicts a loon
 4438 toony                   2 canadadollar
 4439 
 4440 # Cryptocurrency
 4441 
 4442 satoshi                 1e-8 bitcoin
 4443 XBT                     bitcoin           # nonstandard code
 4444 
 4445 #
 4446 # Units used for measuring volume of wood
 4447 #
 4448 
 4449 cord                    4*4*8 ft^3   # 4 ft by 4 ft by 8 ft bundle of wood
 4450 facecord                1|2 cord
 4451 cordfoot                1|8 cord     # One foot long section of a cord
 4452 cordfeet                cordfoot
 4453 housecord               1|3 cord     # Used to sell firewood for residences,
 4454                                      #   often confusingly called a "cord"
 4455 boardfoot               ft^2 inch    # Usually 1 inch thick wood
 4456 boardfeet               boardfoot
 4457 fbm                     boardfoot    # feet board measure
 4458 stack                   4 yard^3     # British, used for firewood and coal [18]
 4459 rick                    4 ft 8 ft 16 inches # Stack of firewood, supposedly
 4460                                      #   sometimes called a face cord, but this
 4461                                      #   value is equal to 1|3 cord.  Name
 4462                                      #   comes from an old Norse word for a
 4463                                      #   stack of wood.
 4464 stere                   m^3
 4465 timberfoot              ft^3         # Used for measuring solid blocks of wood
 4466 standard                120 12 ft 11 in 1.5 in  # This is the St Petersburg or
 4467                                      #   Pittsburg standard.  Apparently the
 4468                                      #   term is short for "standard hundred"
 4469                                      #   which was meant to refer to 100 pieces
 4470                                      #   of wood (deals).  However, this
 4471                                      #   particular standard is equal to 120
 4472                                      #   deals which are 12 ft by 11 in by 1.5
 4473                                      #   inches (not the standard deal).
 4474 hoppusfoot               (4/pi) ft^3 # Volume calculation suggested in 1736
 4475 hoppusboardfoot      1|12 hoppusfoot #   forestry manual by Edward Hoppus, for
 4476 hoppuston              50 hoppusfoot #   estimating the usable volume of a log.
 4477                                      #   It results from computing the volume
 4478                                      #   of a cylindrical log of length, L, and
 4479                                      #   girth (circumference), G, by V=L(G/4)^2.
 4480                                      #   The hoppus ton is apparently still in
 4481                                      #   use for shipments from Southeast Asia.
 4482 
 4483 # In Britain, the deal is apparently any piece of wood over 6 feet long, over
 4484 # 7 wide and 2.5 inches thick.  The OED doesn't give a standard size.  A piece
 4485 # of wood less than 7 inches wide is called a "batten".  This unit is now used
 4486 # exclusively for fir and pine.
 4487 
 4488 deal              12 ft 11 in 2.5 in # The standard North American deal [OED]
 4489 wholedeal        12 ft 11 in 1.25 in # If it's half as thick as the standard
 4490                                      #   deal it's called a "whole deal"!
 4491 splitdeal         12 ft 11 in 5|8 in # And half again as thick is a split deal.
 4492 
 4493 
 4494 # Used for shellac mixing rate
 4495 
 4496 poundcut            pound / gallon
 4497 lbcut               poundcut
 4498 
 4499 #
 4500 # Gas and Liquid flow units
 4501 #
 4502 
 4503 FLUID_FLOW              VOLUME / TIME
 4504 
 4505 # Some obvious volumetric gas flow units (cu is short for cubic)
 4506 
 4507 cumec                   m^3/s
 4508 cusec                   ft^3/s
 4509 
 4510 # Conventional abbreviations for fluid flow units
 4511 
 4512 gph                     gal/hr
 4513 gpm                     gal/min
 4514 mgd                     megagal/day
 4515 cfs                     ft^3/s
 4516 cfh                     ft^3/hour
 4517 cfm                     ft^3/min
 4518 lpm                     liter/min
 4519 lfm                     ft/min     # Used to report air flow produced by fans.
 4520                                    # Multiply by cross sectional area to get a
 4521                                    # flow in cfm.
 4522 
 4523 pru                     mmHg / (ml/min)  # peripheral resistance unit, used in
 4524                                          # medicine to assess blood flow in
 4525                                          # the capillaries.
 4526 
 4527 # Miner's inch:  This is an old historic unit used in the Western  United
 4528 # States.  It is generally defined as the rate of flow through a one square
 4529 # inch hole at a specified depth such as 4 inches.  In the late 19th century,
 4530 # volume of water was sometimes measured in the "24 hour inch".  Values for the
 4531 # miner's inch were fixed by state statues.  (This information is from a web
 4532 # site operated by the Nevada Division of Water Planning:  The Water Words
 4533 # Dictionary at http://www.state.nv.us/cnr/ndwp/dict-1/waterwds.htm.)
 4534 
 4535 minersinchAZ            1.5 ft^3/min
 4536 minersinchCA            1.5 ft^3/min
 4537 minersinchMT            1.5 ft^3/min
 4538 minersinchNV            1.5 ft^3/min
 4539 minersinchOR            1.5 ft^3/min
 4540 minersinchID            1.2 ft^3/min
 4541 minersinchKS            1.2 ft^3/min
 4542 minersinchNE            1.2 ft^3/min
 4543 minersinchNM            1.2 ft^3/min
 4544 minersinchND            1.2 ft^3/min
 4545 minersinchSD            1.2 ft^3/min
 4546 minersinchUT            1.2 ft^3/min
 4547 minersinchCO            1 ft^3/sec / 38.4  # 38.4 miner's inches = 1 ft^3/sec
 4548 minersinchBC            1.68 ft^3/min      # British Columbia
 4549 
 4550 # Oceanographic flow
 4551 
 4552 sverdrup                1e6 m^3 / sec   # Used to express flow of ocean
 4553                                         # currents.  Named after Norwegian
 4554                                         # oceanographer H. Sverdrup.
 4555 
 4556 # In vacuum science and some other applications, gas flow is measured
 4557 # as the product of volumetric flow and pressure.  This is useful
 4558 # because it makes it easy to compare with the flow at standard
 4559 # pressure (one atmosphere).  It also directly relates to the number
 4560 # of gas molecules per unit time, and hence to the mass flow if the
 4561 # molecular mass is known.
 4562 
 4563 GAS_FLOW                PRESSURE FLUID_FLOW
 4564 
 4565 sccm                    atm cc/min     # 's' is for "standard" to indicate
 4566 sccs                    atm cc/sec     # flow at standard pressure
 4567 scfh                    atm ft^3/hour  #
 4568 scfm                    atm ft^3/min
 4569 slpm                    atm liter/min
 4570 slph                    atm liter/hour
 4571 lusec                   liter micron Hg / s  # Used in vacuum science
 4572 
 4573 # US Standard Atmosphere (1976)
 4574 # Atmospheric temperature and pressure vs. geometric height above sea level
 4575 # This definition covers only the troposphere (the lowest atmospheric
 4576 # layer, up to 11 km), and assumes the layer is polytropic.
 4577 # A polytropic process is one for which PV^k = const, where P is the
 4578 # pressure, V is the volume, and k is the polytropic exponent.  The
 4579 # polytropic index is n = 1 / (k - 1).  As noted in the Wikipedia article
 4580 # https://en.wikipedia.org/wiki/Polytropic_process, some authors reverse
 4581 # the definitions of "exponent" and "index."  The functions below assume
 4582 # the following parameters:
 4583 
 4584 # temperature lapse rate, -dT/dz, in troposphere
 4585 
 4586 lapserate       6.5 K/km        # US Std Atm (1976)
 4587 
 4588 # air molecular weight, including constituent mol wt, given
 4589 # in Table 3, p. 3
 4590 
 4591 air_1976        78.084   %    28.0134 \
 4592               + 20.9476  %    31.9988 \
 4593               + 9340     ppm  39.948 \
 4594               +  314     ppm  44.00995 \
 4595               +   18.18  ppm  20.183 \
 4596               +    5.24  ppm   4.0026 \
 4597               +    2     ppm  16.04303 \
 4598               +    1.14  ppm  83.80 \
 4599               +    0.55  ppm   2.01594 \
 4600               +    0.087 ppm 131.30
 4601 
 4602 # universal gas constant
 4603 R_1976          8.31432e3 N m/(kmol K)
 4604 
 4605 # polytropic index n
 4606 polyndx_1976    air_1976 (kg/kmol) gravity/(R_1976 lapserate) - 1
 4607 
 4608 # If desired, redefine using current values for air mol wt and R
 4609 
 4610 polyndx         polyndx_1976
 4611 # polyndx       air (kg/kmol) gravity/(R lapserate) - 1
 4612 
 4613 # for comparison with various references
 4614 
 4615 polyexpnt       (polyndx + 1) / polyndx
 4616 
 4617 # The model assumes the following reference values:
 4618 # sea-level temperature and pressure
 4619 
 4620 stdatmT0        288.15 K
 4621 stdatmP0        atm
 4622 
 4623 # "effective radius" for relation of geometric to geopotential height,
 4624 # at a latitude at which g = 9.80665 m/s (approximately 45.543 deg); no
 4625 # relation to actual radius
 4626 
 4627 earthradUSAtm   6356766 m
 4628 
 4629 # Temperature vs. geopotential height h
 4630 # Assumes 15 degC at sea level
 4631 # Based on approx 45 deg latitude
 4632 # Lower limits of domain and upper limits of range are those of the
 4633 # tables in US Standard Atmosphere (NASA 1976)
 4634 
 4635 stdatmTH(h) units=[m;K] domain=[-5000,11e3] range=[217,321] \
 4636     stdatmT0+(-lapserate h) ; (stdatmT0+(-stdatmTH))/lapserate
 4637 
 4638 # Temperature vs. geometric height z; based on approx 45 deg latitude
 4639 stdatmT(z) units=[m;K] domain=[-5000,11e3] range=[217,321] \
 4640     stdatmTH(geop_ht(z)) ; ~geop_ht(~stdatmTH(stdatmT))
 4641 
 4642 # Pressure vs. geopotential height h
 4643 # Assumes 15 degC and 101325 Pa at sea level
 4644 # Based on approx 45 deg latitude
 4645 # Lower limits of domain and upper limits of range are those of the
 4646 # tables in US Standard Atmosphere (NASA 1976)
 4647 
 4648 stdatmPH(h) units=[m;Pa] domain=[-5000,11e3] range=[22877,177764] \
 4649     atm (1 - (lapserate/stdatmT0) h)^(polyndx + 1) ; \
 4650     (stdatmT0/lapserate) (1+(-(stdatmPH/stdatmP0)^(1/(polyndx + 1))))
 4651 
 4652 # Pressure vs. geometric height z; based on approx 45 deg latitude
 4653 stdatmP(z) units=[m;Pa] domain=[-5000,11e3] range=[22877,177764] \
 4654    stdatmPH(geop_ht(z)); ~geop_ht(~stdatmPH(stdatmP))
 4655 
 4656 # Geopotential height from geometric height
 4657 # Based on approx 45 deg latitude
 4658 # Lower limits of domain and range are somewhat arbitrary; they
 4659 # correspond to the limits in the US Std Atm tables
 4660 
 4661 geop_ht(z) units=[m;m] domain=[-5000,) range=[-5004,) \
 4662     (earthradUSAtm z) / (earthradUSAtm + z) ; \
 4663     (earthradUSAtm geop_ht) / (earthradUSAtm + (-geop_ht))
 4664 
 4665 # The standard value for the sea-level acceleration due to gravity is
 4666 # 9.80665 m/s^2, but the actual value varies with latitude (Harrison 1949)
 4667 # R_eff = 2 g_phi / denom
 4668 # g_phi = 978.0356e-2 (1+0.0052885 sin(lat)^2+(-0.0000059) sin(2 lat)^2)
 4669 #   or
 4670 # g_phi = 980.6160e-2 (1+(-0.0026373) cos(2 lat)+0.0000059 cos(2 lat)^2)
 4671 # denom = 3.085462e-6+2.27e-9 cos(2 lat)+(-2e-12) cos(4 lat) (minutes?)
 4672 # There is no inverse function; the standard value applies at a latitude
 4673 # of about 45.543 deg
 4674 
 4675 g_phi(lat) units=[deg;m/s2] domain=[0,90] noerror  \
 4676     980.6160e-2 (1+(-0.0026373) cos(2 lat)+0.0000059 cos(2 lat)^2) m/s2
 4677 
 4678 # effective Earth radius for relation of geometric height to
 4679 # geopotential height, as function of latitude (Harrison 1949)
 4680 
 4681 earthradius_eff(lat) units=[deg;m] domain=[0,90] noerror \
 4682     m 2 9.780356 (1+0.0052885 sin(lat)^2+(-0.0000059) sin(2 lat)^2) / \
 4683     (3.085462e-6 + 2.27e-9 cos(2 lat) + (-2e-12) cos(4 lat))
 4684 
 4685 # References
 4686 # Harrison, L.P. 1949.  Relation Between Geopotential and Geometric
 4687 #   Height.  In Smithsonian Meteorological Tables. List, Robert J., ed.
 4688 #   6th ed., 4th reprint, 1968.  Washington, DC: Smithsonian Institution.
 4689 # NASA.  US National Aeronautics and Space Administration. 1976.
 4690 #   US Standard Atmosphere 1976.  Washington, DC: US Government Printing Office.
 4691 
 4692 # Gauge pressure functions
 4693 #
 4694 # Gauge pressure is measured relative to atmospheric pressure.  In the English
 4695 # system, where pressure is often given in pounds per square inch, gauge
 4696 # pressure is often indicated by 'psig' to distinguish it from absolute
 4697 # pressure, often indicated by 'psia'.  At the standard atmospheric pressure
 4698 # of 14.696 psia, a gauge pressure of 0 psig is an absolute pressure of 14.696
 4699 # psia; an automobile tire inflated to 31 psig has an absolute pressure of
 4700 # 45.696 psia.
 4701 #
 4702 # With gaugepressure(), the units must be specified (e.g., gaugepressure(1.5
 4703 # bar)); with psig(), the units are taken as psi, so the example above of tire
 4704 # pressure could be given as psig(31).
 4705 #
 4706 # If the normal elevation is significantly different from sea level, change
 4707 # Patm appropriately, and adjust the lower domain limit on the gaugepressure
 4708 # definition.
 4709 
 4710 Patm    atm
 4711 
 4712 gaugepressure(x) units=[Pa;Pa] domain=[-101325,) range=[0,) \
 4713                 x + Patm ; gaugepressure+(-Patm)
 4714 
 4715 psig(x) units=[1;Pa] domain=[-14.6959487755135,) range=[0,) \
 4716     gaugepressure(x psi) ; ~gaugepressure(psig) / psi
 4717 
 4718 
 4719 # Pressure for underwater diving
 4720 
 4721 seawater             0.1 bar / meter
 4722 msw                  meter seawater
 4723 fsw                  foot seawater
 4724 
 4725 #
 4726 # Wire Gauge
 4727 #
 4728 # This area is a nightmare with huge charts of wire gauge diameters
 4729 # that usually have no clear origin.  There are at least 5 competing wire gauge
 4730 # systems to add to the confusion.  The use of wire gauge is related to the
 4731 # manufacturing method: a metal rod is heated and drawn through a hole.  The
 4732 # size change can't be too big.  To get smaller wires, the process is repeated
 4733 # with a series of smaller holes.  Generally larger gauges mean smaller wires.
 4734 # The gauges often have values such as "00" and "000" which are larger sizes
 4735 # than simply "0" gauge.  In the tables that appear below, these gauges must be
 4736 # specified as negative numbers (e.g. "00" is -1, "000" is -2, etc).
 4737 # Alternatively, you can use the following units:
 4738 #
 4739 
 4740 g00                      (-1)
 4741 g000                     (-2)
 4742 g0000                    (-3)
 4743 g00000                   (-4)
 4744 g000000                  (-5)
 4745 g0000000                 (-6)
 4746 
 4747 # American Wire Gauge (AWG) or Brown & Sharpe Gauge appears to be the most
 4748 # important gauge. ASTM B-258 specifies that this gauge is based on geometric
 4749 # interpolation between gauge 0000, which is 0.46 inches exactly, and gauge 36
 4750 # which is 0.005 inches exactly.  Therefore, the diameter in inches of a wire
 4751 # is given by the formula 1|200 92^((36-g)/39).  Note that 92^(1/39) is close
 4752 # to 2^(1/6), so diameter is approximately halved for every 6 gauges.  For the
 4753 # repeated zero values, use negative numbers in the formula.  The same document
 4754 # also specifies rounding rules which seem to be ignored by makers of tables.
 4755 # Gauges up to 44 are to be specified with up to 4 significant figures, but no
 4756 # closer than 0.0001 inch.  Gauges from 44 to 56 are to be rounded to the
 4757 # nearest 0.00001 inch.
 4758 #
 4759 # In addition to being used to measure wire thickness, this gauge is used to
 4760 # measure the thickness of sheets of aluminum, copper, and most metals other
 4761 # than steel, iron and zinc.
 4762 
 4763 wiregauge(g) units=[1;m] range=(0,) \
 4764              1|200 92^((36+(-g))/39) in; 36+(-39)ln(200 wiregauge/in)/ln(92)
 4765 awg()        wiregauge
 4766 
 4767 # Next we have the SWG, the Imperial or British Standard Wire Gauge.  This one
 4768 # is piecewise linear.  It was used for aluminum sheets.
 4769 
 4770 brwiregauge[in]  \
 4771        -6 0.5    \
 4772        -5 0.464  \
 4773        -3 0.4    \
 4774        -2 0.372  \
 4775         3 0.252  \
 4776         6 0.192  \
 4777        10 0.128  \
 4778        14 0.08   \
 4779        19 0.04   \
 4780        23 0.024  \
 4781        26 0.018  \
 4782        28 0.0148 \
 4783        30 0.0124 \
 4784        39 0.0052 \
 4785        49 0.0012 \
 4786        50 0.001
 4787 
 4788 # The following is from the Appendix to ASTM B 258
 4789 #
 4790 #    For example, in U.S. gage, the standard for sheet metal is based on the
 4791 #    weight of the metal, not on the thickness. 16-gage is listed as
 4792 #    approximately .0625 inch thick and 40 ounces per square foot (the original
 4793 #    standard was based on wrought iron at .2778 pounds per cubic inch; steel
 4794 #    has almost entirely superseded wrought iron for sheet use, at .2833 pounds
 4795 #    per cubic inch). Smaller numbers refer to greater thickness. There is no
 4796 #    formula for converting gage to thickness or weight.
 4797 #
 4798 # It's rather unclear from the passage above whether the plate gauge values are
 4799 # therefore wrong if steel is being used.  Reference [15] states that steel is
 4800 # in fact measured using this gauge (under the name Manufacturers' Standard
 4801 # Gauge) with a density of 501.84 lb/ft3 = 0.2904 lb/in3 used for steel.
 4802 # But this doesn't seem to be the correct density of steel (.2833 lb/in3 is
 4803 # closer).
 4804 #
 4805 # This gauge was established in 1893 for purposes of taxation.
 4806 
 4807 # Old plate gauge for iron
 4808 
 4809 plategauge[(oz/ft^2)/(480*lb/ft^3)] \
 4810       -5 300   \
 4811        1 180   \
 4812       14  50   \
 4813       16  40   \
 4814       17  36   \
 4815       20  24   \
 4816       26  12   \
 4817       31   7   \
 4818       36   4.5 \
 4819       38   4
 4820 
 4821 # Manufacturers Standard Gage
 4822 
 4823 stdgauge[(oz/ft^2)/(501.84*lb/ft^3)] \
 4824       -5 300   \
 4825        1 180   \
 4826       14  50   \
 4827       16  40   \
 4828       17  36   \
 4829       20  24   \
 4830       26  12   \
 4831       31   7   \
 4832       36   4.5 \
 4833       38   4
 4834 
 4835 # A special gauge is used for zinc sheet metal.  Notice that larger gauges
 4836 # indicate thicker sheets.
 4837 
 4838 zincgauge[in]    \
 4839         1 0.002  \
 4840        10 0.02   \
 4841        15 0.04   \
 4842        19 0.06   \
 4843        23 0.1    \
 4844        24 0.125  \
 4845        27 0.5    \
 4846        28 1
 4847 
 4848 #
 4849 # Imperial drill bit sizes are reported in inches or in a numerical or
 4850 # letter gauge.
 4851 #
 4852 
 4853 drillgauge[in] \
 4854        1  0.2280 \
 4855        2  0.2210 \
 4856        3  0.2130 \
 4857        4  0.2090 \
 4858        5  0.2055 \
 4859        6  0.2040 \
 4860        7  0.2010 \
 4861        8  0.1990 \
 4862        9  0.1960 \
 4863       10  0.1935 \
 4864       11  0.1910 \
 4865       12  0.1890 \
 4866       13  0.1850 \
 4867       14  0.1820 \
 4868       15  0.1800 \
 4869       16  0.1770 \
 4870       17  0.1730 \
 4871       18  0.1695 \
 4872       19  0.1660 \
 4873       20  0.1610 \
 4874       22  0.1570 \
 4875       23  0.1540 \
 4876       24  0.1520 \
 4877       25  0.1495 \
 4878       26  0.1470 \
 4879       27  0.1440 \
 4880       28  0.1405 \
 4881       29  0.1360 \
 4882       30  0.1285 \
 4883       31  0.1200 \
 4884       32  0.1160 \
 4885       33  0.1130 \
 4886       34  0.1110 \
 4887       35  0.1100 \
 4888       36  0.1065 \
 4889       38  0.1015 \
 4890       39  0.0995 \
 4891       40  0.0980 \
 4892       41  0.0960 \
 4893       42  0.0935 \
 4894       43  0.0890 \
 4895       44  0.0860 \
 4896       45  0.0820 \
 4897       46  0.0810 \
 4898       48  0.0760 \
 4899       51  0.0670 \
 4900       52  0.0635 \
 4901       53  0.0595 \
 4902       54  0.0550 \
 4903       55  0.0520 \
 4904       56  0.0465 \
 4905       57  0.0430 \
 4906       65  0.0350 \
 4907       66  0.0330 \
 4908       68  0.0310 \
 4909       69  0.0292 \
 4910       70  0.0280 \
 4911       71  0.0260 \
 4912       73  0.0240 \
 4913       74  0.0225 \
 4914       75  0.0210 \
 4915       76  0.0200 \
 4916       78  0.0160 \
 4917       79  0.0145 \
 4918       80  0.0135 \
 4919       88  0.0095 \
 4920       104 0.0031 
 4921 
 4922 drillA    0.234 in
 4923 drillB    0.238 in
 4924 drillC    0.242 in
 4925 drillD    0.246 in
 4926 drillE    0.250 in
 4927 drillF    0.257 in
 4928 drillG    0.261 in
 4929 drillH    0.266 in
 4930 drillI    0.272 in
 4931 drillJ    0.277 in
 4932 drillK    0.281 in
 4933 drillL    0.290 in
 4934 drillM    0.295 in
 4935 drillN    0.302 in
 4936 drillO    0.316 in
 4937 drillP    0.323 in
 4938 drillQ    0.332 in
 4939 drillR    0.339 in
 4940 drillS    0.348 in
 4941 drillT    0.358 in
 4942 drillU    0.368 in
 4943 drillV    0.377 in
 4944 drillW    0.386 in
 4945 drillX    0.397 in
 4946 drillY    0.404 in
 4947 drillZ    0.413 in
 4948 
 4949 #
 4950 # Screw sizes
 4951 #
 4952 # In the USA, screw diameters for both wood screws and machine screws
 4953 # are reported using a gauge number.  Metric machine screws are
 4954 # reported as Mxx where xx is the diameter in mm.
 4955 #
 4956 
 4957 screwgauge(g) units=[1;m] range=[0,) \
 4958               (.06 + .013 g) in ; (screwgauge/in + (-.06)) / .013
 4959 
 4960 #
 4961 # Abrasive grit size
 4962 #
 4963 # Standards governing abrasive grit sizes are complicated, specifying
 4964 # fractions of particles that are passed or retained by different mesh
 4965 # sizes.  As a result, it is not possible to make precise comparisons
 4966 # of different grit standards.  The tables below allow the
 4967 # determination of rough equivlants by using median particle size.
 4968 #
 4969 # Standards in the USA are determined by the Unified Abrasives
 4970 # Manufacturers' Association (UAMA), which resulted from the merger of
 4971 # several previous organizations.  One of the old organizations was
 4972 # CAMI (Coated Abrasives Manufacturers' Institute).
 4973 #
 4974 # UAMA has a web page with plots showing abrasive particle ranges for
 4975 # various different grits and comparisons between standards.
 4976 #
 4977 # http://www.uama.org/Abrasives101/101Standards.html
 4978 #
 4979 # Abrasives are grouped into "bonded" abrasives for use with grinding
 4980 # wheels and "coated" abrasives for sandpapers and abrasive films.
 4981 # The industry uses different grit standards for these two
 4982 # categories.
 4983 #
 4984 # Another division is between "macrogrits", grits below 240 and
 4985 # "microgrits", which are above 240.  Standards differ, as do methods
 4986 # for determining particle size.  In the USA, ANSI B74.12 is the
 4987 # standard governing macrogrits.  ANSI B74.10 covers bonded microgrit
 4988 # abrasives, and ANSI B74.18 covers coated microgrit abrasives.  It
 4989 # appears that the coated standard is identical to the bonded standard
 4990 # for grits up through 600 but then diverges significantly.
 4991 #
 4992 # European grit sizes are determined by the Federation of European
 4993 # Producers of Abrasives.  http://www.fepa-abrasives.org
 4994 #
 4995 # They give two standards, the "F" grit for bonded abrasives and the
 4996 # "P" grit for coated abrasives.  This data is taken directly from
 4997 # their web page.
 4998 
 4999 # FEPA P grit for coated abrasives is commonly seen on sandpaper in
 5000 # the USA where the paper will be marked P600, for example.  FEPA P
 5001 # grits are said to be more tightly constrained than comparable ANSI
 5002 # grits so that the particles are more uniform in size and hence give
 5003 # a better finish.
 5004 
 5005 grit_P[micron] \
 5006         12 1815 \
 5007         16 1324 \
 5008         20 1000 \
 5009         24 764 \
 5010         30 642 \
 5011         36 538 \
 5012         40 425 \
 5013         50 336 \
 5014         60 269 \
 5015         80 201 \
 5016         100 162 \
 5017         120 125 \
 5018         150 100 \
 5019         180 82 \
 5020         220 68 \
 5021         240 58.5 \
 5022         280 52.2 \
 5023         320 46.2 \
 5024         360 40.5 \
 5025         400 35 \
 5026         500 30.2 \
 5027         600 25.8 \
 5028         800 21.8 \
 5029         1000 18.3 \
 5030         1200 15.3 \
 5031         1500 12.6 \
 5032         2000 10.3 \
 5033         2500 8.4
 5034 
 5035 # The F grit is the European standard for bonded abrasives such as
 5036 # grinding wheels
 5037 
 5038 grit_F[micron] \
 5039         4 4890 \
 5040         5 4125 \
 5041         6 3460 \
 5042         7 2900 \
 5043         8 2460 \
 5044         10 2085 \
 5045         12 1765 \
 5046         14 1470 \
 5047         16 1230 \
 5048         20 1040 \
 5049         22 885 \
 5050         24 745 \
 5051         30 625 \
 5052         36 525 \
 5053         40 438 \
 5054         46 370 \
 5055         54 310 \
 5056         60 260 \
 5057         70 218 \
 5058         80 185 \
 5059         90 154 \
 5060         100 129 \
 5061         120 109 \
 5062         150 82 \
 5063         180 69 \
 5064         220 58 \
 5065         230 53 \
 5066         240 44.5 \
 5067         280 36.5 \
 5068         320 29.2 \
 5069         360 22.8 \
 5070         400 17.3 \
 5071         500 12.8 \
 5072         600 9.3 \
 5073         800 6.5 \
 5074         1000 4.5 \
 5075         1200 3 \
 5076         1500 2.0 \
 5077         2000 1.2
 5078 
 5079 # According to the UAMA web page, the ANSI bonded and ANSI coated standards
 5080 # are identical to FEPA F in the macrogrit range (under 240 grit), so these
 5081 # values are taken from the FEPA F table.  The values for 240 and above are
 5082 # from the UAMA web site and represent the average of the "d50" range
 5083 # endpoints listed there.
 5084 
 5085 ansibonded[micron] \
 5086     4 4890 \
 5087     5 4125 \
 5088     6 3460 \
 5089     7 2900 \
 5090     8 2460 \
 5091     10 2085 \
 5092     12 1765 \
 5093     14 1470 \
 5094     16 1230 \
 5095     20 1040 \
 5096     22 885 \
 5097     24 745 \
 5098     30 625 \
 5099     36 525 \
 5100     40 438 \
 5101     46 370 \
 5102     54 310 \
 5103     60 260 \
 5104     70 218 \
 5105     80 185 \
 5106     90 154 \
 5107     100 129 \
 5108     120 109 \
 5109     150 82 \
 5110     180 69 \
 5111     220 58 \
 5112     240 50 \
 5113     280 39.5 \
 5114     320 29.5 \
 5115     360 23 \
 5116     400 18.25 \
 5117     500 13.9 \
 5118     600 10.55 \
 5119     800 7.65 \
 5120     1000 5.8 \
 5121     1200 3.8
 5122 
 5123 grit_ansibonded() ansibonded
 5124 
 5125 # Like the bonded grit, the coated macrogrits below 240 are taken from the
 5126 # FEPA F table.  Data above this is from the UAMA site.  Note that the coated
 5127 # and bonded standards are evidently the same from 240 up to 600 grit, but
 5128 # starting at 800 grit, the coated standard diverges.  The data from UAMA show
 5129 # that 800 grit coated has an average size slightly larger than the average
 5130 # size of 600 grit coated/bonded.  However, the 800 grit has a significantly
 5131 # smaller particle size variation.
 5132 #
 5133 # Because of this non-monotonicity from 600 grit to 800 grit this definition
 5134 # produces a warning about the lack of a unique inverse.
 5135 
 5136 ansicoated[micron] noerror \
 5137     4 4890 \
 5138     5 4125 \
 5139     6 3460 \
 5140     7 2900 \
 5141     8 2460 \
 5142     10 2085 \
 5143     12 1765 \
 5144     14 1470 \
 5145     16 1230 \
 5146     20 1040 \
 5147     22 885 \
 5148     24 745 \
 5149     30 625 \
 5150     36 525 \
 5151     40 438 \
 5152     46 370 \
 5153     54 310 \
 5154     60 260 \
 5155     70 218 \
 5156     80 185 \
 5157     90 154 \
 5158     100 129 \
 5159     120 109 \
 5160     150 82 \
 5161     180 69 \
 5162     220 58 \
 5163     240 50 \
 5164     280 39.5 \
 5165     320 29.5 \
 5166     360 23 \
 5167     400 18.25 \
 5168     500 13.9 \
 5169     600 10.55 \
 5170     800 11.5 \
 5171     1000 9.5 \
 5172     2000 7.2 \
 5173     2500 5.5 \
 5174     3000 4 \
 5175     4000 3 \
 5176     6000 2 \
 5177     8000 1.2
 5178 
 5179 grit_ansicoated()  ansicoated
 5180 
 5181 
 5182 #
 5183 # Is this correct?  This is the JIS Japanese standard used on waterstones
 5184 #
 5185 jisgrit[micron] \
 5186      150 75 \
 5187      180 63 \
 5188      220 53 \
 5189      280 48 \
 5190      320 40 \
 5191      360 35 \
 5192      400 30 \
 5193      600 20 \
 5194      700 17 \
 5195      800 14 \
 5196      1000 11.5 \
 5197      1200 9.5 \
 5198      1500 8 \
 5199      2000 6.7 \
 5200      2500 5.5 \
 5201      3000 4 \
 5202      4000 3 \
 5203      6000 2 \
 5204      8000 1.2
 5205 
 5206 # The "Finishing Scale" marked with an A (e.g. A75).  This information
 5207 # is from the web page of the sand paper manufacturer Klingspor
 5208 # http://www.klingspor.com/gritgradingsystems.htm
 5209 #
 5210 # I have no information about what this scale is used for.
 5211 
 5212 grit_A[micron]\
 5213      16 15.3 \
 5214      25 21.8 \
 5215      30 23.6 \
 5216      35 25.75 \
 5217      45 35 \
 5218      60 46.2 \
 5219      65 53.5 \
 5220      75 58.5 \
 5221      90 65 \
 5222      110 78 \
 5223      130 93 \
 5224      160 127 \
 5225      200 156
 5226 #
 5227 # Grits for DMT brand diamond sharpening stones from
 5228 # http://dmtsharp.com/products/colorcode.htm
 5229 #
 5230 
 5231 dmtxxcoarse  120 micron    # 120 mesh
 5232 dmtsilver    dmtxxcoarse
 5233 dmtxx        dmtxxcoarse
 5234 dmtxcoarse   60 micron     # 220 mesh
 5235 dmtx         dmtxcoarse
 5236 dmtblack     dmtxcoarse
 5237 dmtcoarse    45 micron     # 325 mesh
 5238 dmtc         dmtcoarse
 5239 dmtblue      dmtcoarse
 5240 dmtfine      25 micron     # 600 mesh
 5241 dmtred       dmtfine
 5242 dmtf         dmtfine
 5243 dmtefine     9 micron      # 1200 mesh
 5244 dmte         dmtefine
 5245 dmtgreen     dmtefine
 5246 dmtceramic   7 micron      # 2200 mesh
 5247 dmtcer       dmtceramic
 5248 dmtwhite     dmtceramic
 5249 dmteefine    3 micron      # 8000 mesh
 5250 dmttan       dmteefine
 5251 dmtee        dmteefine
 5252 
 5253 #
 5254 # The following values come from a page in the Norton Stones catalog,
 5255 # available at their web page, http://www.nortonstones.com.
 5256 #
 5257 
 5258 hardtranslucentarkansas  6 micron     # Natural novaculite (silicon quartz)
 5259 softarkansas             22 micron    #   stones
 5260 
 5261 extrafineindia           22 micron    # India stones are Norton's manufactured
 5262 fineindia                35 micron    #   aluminum oxide product
 5263 mediumindia              53.5 micron
 5264 coarseindia              97 micron
 5265 
 5266 finecrystolon            45 micron    # Crystolon stones are Norton's
 5267 mediumcrystalon          78 micron    #   manufactured silicon carbide product
 5268 coarsecrystalon          127 micron
 5269 
 5270 # The following are not from the Norton catalog
 5271 hardblackarkansas        6 micron
 5272 hardwhitearkansas        11 micron
 5273 washita                  35 micron
 5274 
 5275 #
 5276 # Mesh systems for measuring particle sizes by sifting through a wire
 5277 # mesh or sieve
 5278 #
 5279 
 5280 # The Tyler system and US Sieve system are based on four steps for
 5281 # each factor of 2 change in the size, so each size is 2^1|4 different
 5282 # from the adjacent sizes.  Unfortunately, the mesh numbers are
 5283 # arbitrary, so the sizes cannot be expressed with a functional form.
 5284 # Various references round the values differently.  The mesh numbers
 5285 # are supposed to correspond to the number of holes per inch, but this
 5286 # correspondence is only approximate because it doesn't include the
 5287 # wire size of the mesh.
 5288 
 5289 # The Tyler Mesh system was apparently introduced by the WS Tyler
 5290 # company, but it appears that they no longer use it.  They follow the
 5291 # ASTM E11 standard.
 5292 
 5293 meshtyler[micron] \
 5294           2.5 8000 \
 5295           3   6727 \
 5296           3.5 5657 \
 5297           4   4757 \
 5298           5   4000 \
 5299           6   3364 \
 5300           7   2828 \
 5301           8   2378 \
 5302           9   2000 \
 5303          10   1682 \
 5304          12   1414 \
 5305          14   1189 \
 5306          16   1000 \
 5307          20    841 \
 5308          24    707 \
 5309          28    595 \
 5310          32    500 \
 5311          35    420 \
 5312          42    354 \
 5313          48    297 \
 5314          60    250 \
 5315          65    210 \
 5316          80    177 \
 5317         100    149 \
 5318         115    125 \
 5319         150    105 \
 5320         170     88 \
 5321         200     74 \
 5322         250     63 \
 5323         270     53 \
 5324         325     44 \
 5325         400     37 
 5326 
 5327 # US Sieve size, ASTM E11
 5328 #
 5329 # The WS Tyler company prints the list from ASTM E11 in their catalog, 
 5330 # http://wstyler.com/wp-content/uploads/2015/11/Product-Catalog-2.pdf
 5331 
 5332 sieve[micron] \
 5333           3.5   5600 \
 5334           4     4750 \
 5335           5     4000 \
 5336           6     3350 \
 5337           7     2800 \
 5338           8     2360 \
 5339          10     2000 \
 5340          12     1700 \
 5341          14     1400 \
 5342          16     1180 \
 5343          18     1000 \
 5344          20      850 \
 5345          25      710 \
 5346          30      600 \
 5347          35      500 \
 5348          40      425 \
 5349          45      355 \
 5350          50      300 \
 5351          60      250 \
 5352          70      212 \
 5353          80      180 \
 5354         100      150 \
 5355         120      125 \
 5356         140      106 \
 5357         170       90 \
 5358         200       75 \
 5359         230       63 \
 5360         270       53 \
 5361         325       45 \
 5362         400       38 \
 5363         450       32 \
 5364         500       25 \
 5365         625       20   # These last two values are not in the standard series
 5366                        # but were included in the ASTM standard because they
 5367 meshUS()  sieve        # were in common usage.                               
 5368 
 5369 # British Mesh size, BS 410: 1986
 5370 # This system appears to correspond to the Tyler and US system, but
 5371 # with different mesh numbers.
 5372 #
 5373 # http://www.panadyne.com/technical/panadyne_international_sieve_chart.pdf
 5374 # 
 5375 
 5376 meshbritish[micron] \
 5377           3    5657 \
 5378           3.5  4757 \
 5379           4    4000 \
 5380           5    3364 \
 5381           6    2828 \
 5382           7    2378 \
 5383           8    2000 \
 5384          10    1682 \
 5385          12    1414 \
 5386          14    1189 \
 5387          16    1000 \
 5388          18     841 \
 5389          22     707 \
 5390          25     595 \
 5391          30     500 \
 5392          36     420 \
 5393          44     354 \
 5394          52     297 \
 5395          60     250 \
 5396          72     210 \
 5397          85     177 \
 5398         100     149 \
 5399         120     125 \
 5400         150     105 \
 5401         170      88 \
 5402         200      74 \
 5403         240      63 \
 5404         300      53 \
 5405         350      44 \
 5406         400      37  
 5407 
 5408 # French system, AFNOR NFX11-501: 1970
 5409 # The system appears to be based on size doubling every 3 mesh
 5410 # numbers, though the values have been agressively rounded.
 5411 # It's not clear if the unrounded values would be considered
 5412 # incorrect, so this is given as a table rather than a function.
 5413 # Functional form:
 5414 #    meshtamis(mesh) units=[1;m] 5000 2^(1|3 (mesh-38)) micron
 5415 #
 5416 # http://www.panadyne.com/technical/panadyne_international_sieve_chart.pdf
 5417 
 5418 meshtamis[micron] \
 5419         17   40 \
 5420         18   50 \
 5421         19   63 \
 5422         20   80 \
 5423         21  100 \
 5424         22  125 \
 5425         23  160 \
 5426         24  200 \
 5427         25  250 \
 5428         26  315 \
 5429         27  400 \
 5430         28  500 \
 5431         29  630 \
 5432         30  800 \
 5433         31 1000 \
 5434         32 1250 \
 5435         33 1600 \
 5436         34 2000 \
 5437         35 2500 \
 5438         36 3150 \
 5439         37 4000 \
 5440         38 5000 
 5441 
 5442 #
 5443 # Ring size. All ring sizes are given as the circumference of the ring.
 5444 #
 5445 
 5446 # USA ring sizes.  Several slightly different definitions seem to be in
 5447 # circulation.  According to [15], the interior diameter of size n ring in
 5448 # inches is 0.32 n + 0.458 for n ranging from 3 to 13.5 by steps of 0.5.  The
 5449 # size 2 ring is inconsistently 0.538in and no 2.5 size is listed.
 5450 #
 5451 # However, other sources list 0.455 + 0.0326 n and 0.4525 + 0.0324 n as the
 5452 # diameter and list no special case for size 2.  (Or alternatively they are
 5453 # 1.43 + .102 n and 1.4216+.1018 n for measuring circumference in inches.)  One
 5454 # reference claimed that the original system was that each size was 1|10 inch
 5455 # circumference, but that source doesn't have an explanation for the modern
 5456 # system which is somewhat different.
 5457 
 5458 ringsize(n) units=[1;in] domain=[2,) range=[1.6252,) \
 5459             (1.4216+.1018 n) in ; (ringsize/in + (-1.4216))/.1018
 5460 
 5461 # Old practice in the UK measured rings using the "Wheatsheaf gauge" with sizes
 5462 # specified alphabetically and based on the ring inside diameter in steps of
 5463 # 1|64 inch.  This system was replaced in 1987 by British Standard 6820 which
 5464 # specifies sizes based on circumference.  Each size is 1.25 mm different from
 5465 # the preceding size.  The baseline is size C which is 40 mm circumference.
 5466 # The new sizes are close to the old ones.  Sometimes it's necessary to go
 5467 # beyond size Z to Z+1, Z+2, etc.
 5468 
 5469 sizeAring               37.50 mm
 5470 sizeBring               38.75 mm
 5471 sizeCring               40.00 mm
 5472 sizeDring               41.25 mm
 5473 sizeEring               42.50 mm
 5474 sizeFring               43.75 mm
 5475 sizeGring               45.00 mm
 5476 sizeHring               46.25 mm
 5477 sizeIring               47.50 mm
 5478 sizeJring               48.75 mm
 5479 sizeKring               50.00 mm
 5480 sizeLring               51.25 mm
 5481 sizeMring               52.50 mm
 5482 sizeNring               53.75 mm
 5483 sizeOring               55.00 mm
 5484 sizePring               56.25 mm
 5485 sizeQring               57.50 mm
 5486 sizeRring               58.75 mm
 5487 sizeSring               60.00 mm
 5488 sizeTring               61.25 mm
 5489 sizeUring               62.50 mm
 5490 sizeVring               63.75 mm
 5491 sizeWring               65.00 mm
 5492 sizeXring               66.25 mm
 5493 sizeYring               67.50 mm
 5494 sizeZring               68.75 mm
 5495 
 5496 # Japanese sizes start with size 1 at a 13mm inside diameter and each size is
 5497 # 1|3 mm larger in diameter than the previous one.  They are multiplied by pi
 5498 # to give circumference.
 5499 
 5500 jpringsize(n)  units=[1;mm] domain=[1,) range=[0.040840704,) \
 5501                (38|3 + n/3) pi mm ; 3 jpringsize/ pi mm + (-38)
 5502 
 5503 # The European ring sizes are the length of the circumference in mm minus 40.
 5504 
 5505 euringsize(n)  units=[1;mm] (n+40) mm ; euringsize/mm + (-40)
 5506 
 5507 #
 5508 # Abbreviations
 5509 #
 5510 
 5511 mph                     mile/hr
 5512 mpg                     mile/gal
 5513 kph                     km/hr
 5514 fL                      footlambert
 5515 fpm                     ft/min
 5516 fps                     ft/s
 5517 rpm                     rev/min
 5518 rps                     rev/sec
 5519 mi                      mile
 5520 smi                     mile
 5521 nmi                     nauticalmile
 5522 mbh                     1e3 btu/hour
 5523 mcm                     1e3 circularmil
 5524 ipy                     inch/year    # used for corrosion rates
 5525 ccf                     100 ft^3     # used for selling water [18]
 5526 Mcf                     1000 ft^3    # not million cubic feet [18]
 5527 kp                      kilopond
 5528 kpm                     kp meter
 5529 Wh                      W hour
 5530 hph                     hp hour
 5531 plf                     lb / foot    # pounds per linear foot
 5532 
 5533 #
 5534 # Compatibility units with unix version
 5535 #
 5536 
 5537 pa                      Pa
 5538 ev                      eV
 5539 hg                      Hg
 5540 oe                      Oe
 5541 mh                      mH
 5542 rd                      rod
 5543 pf                      pF
 5544 gr                      grain
 5545 nt                      N
 5546 hz                      Hz
 5547 hd                      hogshead
 5548 dry                     drygallon/gallon
 5549 nmile                   nauticalmile
 5550 beV                     GeV
 5551 bev                     beV
 5552 coul                    C
 5553 
 5554 #
 5555 # Radioactivity units
 5556 #
 5557 
 5558 becquerel               /s           # Activity of radioactive source
 5559 Bq                      becquerel    #
 5560 curie                   3.7e10 Bq    # Defined in 1910 as the radioactivity
 5561 Ci                      curie        # emitted by the amount of radon that is
 5562                                      # in equilibrium with 1 gram of radium.
 5563 rutherford              1e6 Bq       #
 5564 
 5565 RADIATION_DOSE          gray
 5566 gray                    J/kg         # Absorbed dose of radiation
 5567 Gy                      gray         #
 5568 rad                     1e-2 Gy      # From Radiation Absorbed Dose
 5569 rep                     8.38 mGy     # Roentgen Equivalent Physical, the amount
 5570                                      #   of radiation which , absorbed in the
 5571                                      #   body, would liberate the same amount
 5572                                      #   of energy as 1 roentgen of X rays
 5573                                      #   would, or 97 ergs.
 5574 
 5575 sievert                 J/kg         # Dose equivalent:  dosage that has the
 5576 Sv                      sievert      #   same effect on human tissues as 200
 5577 rem                     1e-2 Sv      #   keV X-rays.  Different types of
 5578                                      #   radiation are weighted by the
 5579                                      #   Relative Biological Effectiveness
 5580                                      #   (RBE).
 5581                                      #
 5582                                      #      Radiation type       RBE
 5583                                      #       X-ray, gamma ray     1
 5584                                      #       beta rays, > 1 MeV   1
 5585                                      #       beta rays, < 1 MeV  1.08
 5586                                      #       neutrons, < 1 MeV   4-5
 5587                                      #       neutrons, 1-10 MeV   10
 5588                                      #       protons, 1 MeV      8.5
 5589                                      #       protons, .1 MeV      10
 5590                                      #       alpha, 5 MeV         15
 5591                                      #       alpha, 1 MeV         20
 5592                                      #
 5593                                      #   The energies are the kinetic energy
 5594                                      #   of the particles.  Slower particles
 5595                                      #   interact more, so they are more
 5596                                      #   effective ionizers, and hence have
 5597                                      #   higher RBE values.
 5598                                      #
 5599                                      # rem stands for Roentgen Equivalent
 5600                                      # Mammal
 5601 banana_dose           0.1e-6 sievert # Informal measure of the dose due to 
 5602                                      #   eating one average sized banana
 5603 roentgen              2.58e-4 C / kg # Ionizing radiation that produces
 5604                                      #   1 statcoulomb of charge in 1 cc of
 5605                                      #   dry air at stp.
 5606 rontgen                 roentgen     # Sometimes it appears spelled this way
 5607 sievertunit             8.38 rontgen # Unit of gamma ray dose delivered in one
 5608                                      #   hour at a distance of 1 cm from a
 5609                                      #   point source of 1 mg of radium
 5610                                      #   enclosed in platinum .5 mm thick.
 5611 
 5612 eman                    1e-7 Ci/m^3  # radioactive concentration
 5613 mache                   3.7e-7 Ci/m^3
 5614 
 5615 #
 5616 # Atomic weights.  The atomic weight of an element is the ratio of the mass of
 5617 # a mole of the element to 1|12 of a mole of Carbon 12.  The Standard Atomic
 5618 # Weights apply to the elements as they occur naturally on earth.  Elements
 5619 # which do not occur naturally or which occur with wide isotopic variability do
 5620 # not have Standard Atomic Weights.  For these elements, the atomic weight is
 5621 # based on the longest lived isotope, as marked in the comments.  In some
 5622 # cases, the comment for these entries also gives a number which is an atomic
 5623 # weight for a different isotope that may be of more interest than the longest
 5624 # lived isotope.
 5625 #
 5626 
 5627 actinium                227.0278
 5628 aluminum                26.981539
 5629 americium               243.0614     # Longest lived. 241.06
 5630 antimony                121.760
 5631 argon                   39.948
 5632 arsenic                 74.92159
 5633 astatine                209.9871     # Longest lived
 5634 barium                  137.327
 5635 berkelium               247.0703     # Longest lived. 249.08
 5636 beryllium               9.012182
 5637 bismuth                 208.98037
 5638 boron                   10.811
 5639 bromine                 79.904
 5640 cadmium                 112.411
 5641 calcium                 40.078
 5642 californium             251.0796     # Longest lived.  252.08
 5643 carbon                  12.011
 5644 cerium                  140.115
 5645 cesium                  132.90543
 5646 chlorine                35.4527
 5647 chromium                51.9961
 5648 cobalt                  58.93320
 5649 copper                  63.546
 5650 curium                  247.0703
 5651 deuterium               2.0141017778
 5652 dysprosium              162.50
 5653 einsteinium             252.083      # Longest lived
 5654 erbium                  167.26
 5655 europium                151.965
 5656 fermium                 257.0951     # Longest lived
 5657 fluorine                18.9984032
 5658 francium                223.0197     # Longest lived
 5659 gadolinium              157.25
 5660 gallium                 69.723
 5661 germanium               72.61
 5662 gold                    196.96654
 5663 hafnium                 178.49
 5664 helium                  4.002602
 5665 holmium                 164.93032
 5666 hydrogen                1.00794
 5667 indium                  114.818
 5668 iodine                  126.90447
 5669 iridium                 192.217
 5670 iron                    55.845
 5671 krypton                 83.80
 5672 lanthanum               138.9055
 5673 lawrencium              262.11       # Longest lived
 5674 lead                    207.2
 5675 lithium                 6.941
 5676 lutetium                174.967
 5677 magnesium               24.3050
 5678 manganese               54.93805
 5679 mendelevium             258.10       # Longest lived
 5680 mercury                 200.59
 5681 molybdenum              95.94
 5682 neodymium               144.24
 5683 neon                    20.1797
 5684 neptunium               237.0482
 5685 nickel                  58.6934
 5686 niobium                 92.90638
 5687 nitrogen                14.00674
 5688 nobelium                259.1009     # Longest lived
 5689 osmium                  190.23
 5690 oxygen                  15.9994
 5691 palladium               106.42
 5692 phosphorus              30.973762
 5693 platinum                195.08
 5694 plutonium               244.0642     # Longest lived.  239.05
 5695 polonium                208.9824     # Longest lived.  209.98
 5696 potassium               39.0983
 5697 praseodymium            140.90765
 5698 promethium              144.9127     # Longest lived.  146.92
 5699 protactinium            231.03588
 5700 radium                  226.0254
 5701 radon                   222.0176     # Longest lived
 5702 rhenium                 186.207
 5703 rhodium                 102.90550
 5704 rubidium                85.4678
 5705 ruthenium               101.07
 5706 samarium                150.36
 5707 scandium                44.955910
 5708 selenium                78.96
 5709 silicon                 28.0855
 5710 silver                  107.8682
 5711 sodium                  22.989768
 5712 strontium               87.62
 5713 sulfur                  32.066
 5714 tantalum                180.9479
 5715 technetium              97.9072      # Longest lived.  98.906
 5716 tellurium               127.60
 5717 terbium                 158.92534
 5718 thallium                204.3833
 5719 thorium                 232.0381
 5720 thullium                168.93421
 5721 tin                     118.710
 5722 titanium                47.867
 5723 tungsten                183.84
 5724 uranium                 238.0289
 5725 vanadium                50.9415
 5726 xenon                   131.29
 5727 ytterbium               173.04
 5728 yttrium                 88.90585
 5729 zinc                    65.39
 5730 zirconium               91.224
 5731 
 5732 # Average molecular weight of air
 5733 #
 5734 # The atmospheric composition listed is from NASA Earth Fact Sheet (accessed
 5735 # 28 August 2015)
 5736 # http://nssdc.gsfc.nasa.gov/planetary/factsheet/earthfact.html
 5737 # Numbers do not add up to exactly 100% due to roundoff and uncertainty Water
 5738 # is highly variable, typically makes up about 1%
 5739 
 5740 air            78.08% nitrogen 2 \
 5741               + 20.95% oxygen 2 \
 5742               + 9340 ppm argon \
 5743               +  400 ppm (carbon + oxygen 2) \
 5744               +   18.18 ppm neon \
 5745               +    5.24 ppm helium \
 5746               +    1.7  ppm (carbon + 4 hydrogen) \
 5747               +    1.14 ppm krypton \
 5748               +    0.55 ppm hydrogen 2
 5749 #
 5750 # population units
 5751 #
 5752 
 5753 people                  1
 5754 person                  people
 5755 death                   people
 5756 capita                  people
 5757 percapita               per capita
 5758 
 5759 # TGM dozen based unit system listed on the "dozenal" forum
 5760 # http://www.dozenalsociety.org.uk/apps/tgm.htm.  These units are
 5761 # proposed as an allegedly more rational alternative to the SI system.
 5762 
 5763 Tim                     12^-4 hour         # Time 
 5764 Grafut                  gravity Tim^2      # Length based on gravity
 5765 Surf                    Grafut^2           # area
 5766 Volm                    Grafut^3           # volume
 5767 Vlos                    Grafut/Tim         # speed
 5768 Denz                    Maz/Volm           # density
 5769 Mag                     Maz gravity        # force
 5770 Maz                     Volm kg / oldliter # mass based on water
 5771 
 5772 Tm                      Tim                # Abbreviations
 5773 Gf                      Grafut
 5774 Sf                      Surf
 5775 Vm                      Volm
 5776 Vl                      Vlos
 5777 Mz                      Maz
 5778 Dz                      Denz
 5779 
 5780 # Dozen based unit prefixes
 5781 
 5782 Zena-                   12
 5783 Duna-                   12^2
 5784 Trina-                  12^3
 5785 Quedra-                 12^4
 5786 Quena-                  12^5
 5787 Hesa-                   12^6
 5788 Seva-                   12^7
 5789 Aka-                    12^8
 5790 Neena-                  12^9
 5791 Dexa-                   12^10
 5792 Lefa-                   12^11
 5793 Zennila-                12^12
 5794 
 5795 Zeni-                   12^-1
 5796 Duni-                   12^-2
 5797 Trini-                  12^-3
 5798 Quedri-                 12^-4
 5799 Queni-                  12^-5
 5800 Hesi-                   12^-6
 5801 Sevi-                   12^-7
 5802 Aki-                    12^-8
 5803 Neeni-                  12^-9
 5804 Dexi-                   12^-10
 5805 Lefi-                   12^-11
 5806 Zennili-                12^-12
 5807 
 5808 #
 5809 # Traditional Japanese units (shakkanhou)
 5810 #
 5811 # The traditional system of weights and measures is called shakkanhou from the
 5812 # shaku and the ken.  Japan accepted SI units in 1891 and legalized conversions
 5813 # to the traditional system.  In 1909 the inch-pound system was also legalized,
 5814 # so Japan had three legally approved systems.  A change to the metric system
 5815 # started in 1921 but there was a lot of resistance.  The Measurement Law of
 5816 # October 1999 prohibits sales in anything but SI units.  However, the old
 5817 # units still live on in construction and as the basis for paper sizes of books
 5818 # and tools used for handicrafts.
 5819 #
 5820 # Note that units below use the Hepburn romanization system.  Some other
 5821 # systems would render "mou", "jou", and "chou" as "mo", "jo" and "cho".
 5822 #
 5823 #
 5824 # http://hiramatu-hifuka.com/onyak/onyindx.html
 5825 
 5826 # Japanese Proportions.  These are still in everyday use.  They also
 5827 # get used as units to represent the proportion of the standard unit.
 5828 
 5829 wari_proportion      1|10
 5830 wari                 wari_proportion
 5831 bu_proportion        1|100    # The character bu can also be read fun or bun
 5832                               # but usually "bu" is used for units.
 5833 rin_proportion       1|1000
 5834 mou_proportion       1|10000
 5835 
 5836 
 5837 # Japanese Length Measures
 5838 #
 5839 # The length system is called kanejaku or
 5840 # square and originated in China.  It was
 5841 # adopted as Japan's official measure in 701
 5842 # by the Taiho Code.  This system is still in
 5843 # common use in architecture and clothing.
 5844 
 5845 shaku              1|3.3 m
 5846 mou                1|10000 shaku
 5847 rin                1|1000 shaku
 5848 bu_distance        1|100 shaku
 5849 sun                1|10 shaku
 5850 jou_distance       10 shaku
 5851 jou                jou_distance
 5852 
 5853 kanejakusun        sun      # Alias to emphasize architectural name
 5854 kanejaku           shaku
 5855 kanejakujou        jou
 5856 
 5857 # http://en.wikipedia.org/wiki/Taiwanese_units_of_measurement
 5858 taichi             shaku   # http://zh.wikipedia.org/wiki/台尺
 5859 taicun             sun     # http://zh.wikipedia.org/wiki/台制
 5860 !utf8
 5861 台尺               taichi  # via Hanyu Pinyin romanizations
 5862 台寸               taicun
 5863 !endutf8
 5864 
 5865 # In context of clothing, shaku is different from architecture
 5866 # http://www.scinet.co.jp/sci/sanwa/kakizaki-essay54.html
 5867 
 5868 kujirajaku         10|8 shaku
 5869 kujirajakusun      1|10 kujirajaku
 5870 kujirajakubu       1|100 kujirajaku
 5871 kujirajakujou      10 kujirajaku
 5872 tan_distance       3 kujirajakujou
 5873 
 5874 ken                6 shaku  # Also sometimes 6.3, 6.5, or 6.6
 5875                             # http://www.homarewood.co.jp/syakusun.htm
 5876 
 5877 # mostly unused
 5878 chou_distance      60 ken
 5879 chou               chou_distance
 5880 ri                 36 chou
 5881 
 5882 # Japanese Area Measures
 5883 
 5884 # Tsubo is still used for land size, though the others are more
 5885 # recognized by their homonyms in the other measurements.
 5886 
 5887 gou_area             1|10 tsubo
 5888 tsubo                36 shaku^2    # Size of two tatami = ken^2 ??
 5889 se                   30 tsubo
 5890 tan_area             10 se
 5891 chou_area            10 tan_area
 5892 
 5893 # http://en.wikipedia.org/wiki/Taiwanese_units_of_measurement
 5894 ping                 tsubo     # http://zh.wikipedia.org/wiki/坪
 5895 jia                  2934 ping # http://zh.wikipedia.org/wiki/甲_(单位)
 5896 fen                  1|10 jia  # http://zh.wikipedia.org/wiki/分
 5897 fen_area             1|10 jia  # Protection against future collisions
 5898 !utf8
 5899 坪                   ping      # via Hanyu Pinyin romanizations
 5900 甲                   jia
 5901 分                   fen
 5902 分地                 fen_area  # Protection against future collisions
 5903 !endutf8
 5904 
 5905 # Japanese architecture is based on a "standard" size of tatami mat.
 5906 # Room sizes today are given in number of tatami, and this number
 5907 # determines the spacing between colums and hence sizes of sliding
 5908 # doors and paper screens.  However, every region has its own slightly
 5909 # different tatami size.  Edoma, used in and around Tokyo and
 5910 # Hokkaido, is becoming a nationwide standard.  Kyouma is used around
 5911 # Kyoto, Osaka and Kyuushu, and Chuukyouma is used around Nagoya.
 5912 # Note that the tatami all have the aspect ratio 2:1 so that the mats
 5913 # can tile the room with some of them turned 90 degrees.
 5914 #
 5915 # http://www.moon2.net/tatami/infotatami/structure.html
 5916 
 5917 edoma                (5.8*2.9) shaku^2
 5918 kyouma               (6.3*3.15) shaku^2
 5919 chuukyouma           (6*3) shaku^2
 5920 jou_area             edoma
 5921 tatami               jou_area
 5922 
 5923 # Japanese Volume Measures
 5924 
 5925 # The "shou" is still used for such things as alcohol and seasonings.
 5926 # Large quantities of paint are still purchased in terms of "to".
 5927 
 5928 shaku_volume         1|10 gou_volume
 5929 gou_volume           1|10 shou
 5930 gou                  gou_volume
 5931 shou                 (4.9*4.9*2.7) sun^3   # The character shou which is
 5932                                            # the same as masu refers to a
 5933                                            # rectangular wooden cup used to
 5934                                            # measure liquids and cereal.
 5935                                            # Sake is sometimes served in a masu
 5936                                            # Note that it happens to be
 5937                                            # EXACTLY 7^4/11^3 liters.
 5938 to                   10 shou
 5939 koku                 10 to  # No longer used; historically a measure of rice
 5940 
 5941 # Japanese Weight Measures
 5942 #
 5943 # http://wyoming.hp.infoseek.co.jp/zatugaku/zamoney.html
 5944 
 5945 # Not really used anymore.
 5946 
 5947 rin_weight           1|10 bu_weight
 5948 bu_weight            1|10 monme
 5949 fun                  1|10 monme
 5950 monme                momme
 5951 kin                  160 monme
 5952 kan                  1000 monme
 5953 kwan                 kan         # This was the old pronounciation of the unit.
 5954                                  # The old spelling persisted a few centuries
 5955                                  # longer and was not changed until around
 5956                                  # 1950.
 5957 
 5958 # http://en.wikipedia.org/wiki/Taiwanese_units_of_measurement
 5959 # says: "Volume measure in Taiwan is largely metric".
 5960 taijin               kin      # http://zh.wikipedia.org/wiki/台斤
 5961 tailiang             10 monme # http://zh.wikipedia.org/wiki/台斤
 5962 taiqian              monme    # http://zh.wikipedia.org/wiki/台制
 5963 !utf8
 5964 台斤                 taijin # via Hanyu Pinyin romanizations
 5965 台兩                 tailiang
 5966 台錢                 taiqian
 5967 !endutf8
 5968 
 5969 #
 5970 # Australian unit
 5971 #
 5972 
 5973 australiasquare         (10 ft)^2   # Used for house area
 5974 
 5975 
 5976 #
 5977 # A few German units as currently in use.
 5978 #
 5979 
 5980 zentner                 50 kg
 5981 doppelzentner           2 zentner
 5982 pfund                   500 g
 5983 
 5984 #
 5985 # Swedish (Sweden) pre-metric units of 1739.
 5986 # The metric system was adopted in 1878.
 5987 # https://sv.wikipedia.org/wiki/Verkm%C3%A5tt
 5988 #
 5989 
 5990 verklinje               2.0618125 mm
 5991 verktum                 12 verklinje
 5992 kvarter                 6 verktum
 5993 fot                     2 kvarter
 5994 aln                     2 fot
 5995 famn                    3 aln
 5996 
 5997 #
 5998 # Some traditional Russian measures
 5999 #
 6000 # If you would like to help expand this section and understand
 6001 # cyrillic transliteration, let me know.  These measures are meant to
 6002 # reflect common usage, e.g. in translated literature.  
 6003 #
 6004 
 6005 dessiatine              2400 sazhen^2    # Land measure
 6006 dessjatine              dessiatine
 6007 
 6008 funt                    409.51718 grams  # similar to pound
 6009 zolotnik                1|96 funt        # used for precious metal measure
 6010 pood                    40 funt          # common in agricultural measure
 6011 
 6012 arshin                  (2 + 1|3) feet
 6013 sazhen                  3 arshin         # analogous to fathom
 6014 verst                   500 sazhen       # of similar use to mile
 6015 versta                  verst
 6016 borderverst             1000 sazhen
 6017 russianmile             7 verst
 6018 
 6019 
 6020 
 6021 
 6022 #
 6023 # Old French distance measures, from French Weights and Measures
 6024 # Before the Revolution by Zupko
 6025 #
 6026 
 6027 frenchfoot              144|443.296 m     # pied de roi, the standard of Paris.
 6028 pied                    frenchfoot        #   Half of the hashimicubit,
 6029 frenchfeet              frenchfoot        #   instituted by Charlemagne.
 6030 frenchinch              1|12 frenchfoot   #   This exact definition comes from
 6031 frenchthumb             frenchinch        #   a law passed on 10 Dec 1799 which
 6032 pouce                   frenchthumb       #   fixed the meter at
 6033                                           #   3 frenchfeet + 11.296 lignes.
 6034 frenchline              1|12 frenchinch   # This is supposed to be the size
 6035 ligne                   frenchline        #   of the average barleycorn
 6036 frenchpoint             1|12 frenchline
 6037 toise                   6 frenchfeet
 6038 arpent                  180^2 pied^2      # The arpent is 100 square perches,
 6039                                           # but the perche seems to vary a lot
 6040                                           # and can be 18 feet, 20 feet, or 22
 6041                                           # feet.  This measure was described
 6042                                           # as being in common use in Canada in
 6043                                           # 1934 (Websters 2nd).  The value
 6044                                           # given here is the Paris standard
 6045                                           # arpent.
 6046 frenchgrain             1|18827.15 kg     # Weight of a wheat grain, hence
 6047                                           # smaller than the British grain.
 6048 frenchpound             9216 frenchgrain
 6049 
 6050 #
 6051 # Before the Imperial Weights and Measures Act of 1824, various different
 6052 # weights and measures were in use in different places.
 6053 #
 6054 
 6055 # Scots linear measure
 6056 
 6057 scotsinch        1.00540054 UKinch
 6058 scotslink        1|100 scotschain
 6059 scotsfoot        12 scotsinch
 6060 scotsfeet        scotsfoot
 6061 scotsell         37 scotsinch
 6062 scotsfall        6 scotsell
 6063 scotschain       4 scotsfall
 6064 scotsfurlong     10 scotschain
 6065 scotsmile        8 scotsfurlong
 6066 
 6067 # Scots area measure
 6068 
 6069 scotsrood        40 scotsfall^2
 6070 scotsacre        4 scotsrood
 6071 
 6072 # Irish linear measure
 6073 
 6074 irishinch       UKinch
 6075 irishpalm       3 irishinch
 6076 irishspan       3 irishpalm
 6077 irishfoot       12 irishinch
 6078 irishfeet       irishfoot
 6079 irishcubit      18 irishinch
 6080 irishyard       3 irishfeet
 6081 irishpace       5 irishfeet
 6082 irishfathom     6 irishfeet
 6083 irishpole       7 irishyard      # Only these values
 6084 irishperch      irishpole        # are different from
 6085 irishchain      4 irishperch     # the British Imperial
 6086 irishlink       1|100 irishchain # or English values for
 6087 irishfurlong    10 irishchain    # these lengths.
 6088 irishmile       8 irishfurlong   #
 6089 
 6090 #  Irish area measure
 6091 
 6092 irishrood       40 irishpole^2
 6093 irishacre       4 irishrood
 6094 
 6095 # English wine capacity measures (Winchester measures)
 6096 
 6097 winepint       1|2 winequart
 6098 winequart      1|4 winegallon
 6099 winegallon     231 UKinch^3   # Sometimes called the Winchester Wine Gallon,
 6100                               # it was legalized in 1707 by Queen Anne, and
 6101                               # given the definition of 231 cubic inches.  It
 6102                               # had been in use for a while as 8 pounds of wine
 6103                               # using a merchant's pound, but the definition of
 6104                               # the merchant's pound had become uncertain.  A
 6105                               # pound of 15 tower ounces (6750 grains) had been
 6106                               # common, but then a pound of 15 troy ounces
 6107                               # (7200 grains) gained popularity.  Because of
 6108                               # the switch in the value of the merchants pound,
 6109                               # the size of the wine gallon was uncertain in
 6110                               # the market, hence the official act in 1707.
 6111                               # The act allowed that a six inch tall cylinder
 6112                               # with a 7 inch diameter was a lawful wine
 6113                               # gallon.  (This comes out to 230.9 in^3.)
 6114                               # Note also that in Britain a legal conversion
 6115                               # was established to the 1824 Imperial gallon
 6116                               # then taken as 277.274 in^3 so that the wine
 6117                               # gallon was 0.8331 imperial gallons.  This is
 6118                               # 231.1 cubic inches (using the international
 6119                               # inch).
 6120 winerundlet    18 winegallon
 6121 winebarrel     31.5 winegallon
 6122 winetierce     42 winegallon
 6123 winehogshead   2 winebarrel
 6124 winepuncheon   2 winetierce
 6125 winebutt       2 winehogshead
 6126 winepipe       winebutt
 6127 winetun        2 winebutt
 6128 
 6129 # English beer and ale measures used 1803-1824 and used for beer before 1688
 6130 
 6131 beerpint       1|2 beerquart
 6132 beerquart      1|4 beergallon
 6133 beergallon     282 UKinch^3
 6134 beerbarrel     36 beergallon
 6135 beerhogshead   1.5 beerbarrel
 6136 
 6137 # English ale measures used from 1688-1803 for both ale and beer
 6138 
 6139 alepint        1|2 alequart
 6140 alequart       1|4 alegallon
 6141 alegallon      beergallon
 6142 alebarrel      34 alegallon
 6143 alehogshead    1.5 alebarrel
 6144 
 6145 # Scots capacity measure
 6146 
 6147 scotsgill      1|4 mutchkin
 6148 mutchkin       1|2 choppin
 6149 choppin        1|2 scotspint
 6150 scotspint      1|2 scotsquart
 6151 scotsquart     1|4 scotsgallon
 6152 scotsgallon    827.232 UKinch^3
 6153 scotsbarrel    8 scotsgallon
 6154 jug            scotspint
 6155 
 6156 # Scots dry capacity measure
 6157 
 6158 scotswheatlippy   137.333 UKinch^3    # Also used for peas, beans, rye, salt
 6159 scotswheatlippies scotswheatlippy
 6160 scotswheatpeck    4 scotswheatlippy
 6161 scotswheatfirlot  4 scotswheatpeck
 6162 scotswheatboll    4 scotswheatfirlot
 6163 scotswheatchalder 16 scotswheatboll
 6164 
 6165 scotsoatlippy     200.345 UKinch^3    # Also used for barley and malt
 6166 scotsoatlippies   scotsoatlippy
 6167 scotsoatpeck      4 scotsoatlippy
 6168 scotsoatfirlot    4 scotsoatpeck
 6169 scotsoatboll      4 scotsoatfirlot
 6170 scotsoatchalder   16 scotsoatboll
 6171 
 6172 # Scots Tron weight
 6173 
 6174 trondrop       1|16 tronounce
 6175 tronounce      1|20 tronpound
 6176 tronpound      9520 grain
 6177 tronstone      16 tronpound
 6178 
 6179 # Irish liquid capacity measure
 6180 
 6181 irishnoggin    1|4 irishpint
 6182 irishpint      1|2 irishquart
 6183 irishquart     1|2 irishpottle
 6184 irishpottle    1|2 irishgallon
 6185 irishgallon    217.6 UKinch^3
 6186 irishrundlet   18 irishgallon
 6187 irishbarrel    31.5 irishgallon
 6188 irishtierce    42 irishgallon
 6189 irishhogshead  2 irishbarrel
 6190 irishpuncheon  2 irishtierce
 6191 irishpipe      2 irishhogshead
 6192 irishtun       2 irishpipe
 6193 
 6194 # Irish dry capacity measure
 6195 
 6196 irishpeck      2 irishgallon
 6197 irishbushel    4 irishpeck
 6198 irishstrike    2 irishbushel
 6199 irishdrybarrel 2 irishstrike
 6200 irishquarter   2 irishbarrel
 6201 
 6202 # English Tower weights, abolished in 1528
 6203 
 6204 towerpound       5400 grain
 6205 towerounce       1|12 towerpound
 6206 towerpennyweight 1|20 towerounce
 6207 towergrain       1|32 towerpennyweight
 6208 
 6209 # English Mercantile weights, used since the late 12th century
 6210 
 6211 mercpound      6750 grain
 6212 mercounce      1|15 mercpound
 6213 mercpennyweight 1|20 mercounce
 6214 
 6215 # English weights for lead
 6216 
 6217 leadstone     12.5 lb
 6218 fotmal        70 lb
 6219 leadwey       14 leadstone
 6220 fothers       12 leadwey
 6221 
 6222 # English Hay measure
 6223 
 6224 newhaytruss 60 lb             # New and old here seem to refer to "new"
 6225 newhayload  36 newhaytruss    # hay and "old" hay rather than a new unit
 6226 oldhaytruss 56 lb             # and an old unit.
 6227 oldhayload  36 oldhaytruss
 6228 
 6229 # English wool measure
 6230 
 6231 woolclove   7 lb
 6232 woolstone   2 woolclove
 6233 wooltod     2 woolstone
 6234 woolwey     13 woolstone
 6235 woolsack    2 woolwey
 6236 woolsarpler 2 woolsack
 6237 woollast    6 woolsarpler
 6238 
 6239 #
 6240 # Ancient history units:  There tends to be uncertainty in the definitions
 6241 #                         of the units in this section
 6242 # These units are from [11]
 6243 
 6244 # Roman measure.  The Romans had a well defined distance measure, but their
 6245 # measures of weight were poor.  They adopted local weights in different
 6246 # regions without distinguishing among them so that there are half a dozen
 6247 # different Roman "standard" weight systems.
 6248 
 6249 romanfoot    296 mm          # There is some uncertainty in this definition
 6250 romanfeet    romanfoot       # from which all the other units are derived.
 6251 pes          romanfoot       # This value appears in numerous sources. In "The
 6252 pedes        romanfoot       # Roman Land Surveyors", Dilke gives 295.7 mm.
 6253 romaninch    1|12 romanfoot  # The subdivisions of the Roman foot have the
 6254 romandigit   1|16 romanfoot  #   same names as the subdivisions of the pound,
 6255 romanpalm    1|4 romanfoot   #   but we can't have the names for different
 6256 romancubit   18 romaninch    #   units.
 6257 romanpace    5 romanfeet     # Roman double pace (basic military unit)
 6258 passus       romanpace
 6259 romanperch   10 romanfeet
 6260 stade        125 romanpaces
 6261 stadia       stade
 6262 stadium      stade
 6263 romanmile    8 stadia        # 1000 paces
 6264 romanleague  1.5 romanmile
 6265 schoenus     4 romanmile
 6266 
 6267 # Other values for the Roman foot (from Dilke)
 6268 
 6269 earlyromanfoot    29.73 cm
 6270 pesdrusianus      33.3 cm    # or 33.35 cm, used in Gaul & Germany in 1st c BC
 6271 lateromanfoot     29.42 cm
 6272 
 6273 # Roman areas
 6274 
 6275 actuslength  120 romanfeet     # length of a Roman furrow
 6276 actus        120*4 romanfeet^2 # area of the furrow
 6277 squareactus  120^2 romanfeet^2 # actus quadratus
 6278 acnua        squareactus
 6279 iugerum      2 squareactus
 6280 iugera       iugerum
 6281 jugerum      iugerum
 6282 jugera       iugerum
 6283 heredium     2 iugera          # heritable plot
 6284 heredia      heredium
 6285 centuria     100 heredia
 6286 centurium    centuria
 6287 
 6288 # Roman volumes
 6289 
 6290 sextarius       35.4 in^3      # Basic unit of Roman volume.  As always,
 6291 sextarii        sextarius      # there is uncertainty.  Six large Roman
 6292                                # measures survive with volumes ranging from
 6293                                # 34.4 in^3 to 39.55 in^3.  Three of them
 6294                                # cluster around the size given here.
 6295                                #
 6296                                # But the values for this unit vary wildly
 6297                                # in other sources.  One reference  gives 0.547
 6298                                # liters, but then says the amphora is a
 6299                                # cubic Roman foot.  This gives a value for the
 6300                                # sextarius of 0.540 liters.  And the
 6301                                # encyclopedia Brittanica lists 0.53 liters for
 6302                                # this unit.  Both [7] and [11], which were
 6303                                # written by scholars of weights and measures,
 6304                                # give the value of 35.4 cubic inches.
 6305 cochlearia      1|48 sextarius
 6306 cyathi          1|12 sextarius
 6307 acetabula       1|8 sextarius
 6308 quartaria       1|4 sextarius
 6309 quartarius      quartaria
 6310 heminae         1|2 sextarius
 6311 hemina          heminae
 6312 cheonix         1.5 sextarii
 6313 
 6314 # Dry volume measures (usually)
 6315 
 6316 semodius        8 sextarius
 6317 semodii         semodius
 6318 modius          16 sextarius
 6319 modii           modius
 6320 
 6321 # Liquid volume measures (usually)
 6322 
 6323 congius         12 heminae
 6324 congii          congius
 6325 amphora         8 congii
 6326 amphorae        amphora      # Also a dry volume measure
 6327 culleus         20 amphorae
 6328 quadrantal      amphora
 6329 
 6330 # Roman weights
 6331 
 6332 libra           5052 grain   # The Roman pound varied significantly
 6333 librae          libra        # from 4210 grains to 5232 grains.  Most of
 6334 romanpound      libra        # the standards were obtained from the weight
 6335 uncia           1|12 libra   # of particular coins.  The one given here is
 6336 unciae          uncia        # based on the Gold Aureus of Augustus which
 6337 romanounce      uncia        # was in use from BC 27 to AD 296.
 6338 deunx           11 uncia
 6339 dextans         10 uncia
 6340 dodrans         9 uncia
 6341 bes             8 uncia
 6342 seprunx         7 uncia
 6343 semis           6 uncia
 6344 quincunx        5 uncia
 6345 triens          4 uncia
 6346 quadrans        3 uncia
 6347 sextans         2 uncia
 6348 sescuncia       1.5 uncia
 6349 semuncia        1|2 uncia
 6350 siscilius       1|4 uncia
 6351 sextula         1|6 uncia
 6352 semisextula     1|12 uncia
 6353 scriptulum      1|24 uncia
 6354 scrupula        scriptulum
 6355 romanobol       1|2 scrupula
 6356 
 6357 romanaspound    4210 grain    # Old pound based on bronze coinage, the
 6358                               # earliest money of Rome BC 338 to BC 268.
 6359 
 6360 # Egyptian length measure
 6361 
 6362 egyptianroyalcubit      20.63 in    # plus or minus .2 in
 6363 egyptianpalm            1|7 egyptianroyalcubit
 6364 egyptiandigit           1|4 egyptianpalm
 6365 egyptianshortcubit      6 egyptianpalm
 6366 
 6367 doubleremen             29.16 in  # Length of the diagonal of a square with
 6368 remendigit       1|40 doubleremen # side length of 1 royal egyptian cubit.
 6369                                   # This is divided into 40 digits which are
 6370                                   # not the same size as the digits based on
 6371                                   # the royal cubit.
 6372 
 6373 # Greek length measures
 6374 
 6375 greekfoot               12.45 in      # Listed as being derived from the
 6376 greekfeet               greekfoot     # Egyptian Royal cubit in [11].  It is
 6377 greekcubit              1.5 greekfoot # said to be 3|5 of a 20.75 in cubit.
 6378 pous                    greekfoot
 6379 podes                   greekfoot
 6380 orguia                  6 greekfoot
 6381 greekfathom             orguia
 6382 stadion                 100 orguia
 6383 akaina                  10 greekfeet
 6384 plethron                10 akaina
 6385 greekfinger             1|16 greekfoot
 6386 homericcubit            20 greekfingers  # Elbow to end of knuckles.
 6387 shortgreekcubit         18 greekfingers  # Elbow to start of fingers.
 6388 
 6389 ionicfoot               296 mm
 6390 doricfoot               326 mm
 6391 
 6392 olympiccubit            25 remendigit    # These olympic measures were not as
 6393 olympicfoot             2|3 olympiccubit # common as the other greek measures.
 6394 olympicfinger           1|16 olympicfoot # They were used in agriculture.
 6395 olympicfeet             olympicfoot
 6396 olympicdakylos          olympicfinger
 6397 olympicpalm             1|4 olympicfoot
 6398 olympicpalestra         olympicpalm
 6399 olympicspithame         3|4 foot
 6400 olympicspan             olympicspithame
 6401 olympicbema             2.5 olympicfeet
 6402 olympicpace             olympicbema
 6403 olympicorguia           6 olympicfeet
 6404 olympicfathom           olympicorguia
 6405 olympiccord             60 olympicfeet
 6406 olympicamma             olympiccord
 6407 olympicplethron         100 olympicfeet
 6408 olympicstadion          600 olympicfeet
 6409 
 6410 # Greek capacity measure
 6411 
 6412 greekkotyle             270 ml           # This approximate value is obtained
 6413 xestes                  2 greekkotyle    # from two earthenware vessels that
 6414 khous                   12 greekkotyle   # were reconstructed from fragments.
 6415 metretes                12 khous         # The kotyle is a day's corn ration
 6416 choinix                 4 greekkotyle    # for one man.
 6417 hekteos                 8 choinix
 6418 medimnos                6 hekteos
 6419 
 6420 # Greek weight.  Two weight standards were used, an Aegina standard based
 6421 # on the Beqa shekel and an Athens (attic) standard.
 6422 
 6423 aeginastater            192 grain        # Varies up to 199 grain
 6424 aeginadrachmae          1|2 aeginastater
 6425 aeginaobol              1|6 aeginadrachmae
 6426 aeginamina              50 aeginastaters
 6427 aeginatalent            60 aeginamina    # Supposedly the mass of a cubic foot
 6428                                          # of water (whichever foot was in use)
 6429 
 6430 atticstater             135 grain        # Varies 134-138 grain
 6431 atticdrachmae           1|2 atticstater
 6432 atticobol               1|6 atticdrachmae
 6433 atticmina               50 atticstaters
 6434 attictalent             60 atticmina     # Supposedly the mass of a cubic foot
 6435                                          # of water (whichever foot was in use)
 6436 
 6437 # "Northern" cubit and foot.  This was used by the pre-Aryan civilization in
 6438 # the Indus valley.  It was used in Mesopotamia, Egypt, North Africa, China,
 6439 # central and Western Europe until modern times when it was displaced by
 6440 # the metric system.
 6441 
 6442 northerncubit           26.6 in           # plus/minus .2 in
 6443 northernfoot            1|2 northerncubit
 6444 
 6445 sumeriancubit           495 mm
 6446 kus                     sumeriancubit
 6447 sumerianfoot            2|3 sumeriancubit
 6448 
 6449 assyriancubit           21.6 in
 6450 assyrianfoot            1|2 assyriancubit
 6451 assyrianpalm            1|3 assyrianfoot
 6452 assyriansusi            1|20 assyrianpalm
 6453 susi                    assyriansusi
 6454 persianroyalcubit       7 assyrianpalm
 6455 
 6456 
 6457 # Arabic measures.  The arabic standards were meticulously kept.  Glass weights
 6458 # accurate to .2 grains were made during AD 714-900.
 6459 
 6460 hashimicubit            25.56 in          # Standard of linear measure used
 6461                                           # in Persian dominions of the Arabic
 6462                                           # empire 7-8th cent.  Is equal to two
 6463                                           # French feet.
 6464 
 6465 blackcubit              21.28 in
 6466 arabicfeet              1|2 blackcubit
 6467 arabicfoot              arabicfeet
 6468 arabicinch              1|12 arabicfoot
 6469 arabicmile              4000 blackcubit
 6470 
 6471 silverdirhem            45 grain  # The weights were derived from these two
 6472 tradedirhem             48 grain  # units with two identically named systems
 6473                                   # used for silver and used for trade purposes
 6474 
 6475 silverkirat             1|16 silverdirhem
 6476 silverwukiyeh           10 silverdirhem
 6477 silverrotl              12 silverwukiyeh
 6478 arabicsilverpound       silverrotl
 6479 
 6480 tradekirat              1|16 tradedirhem
 6481 tradewukiyeh            10 tradedirhem
 6482 traderotl               12 tradewukiyeh
 6483 arabictradepound        traderotl
 6484 
 6485 # Miscellaneous ancient units
 6486 
 6487 parasang                3.5 mile # Persian unit of length usually thought
 6488                                  # to be between 3 and 3.5 miles
 6489 biblicalcubit           21.8 in
 6490 hebrewcubit             17.58 in
 6491 li                      10|27.8 mile  # Chinese unit of length
 6492                                       #   100 li is considered a day's march
 6493 liang                   11|3 oz       # Chinese weight unit
 6494 
 6495 
 6496 # Medieval time units.  According to the OED, these appear in Du Cange
 6497 # by Papias.
 6498 
 6499 timepoint               1|5 hour  # also given as 1|4
 6500 timeminute              1|10 hour
 6501 timeostent              1|60 hour
 6502 timeounce               1|8 timeostent
 6503 timeatom                1|47 timeounce
 6504 
 6505 # Given in [15], these subdivisions of the grain were supposedly used
 6506 # by jewelers.  The mite may have been used but the blanc could not
 6507 # have been accurately measured.
 6508 
 6509 mite                    1|20 grain
 6510 droit                   1|24 mite
 6511 periot                  1|20 droit
 6512 blanc                   1|24 periot
 6513 
 6514 #
 6515 # Localization
 6516 #
 6517 
 6518 !var UNITS_ENGLISH US
 6519 hundredweight           ushundredweight
 6520 ton                     uston
 6521 scruple                 apscruple
 6522 fluidounce              usfluidounce
 6523 gallon                  usgallon
 6524 bushel                  usbushel
 6525 quarter                 quarterweight
 6526 cup                     uscup
 6527 tablespoon              ustablespoon
 6528 teaspoon                usteaspoon
 6529 dollar                  US$
 6530 cent                    $ 0.01
 6531 penny                   cent
 6532 minim                   minimvolume
 6533 pony                    ponyvolume
 6534 grand                   usgrand
 6535 firkin                  usfirkin
 6536 hogshead                ushogshead
 6537 !endvar
 6538 
 6539 !var UNITS_ENGLISH GB
 6540 hundredweight           brhundredweight
 6541 ton                     brton
 6542 scruple                 brscruple
 6543 fluidounce              brfluidounce
 6544 gallon                  brgallon
 6545 bushel                  brbushel
 6546 quarter                 brquarter
 6547 chaldron                brchaldron
 6548 cup                     brcup
 6549 teacup                  brteacup
 6550 tablespoon              brtablespoon
 6551 teaspoon                brteaspoon
 6552 dollar                  US$
 6553 cent                    $ 0.01
 6554 penny                   brpenny
 6555 minim                   minimnote
 6556 pony                    brpony
 6557 grand                   brgrand
 6558 firkin                  brfirkin
 6559 hogshead                brhogshead
 6560 !endvar
 6561 
 6562 !varnot UNITS_ENGLISH GB US
 6563 !message Unknown value for environment variable UNITS_ENGLISH.  Should be GB or US.
 6564 !endvar
 6565 
 6566 
 6567 !utf8
 6568 ⅛-                      1|8
 6569 ¼-                      1|4
 6570 ⅜-                      3|8
 6571 ½-                      1|2
 6572 ⅝-                      5|8
 6573 ¾-                      3|4
 6574 ⅞-                      7|8
 6575 ⅙-                      1|6
 6576 ⅓-                      1|3
 6577 ⅔-                      2|3
 6578 ⅚-                      5|6
 6579 ⅕-                      1|5
 6580 ⅖-                      2|5
 6581 ⅗-                      3|5
 6582 ⅘-                      4|5
 6583 # U+2150-               1|7  For some reason these characters are getting
 6584 # U+2151-               1|9  flagged as invalid UTF8.
 6585 # U+2152-               1|10
 6586 #⅐-               1|7   # fails under MacOS
 6587 #⅑-               1|9   # fails under MacOS
 6588 #⅒-               1|10  # fails under MacOS
 6589 ℯ                       exp(1)      # U+212F, base of natural log
 6590 µ-                      micro       # micro sign U+00B5
 6591 μ-                      micro       # small mu U+03BC
 6592 ångström                angstrom
 6593 Å                       angstrom    # angstrom symbol U+212B
 6594 Å                       angstrom    # A with ring U+00C5
 6595 röntgen                 roentgen
 6596 °C                      degC
 6597 °F                      degF
 6598 °K                      K           # °K is incorrect notation
 6599 °R                      degR
 6600 °                       degree
 6601 ℃                       degC
 6602 ℉                       degF
 6603 K                       K          # Kelvin symbol, U+212A
 6604 ℓ                       liter      # unofficial abbreviation used in some places
 6605 Ω                       ohm       # Ohm symbol U+2126
 6606 Ω                       ohm       # Greek capital omega U+03A9
 6607 ℧                       mho
 6608 ʒ                        dram     # U+0292
 6609 ℈                       scruple
 6610 ℥                       ounce
 6611 ℔                       lb
 6612 ℎ                       h
 6613 ℏ                       hbar
 6614 ‰                       1|1000
 6615 ‱                       1|10000
 6616 ′                       '        # U+2032
 6617 ″                       "        # U+2033
 6618 
 6619 #
 6620 # Unicode currency symbols
 6621 #
 6622 
 6623 ¢                       cent
 6624 £                       britainpound
 6625 ¥                       japanyen
 6626 €                       euro
 6627 ₩                       southkoreawon
 6628 ₪                       israelnewshekel
 6629 ₤                       lira
 6630 # ₺                       turkeylira  # fails under MacOS
 6631 ₨                       rupee           # unofficial legacy rupee sign
 6632 # ₹                       indiarupee      # official rupee sign # MacOS fail
 6633 #؋                       afghanafghani    # fails under MacOS
 6634 ฿                       thailandbaht
 6635 ₡                       elsalvadorcolon # Also costaricacolon
 6636 ₣                       francefranc
 6637 ₦                       nigerianaira
 6638 ₧                       spainpeseta
 6639 ₫                       vietnamdong
 6640 ₭                       laokip 
 6641 ₮                       mongoliatugrik
 6642 ₯                       greecedrachma
 6643 ₱                       philippinepeso
 6644 # ₲                       paraguayguarani # fails under MacOS
 6645 #₴                       ukrainehryvnia   # fails under MacOS
 6646 #₵                       ghanacedi        # fails under MacOS
 6647 #₸                       kazakhstantenge  # fails under MacOS
 6648 #₼                       azerbaijanmanat # fails under MacOS
 6649 #₽                       russiaruble     # fails under MacOS
 6650 #₾                       georgialari     # fails under MacOS
 6651 ﷼                       iranrial
 6652 ﹩                      $
 6653 ¢                      ¢
 6654 £                      £
 6655 ¥                      ¥
 6656 ₩                      ₩
 6657 
 6658 #
 6659 # Square unicode symbols starting at U+3371
 6660 #
 6661 
 6662 ㍱                      hPa
 6663 ㍲                      da
 6664 ㍳                      au
 6665 ㍴                      bar
 6666 # ㍵                          oV???
 6667 ㍶                      pc
 6668 #㍷                      dm      invalid on Mac
 6669 #㍸                      dm^2    invalid on Mac
 6670 #㍹                      dm^3    invalid on Mac
 6671 ㎀                      pA
 6672 ㎁                      nA
 6673 ㎂                      µA
 6674 ㎃                      mA
 6675 ㎄                      kA
 6676 ㎅                      kB
 6677 ㎆                      MB
 6678 ㎇                      GB
 6679 ㎈                      cal
 6680 ㎉                      kcal
 6681 ㎊                      pF
 6682 ㎋                      nF
 6683 ㎌                      µF
 6684 ㎍                      µg
 6685 ㎎                      mg
 6686 ㎏                      kg
 6687 ㎐                      Hz
 6688 ㎑                      kHz
 6689 ㎒                      MHz
 6690 ㎓                      GHz
 6691 ㎔                      THz
 6692 ㎕                      µL
 6693 ㎖                      mL
 6694 ㎗                      dL
 6695 ㎘                      kL
 6696 ㎙                      fm
 6697 ㎚                      nm
 6698 ㎛                      µm
 6699 ㎜                      mm
 6700 ㎝                      cm
 6701 ㎞                      km
 6702 ㎟                      mm^2
 6703 ㎠                      cm^2
 6704 ㎡                      m^2
 6705 ㎢                      km^2
 6706 ㎣                      mm^3
 6707 ㎤                      cm^3
 6708 ㎥                      m^3
 6709 ㎦                      km^3
 6710 ㎧                      m/s
 6711 ㎨                      m/s^2
 6712 ㎩                      Pa
 6713 ㎪                      kPa
 6714 ㎫                      MPa
 6715 ㎬                      GPa
 6716 ㎭                      rad
 6717 ㎮                      rad/s
 6718 ㎯                      rad/s^2
 6719 ㎰                      ps
 6720 ㎱                      ns
 6721 ㎲                      µs
 6722 ㎳                      ms
 6723 ㎴                      pV
 6724 ㎵                      nV
 6725 ㎶                      µV
 6726 ㎷                      mV
 6727 ㎸                      kV
 6728 ㎹                      MV
 6729 ㎺                      pW
 6730 ㎻                      nW
 6731 ㎼                      µW
 6732 ㎽                      mW
 6733 ㎾                      kW
 6734 ㎿                      MW
 6735 ㏀                      kΩ
 6736 ㏁                      MΩ
 6737 ㏃                      Bq
 6738 ㏄                      cc
 6739 ㏅                      cd
 6740 ㏆                      C/kg
 6741 ㏈()                    dB
 6742 ㏉                      Gy
 6743 ㏊                      ha
 6744 # ㏋  HP??
 6745 ㏌                      in
 6746 # ㏍                      KK??
 6747 # ㏎                      KM???
 6748 ㏏                      kt
 6749 ㏐                      lm
 6750 # ㏑                      ln
 6751 # ㏒                      log
 6752 ㏓                      lx
 6753 ㏔                      mb
 6754 ㏕                      mil
 6755 ㏖                      mol
 6756 ㏗()                    pH
 6757 ㏙                      ppm
 6758 #   ㏚     PR???
 6759 ㏛                      sr
 6760 ㏜                      Sv
 6761 ㏝                      Wb
 6762 #㏞                      V/m     Invalid on Mac
 6763 #㏟                      A/m     Invalid on Mac
 6764 #㏿                      gal     Invalid on Mac
 6765 
 6766 !endutf8
 6767 
 6768 ############################################################################
 6769 #
 6770 # Unit list aliases
 6771 #
 6772 # These provide a shorthand for conversions to unit lists.
 6773 #
 6774 ############################################################################
 6775 
 6776 !unitlist hms hr;min;sec
 6777 !unitlist time year;day;hr;min;sec
 6778 !unitlist dms deg;arcmin;arcsec
 6779 !unitlist ftin ft;in;1|8 in
 6780 !unitlist inchfine in;1|8 in;1|16 in;1|32 in;1|64 in
 6781 !unitlist usvol cup;3|4 cup;2|3 cup;1|2 cup;1|3 cup;1|4 cup;\
 6782                 tbsp;tsp;1|2 tsp;1|4 tsp;1|8 tsp
 6783 
 6784 ############################################################################
 6785 #
 6786 # The following units were in the unix units database but do not appear in
 6787 # this file:
 6788 #
 6789 #      wey        used for cheese, salt and other goods.  Measured mass or
 6790 #      waymass    volume depending on what was measured and where the measuring
 6791 #                 took place.  A wey of cheese ranged from 200 to 324 pounds.
 6792 #
 6793 #      sack       No precise definition
 6794 #
 6795 #      spindle    The length depends on the type of yarn
 6796 #
 6797 #      block      Defined variously on different computer systems
 6798 #
 6799 #      erlang     A unit of telephone traffic defined variously.
 6800 #                 Omitted because there are no other units for this
 6801 #                 dimension.  Is this true?  What about CCS = 1/36 erlang?
 6802 #                 Erlang is supposed to be dimensionless.  One erlang means
 6803 #                 a single channel occupied for one hour.
 6804 #
 6805 ############################################################################
 6806