;; Define database db for Unicalc ;; by Robert Keller ;; The Unicalc database is an association list of pairs. ;; Each pair consists of a unit and a quantity defining the unit. ;; Units are atoms. ;; Quantities are 3-lists: numeric multiplier, numerator, denominator ;; Both numerator and denominator are lists of units. ;; It is assumed that they do not have any units in common and are sorted ;; '(i.e. they are already simplified, in the sense of the Unicalc application). (define unicalc-db (list (list 'A (make-QL 1 '(ampere) '())) (list 'amp (make-QL 1 '(ampere) '())) (list 'amu (make-QL 1 '(atomic_mass_unit) '())) (list 'atomic_mass_unit (make-QL 1 '(dalton) '())) (list 'AU (make-QL 1 '(astronomical_unit) '())) (list 'bbl (make-QL 1 '(barrel) '())) (list 'C (make-QL 1 '(coulomb) '())) (list 'c (make-QL 1 '(speed_of_light) '())) (list 'cal (make-QL 1 '(calorie) '())) (list 'cd (make-QL 1 '(candela) '())) (list 'cm (make-QL 1 '(centimeter) '())) (list 'ev (make-QL 1 '(electron_volt) '())) (list 'feet (make-QL 1 '(foot) '())) (list 'fl_oz (make-QL 1 '(fluid_ounce) '())) (list 'ft (make-QL 1 '(foot) '())) (list 'F (make-QL 1 '(farad) '())) (list 'gev (make-QL 1e9 '(ev) '())) (list 'g (make-QL 1 '(gram) '())) (list 'G (make-QL 1 '(gravitational_constant) '())) (list 'h (make-QL 1 '(Planck_constant) '())) (list 'hp (make-QL 1 '(horsepower) '())) (list 'hr (make-QL 1 '(hour) '())) (list 'H (make-QL 1 '(henry) '())) (list 'Hz (make-QL 1 '(hertz) '())) (list 'hertz (make-QL 1 '() '(second))) (list 'in (make-QL 1 '(inch) '())) (list 'inches (make-QL 1 '(inch) '())) (list 'J (make-QL 1 '(joule) '())) (list 'kilogram (make-QL 1 '(kg) '())) (list 'kilometer (make-QL 1000 '(meter) '())) (list 'km (make-QL 1 '(kilometer) '())) (list 'kph (make-QL 1 '(kilometer) '(hour))) (list 'kwh (make-QL 1 '(kilowatt hour) '())) (list 'l (make-QL 1 '(liter) '())) (list 'lb (make-QL 1 '(pound) '())) (list 'litre (make-QL 1 '(liter) '())) (list 'lm (make-QL 1 '(lumen) '())) (list 'lx (make-QL 1 '(lux) '())) (list 'm (make-QL 1 '(meter) '())) (list 'megohm (make-QL 1000000 '(ohm) '())) (list 'metre (make-QL 1 '(meter) '())) (list 'mev (make-QL 1000000 '(electron_volt) '())) (list 'mho (make-QL 1 '(siemens) '())) (list 'microhm (make-QL 1e-6 '(ohm) '())) (list 'millimeter (make-QL 1/1000000 '(meter) '())) (list 'millisecond (make-QL 1/1000000 '(second) '())) (list 'min (make-QL 1 '(minute) '())) (list 'mol (make-QL 1 '(mole) '())) (list 'mm (make-QL 1 '(millimeter) '())) (list 'mph (make-QL 1 '(mile) '(hour))) (list 'ms (make-QL 1 '(millisecond) '())) (list 'N (make-QL 1 '(newton) '())) (list 'qt (make-QL 1 '(quart) '())) (list 'pc (make-QL 1 '(parsec) '())) (list 'pi (make-QL 3.14159265358979323846 '() '())) (list 'psi (make-QL 1 '(pound_force) '(inch inch))) (list 'pt (make-QL 1 '(pint) '())) (list 'rpm (make-QL 1 '(revolution) '(second))) (list 'S (make-QL 1 '(siemens) '())) (list 's (make-QL 1 '(second) '())) (list 'sec (make-QL 1 '(second) '())) (list 'tbsp (make-QL 1 '(tablespoon) '())) (list 'tsp (make-QL 1 '(teaspoon) '())) (list 'T (make-QL 1 '(tesla) '())) (list 'us (make-QL 1 '(microsecond) '())) (list 'V (make-QL 1 '(volt) '())) (list 'W (make-QL 1 '(watt) '())) (list 'Wb (make-QL 1 '(weber) '())) (list 'yd (make-QL 1 '(yard) '())) (list 'yr (make-QL 1 '(year) '())) (list 'acre (make-QL 43560 '(foot foot) '())) (list 'apoth_dram (make-QL 60 '(grain) '())) (list 'apoth_ounce (make-QL 480 '(grain) '())) (list 'apoth_pound (make-QL 5760 '(grain) '())) (list 'are (make-QL 100 '(meter meter) '())) (list 'angstrom (make-QL 0.0000000001 '(meter) '())) (list 'astronomical_unit (make-QL 149600000000 '(meter) '())) (list 'atmosphere (make-QL 101325 '(pascal) '())) (list 'bar (make-QL 100000 '(pascal) '())) (list 'barn (make-QL 1e-28 '(meter meter) '())) (list 'barrel (make-QL 31.5 '(gallon) '())) (list 'baryl (make-QL 1 '(dyne) '(centimeter centimeter))) (list 'baud (make-QL 1 '(bit) '(second))) (list 'bolt (make-QL 40 '(yard) '())) (list 'british_gallon (make-QL 1.20095 '(gallon) '())) (list 'btu (make-QL 1055.06 '(joule) '())) (list 'bucket (make-QL 18180 '(centimeter centimeter centimeter) '())) (list 'bushel (make-QL 4 '(peck) '())) (list 'byte (make-QL 8 '(bit) '())) (list 'cable (make-QL 720 '(foot) '())) (list 'carat (make-QL 200 '(milligram) '())) (list 'caliber (make-QL 0.001 '(inch) '())) (list 'calorie (make-QL 4.1868 '(joule) '())) (list 'candle (make-QL 1 '(candela) '())) (list 'centare (make-QL 0.01 '(are) '())) (list 'centimeter (make-QL 0.01 '(meter) '())) (list 'century (make-QL 10 '(decade) '())) (list 'chain (make-QL 66 '(foot) '())) (list 'chronon (make-QL 1e-24 '(second) '())) (list 'coulomb (make-QL 1 '(ampere second) '())) (list 'cup (make-QL 1/2 '(pint) '())) (list 'curie (make-QL 3.7037e10 '(becquerel) '())) (list 'dalton (make-QL 1.6605654e-24 '(gram) '())) (list 'daraf (make-QL 1 '() '(farad))) (list 'day (make-QL 24 '(hour) '())) (list 'decade (make-QL 10 '(year) '())) (list 'degree (make-QL 1 '(radian) '(pi))) (list 'dozen (make-QL 12 '() '())) (list 'dram (make-QL 0.00390625 '(pound) '())) (list 'dry_barrel (make-QL 105 '(dry_quart) '())) (list 'dry_pint (make-QL 0.5 '(dry_quart) '())) (list 'dry_quart (make-QL 67.2 '(inch inch inch) '())) (list 'dyne (make-QL 0.00001 '(newton) '())) (list 'electron_volt (make-QL 1.60218925e-20 '(joule) '())) (list 'ell (make-QL 45 '(inch) '())) (list 'em (make-QL 0.167 '(inch) '())) (list 'en (make-QL 0.5 '(em) '())) (list 'erg (make-QL 0.000001 '(joule) '())) (list 'faraday (make-QL 96490 '(coulomb) '())) (list 'farad (make-QL 1 '(coulomb) '(volt))) (list 'fathom (make-QL 6 '(foot) '())) (list 'fermi (make-QL 1e-15 '(meter) '())) (list 'fluid_dram (make-QL 0.125 '(fluid_ounce) '())) (list 'fluid_ounce (make-QL 0.125 '(cup) '())) (list 'flux_unit (make-QL 1e-26 '(watt) '(meter meter Hz))) (list 'foot (make-QL 12 '(inch) '())) (list 'fortnight (make-QL 2 '(week) '())) (list 'free_acceleration (make-QL 9.80665 '(meter) '(second second))) (list 'furlong (make-QL 40 '(rod) '())) (list 'gallon (make-QL 231 '(inch inch inch) '())) (list 'gauss (make-QL 0.0001 '(tesla) '())) (list 'gilbert (make-QL 1 '(ampere turn) '())) (list 'gill (make-QL 0.25 '(pint) '())) (list 'grain (make-QL 0.000142857 '(pound) '())) (list 'gram (make-QL 0.001 '(kg) '())) (list 'grav (make-QL 1 '(free_acceleration) '())) (list 'gravitational_constant (make-QL 6.67259e-11 '(newton meter meter) '(kg kg))) (list 'gross (make-QL 12 '(dozen) '())) (list 'hectare (make-QL 100 '(acre) '())) (list 'henry (make-QL 1 '() '(ampere))) (list 'hand (make-QL 4 '(inch) '())) (list 'hogshead (make-QL 63 '(gallon) '())) (list 'horsepower (make-QL 550 '(foot pound_force) '(second))) (list 'hour (make-QL 60 '(minute) '())) (list 'inch (make-QL 0.02539954113 '(meter) '())) (list 'joule (make-QL 1 '(kg meter meter) '(second second))) (list 'kilogram_force (make-QL 1 '(kg free_acceleration) '())) (list 'knot (make-QL 1 '(nautical_mile) '(hour))) (list 'lambert (make-QL 3.142 '(candela) '(centimeter centimeter))) (list 'league (make-QL 3 '(mile) '())) (list 'light_year (make-QL 9406910000000000 '(meter) '())) (list 'link (make-QL 7.92 '(inch) '())) (list 'liter (make-QL 1000 '(centimeter centimeter centimeter) '())) (list 'long_ton (make-QL 2240 '(pound) '())) (list 'lumen (make-QL 1 '(candela steradian) '())) (list 'lux (make-QL 1 '(lumen) '(meter meter))) (list 'maxwell (make-QL 0.00000001 '(weber) '())) (list 'metric_ton (make-QL 1000 '(kg) '())) (list 'micron (make-QL 0.000001 '(meter) '())) (list 'mil (make-QL 0.001 '(inch) '())) (list 'mile (make-QL 8 '(furlong) '())) (list 'millenium (make-QL 10 '(century) '())) (list 'minute (make-QL 60 '(second) '())) (list 'mole (make-QL 6.02253e23 '() '())) (list 'nautical_mile (make-QL 1.15078 '(mile) '())) (list 'newton (make-QL 1 '(joule) '(meter))) (list 'ohm (make-QL 1 '(volt) '(ampere))) (list 'oil_barrel (make-QL 42 '(gallon) '())) (list 'ounce (make-QL 0.0625 '(pound) '())) (list 'parsec (make-QL 30856770000000000 '(meter) '())) (list 'pascal (make-QL 1 '(newton) '(meter meter))) (list 'Planck_constant (make-QL 6.626076e-34 '(joule second) '())) (list 'peck (make-QL 8 '(dry_quart) '())) (list 'pennyweight (make-QL 24 '(grain) '())) (list 'pica (make-QL 12 '(point) '())) (list 'pint (make-QL 0.5 '(quart) '())) (list 'point (make-QL 0.013837 '(inch) '())) (list 'poise (make-QL 0.1 '(pascal) '(second))) (list 'pound (make-QL 0.45359237 '(kg) '())) (list 'pound_force (make-QL 1 '(pound free_acceleration) '())) (list 'poundal (make-QL 1 '(foot pound) '(second second))) (list 'quadrant (make-QL 90 '(degree) '())) (list 'quart (make-QL 0.25 '(gallon) '())) (list 'revolution (make-QL 4 '(quadrant) '())) (list 'reyn (make-QL 68947.6 '(poise) '())) (list 'rod (make-QL 16.5 '(foot) '())) (list 'rood (make-QL 0.25 '(acre) '())) (list 'rope (make-QL 20 '(foot) '())) (list 'scruple (make-QL 20 '(grain) '())) (list 'section (make-QL 1 '(mile mile) '())) (list 'siemens (make-QL 1 '(ampere) '(volt))) (list 'skein (make-QL 360 '(foot) '())) (list 'slug (make-QL 32.1740 '(pound) '())) (list 'span (make-QL 9 '(inch) '())) (list 'speed_of_light (make-QL 299792445.8 '(meter) '(second))) (list 'stadion (make-QL 622 '(foot) '())) (list 'stadium (make-QL 202 '(yard) '())) (list 'stokes (make-QL 0.0001 '(meter meter) '(second))) (list 'survey_mile (make-QL 320 '(rod) '())) (list 'tablespoon (make-QL 0.5 '(fluid_ounce) '())) (list 'teaspoon (make-QL 1/3 '(tablespoon) '())) (list 'tesla (make-QL 1 '(weber) '(meter meter))) (list 'therm (make-QL 1e5 '(btu) '())) (list 'ton (make-QL 2000 '(pound) '())) (list 'torr (make-QL 0.001315789473684210526 '(atmosphere) '())) (list 'township (make-QL 36 '(section) '())) (list 'troy_ounce (make-QL 20 '(pennyweight) '())) (list 'troy_pound (make-QL 12 '(troy_ounce) '())) (list 'volt (make-QL 1 '(joule) '(coulomb))) (list 'watt (make-QL 1 '(joule) '(second))) (list 'weber (make-QL 1 '(volt) '(second))) (list 'week (make-QL 7 '(day) '())) (list 'yard (make-QL 3 '(foot) '())) (list 'year (make-QL 365 '(day) '())) ))