File: units.dat

package info (click to toggle)
convertall 0.8.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,820 kB
  • sloc: python: 2,952; makefile: 7
file content (862 lines) | stat: -rw-r--r-- 32,572 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
#*****************************************************************************
#units.dat, the units data file, version 0.7.3
#
# ConvertAll, a units conversion program
# Copyright (C) 2020, Douglas W. Bell
#
# This is free software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License, Version 2.  This program is
# distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY.
#*****************************************************************************
#
# Units are defined by an optional quantity and an equivalent unit or unit
# combination.  A Python expression may be used for the quantity, but is
# restricted to using only the following operators: *, /, +, -.
# Beware of integer division truncation: be sure to use a float for at least
# one of the values.
#
# The unit type must be placed in square brackets before a set of units.  The
# first comment after the equivalent unit will be put in parenthesis after the
# unit name (usually used to give the full name of an abbreviated unit).  The
# next comment will be used in the program list's comment column; later
# comments and full line comments are ignored.
#
# Non-linear units are indicated with an equivalent unit in square brackets,
# followed by either equations or equivalency lists for the definition.  For
# equations, two are given, separated by a ';'.  Both are functions of "x", the
# first going from the unit to the equivalent unit and the second one in
# reverse.  Any valid Python expression returning a float (including the
# functions in the math module) should work.  The equivalency list is a Python
# list of tuples giving points for linear interpolation.
#
# All units must reduce to primitive units, which are indicated by an
# equivalent unit starting with '!'.  A special "unitless" primitve unit
# (usualty called "unit") has '!!' for an equivalent unit.  Circular references
# must also be avoided.
#
# Primitive units:  kg, m, s, K, A, mol, cd, rad, sr, bit, unit
#
##############################################################################

#
# mass units
#
[mass]
kg                  = !                  # kilogram
kilogram            = kg
key                 = kg                 # # drug slang
hectogram           = 100 gram
dekagram            = 10 gram
gram                = 0.001 kg
g                   = gram               # gram
decigram            = 0.1 gram
centigram           = 0.01 gram
milligram           = 0.001 gram
mg                  = milligram          # milligram
microgram           = 0.001 mg
tonne               = 1000 kg            # # metric
metric ton          = tonne
megagram            = tonne
kilotonne           = 1000 tonne         # # metric
gigagram            = 1e9 gram
teragram            = 1e12 gram
carat               = 0.2 gram
ct                  = carat              # carat
amu                 = 1.660539066605e-27 kg  # atomic mass
atomic mass unit    = amu
dalton              = amu                # # atomic mass
Da                  = amu                # dalton # atomic mass
pound               = 0.45359237 kg      #        # avoirdupois
lb                  = pound              # pound  # avoirdupois
lbm                 = pound              # pound  # avoirdupois
ounce               = 1/16.0 pound       #        # avoirdupois
oz                  = ounce              # ounce  # avoirdupois
lid                 = ounce              #        # drug slang
dram                = 1/16.0 ounce       #        # avoirdupois
pound troy          = 5760 grain
lb troy             = pound troy         # pound troy
ounce troy          = 1/12.0 lb troy
oz troy             = ounce troy         # ounce troy
ton                 = 2000 lb            # # non-metric
kiloton             = 1000 ton           # # non-metric
long ton            = 2240 lb            # # Imperial
ton imperial        = long ton
slug                = lbf*s^2/ft
stone               = 14 lb
grain               = 1/7000.0 lb
pennyweight         = 24 grain
hundredweight long  = 112 lb             # # Imperial
hundredweight short = 100 lb             # # US & Canada
solar mass          = 1.9891e30 kg


#
# length / distance units
#
[length]
m                        = !              # meter
meter                    = m
metre                    = m
dm                       = 0.1 m          # decimeter
decimeter                = dm
cm                       = 0.01 m         # centimeter
centimeter               = cm
mm                       = 0.001 m        # millimeter
millimeter               = mm
micrometer               = 1e-6 m
micron                   = micrometer
nanometer                = 1e-9 m
nm                       = nanometer      # nanometer
dekameter                = 10 m
hectometer               = 100 m
km                       = 1000 m         # kilometer
kilometer                = km
megameter                = 1000 km
angstrom                 = 1e-10 m
fermi                    = 1e-15 m        # # nuclear sizes
inch                     = 2.54 cm
in                       = inch           # inch
inches                   = inch
mil                      = 0.001 inch
microinch                = 1e-6 inch
microinches              = microinch
foot                     = 12 inch
ft                       = foot           # foot
feet                     = foot
foot US survey           = 1200/3937.0 m
Cape foot                = 1.033 foot
yard                     = 3 ft
yd                       = yard           # yard
mile                     = 5280 ft        # # statute mile
mi                       = mile           # mile # statute mile
nautical mile            = 1852 m
nmi                      = nautical mile  # nautical mile
mile US survey           = 5280 foot US survey
league                   = 3 mile
chain                    = 66 ft
chain US survey          = 66 foot US survey
link                     = 0.01 chain
fathom                   = 6 ft
cable                    = 0.1 nautical mile
rod                      = 5.5 yard
furlong                  = 40 rod
hand                     = 4 inch
cubit                    = 21.8 inch      # # biblical unit
point                    = 1/72.0 inch    # # desktop publishing point
pica                     = 12 point
caliber                  = 1.0 inch       # # bullet sizes
rack unit                = 1.75 in        # # computing
smoot                    = 67 inch
football field           = 100 yd
marathon                 = 46145 yd
mil Swedish              = 10 km
versta                   = 3500 ft        # # Russian unit
au                       = 1.495978707e11 m   # astronomical unit
astronomical unit        = au
LD                       = 384400 km      # lunar distance # astronomical
lunar distance           = LD             # # astronomical distance
light year               = 365.25 light speed * day
light minute             = light speed * min
light second             = light speed * s
parsec                   = 648000 au/pi
kiloparsec               = 1000 parsec
megaparsec               = 1000 kiloparsec
screw size               = [in] 0.013*x + 0.06 ; (x - 0.06) / 0.013 \
                           # # Unified diameters, non-linear
AWG Dia                  = [in] pow(92.0,(36-x)/39.0)/200.0 ; \
                           36 - 39.0*log(200.0*x)/log(92.0) \
                           # American Wire Gauge \
                           # use -1, -2 for 00, 000; non-linear
American Wire Gauge Dia  = [in] pow(92.0,(36-x)/39.0)/200.0 ; \
                           36 - 39.0*log(200.0*x)/log(92.0) \
                           #  # use -1, -2 for 00, 000; non-linear
British Std Wire Gauge   = [in] [(-6, .500), (-5, .464), (-3, .400), \
                           (-2, .372), (3, .252), (6, .192), (10, .128), \
                           (14, .080), (19, .040), (23, .024), (26, .018), \
                           (28, .0148), (30, .0124), (39, .0052), \
                           (49, .0012), (50, .001)] \
                           #  # use -1, -2 for 2/0, 3/0; non-linear
standard gauge           = [in] [(-5, .448350), (1, .269010), (14, .0747250), \
                           (16, .0597800), (17, .0538020), (20, .0358680), \
                           (26, .0179340), (31, .0104615), (36, .00672525), \
                           (38, .00597800)] # steel \
                           # Manufacturers Std. Gauge, non-linear
zinc gauge               = [in] [(1, .002), (10, .02), (15, .04), (19, .06), \
                           (23, .1), (24, .125), (27, .5), (28, 1)]  \
                           # # sheet metal thickness, non-linear
ring size                = [in] 0.1018*x + 1.4216 ; (x - 1.4216) / 0.1018  \
                           # # US size, circum., non-linear
shoe size mens           = [in] x/3.0 + 7 + 1/3.0 ; (x - 7 - 1/3.0) * 3 \
                           # # US sizes, non-linear
shoe size womens         = [in] x/3.0 + 6 + 5/6.0 ; (x - 6 - 5/6.0) * 3 \
                           # # US sizes, non-linear
drill bit size           = [in] [(104,0.0031), (103,0.0035), (102,0.0039), \
                           (101,0.0043), (100,0.0047), (99,0.0051), \
                           (98,0.0055), (97,0.0059), (96,0.0063), \
                           (95,0.0067), (94,0.0071), (93,0.0075), \
                           (92,0.0079), (91,0.0083), (90,0.0087), \
                           (89,0.0091), (88,0.0095), (87,0.01), \
                           (86,0.0105), (85,0.011), (84,0.0115), \
                           (83,0.012), (82,0.0125), (81,0.013), \
                           (80,0.0135), (79,0.0145), (78,0.016), \
                           (77,0.018), (76,0.02), (75,0.021), \
                           (74,0.0225), (73,0.024), (72,0.025), \
                           (71,0.026), (70,0.028), (69,0.0292), \
                           (68,0.031), (67,0.032), (66,0.033), \
                           (65,0.035), (64,0.036), (63,0.037), \
                           (62,0.038), (61,0.039), (60,0.04), \
                           (59,0.041), (58,0.042), (57,0.043), \
                           (56,0.0465), (55,0.052), (54,0.055), \
                           (53,0.0595), (52,0.0635), (51,0.067), \
                           (50,0.07), (49,0.073), (48,0.076), \
                           (47,0.0785), (46,0.081), (45,0.082), \
                           (44,0.086), (43,0.089), (42,0.0935), \
                           (41,0.096), (40,0.098), (39,0.0995), \
                           (38,0.1015), (37,0.104), (36,0.1065), \
                           (35,0.11), (34,0.111), (33,0.113), \
                           (32,0.116), (31,0.12), (30,0.1285), \
                           (29,0.136), (28,0.1405), (27,0.144), \
                           (26,0.147), (25,0.1495), (24,0.152), \
                           (23,0.154), (22,0.157), (21,0.159), \
                           (20,0.161), (19,0.166), (18,0.1695), \
                           (17,0.173), (16,0.177), (15,0.18), \
                           (14,0.182), (13,0.185), (12,0.189), \
                           (11,0.191), (10,0.1935), (9,0.196), \
                           (8,0.199), (7,0.201), (6,0.204), \
                           (5,0.2055), (4,0.209), (3,0.213), \
                           (2,0.221), (1,0.228)] \
                           # # American drill bit gauge, non-linear


#
# time units
#
[time]
s             = !                 # second
sec           = s                 # second
second        = s
ms            = 0.001 s           # millisecond
millisecond   = ms
microsecond   = 1e-6 s
ns            = 1e-9 s            # nanosecond
nanosecond    = ns
minute        = 60 s
min           = minute            # minute
hour          = 60 min
hr            = hour              # hour
bell          = 30 min            #  # naval definition
watch         = 4 hour
watches       = watch
day           = 24 hr
week          = 7 day
wk            = week              # week
fortnight     = 14 day
month         = 1/12.0 year
year          = 365.242198781 day
yr            = year              # year
calendar year = 365 day
decade        = 10 year
century       = 100 year
centuries     = century
millennium    = 1000 year
millennia     = millennium
[scheduling]
man hour      = 168/40.0 hour
man week      = 40 man hour
man month     = 1/12.0 man year
man year      = 52 man week


#
# temperature
#
[temperature]
K                 = !     # Kelvin
Kelvin            = K
deg K             = K     # Kelvin
degree Kelvin     = K

C                 = [K] x + 273.15 ; x - 273.15  # Celsius  # non-linear
Celsius           = [K] x + 273.15 ; x - 273.15  #          # non-linear
deg C             = [K] x + 273.15 ; x - 273.15  # Celsius  # non-linear
degree Celsius    = [K] x + 273.15 ; x - 273.15  #          # non-linear

R                 = 5/9.0 K     # Rankine
Rankine           = R
deg R             = R           # Rankine
F                 = [R] x + 459.67 ; x - 459.67  # Fahrenheit  # non-linear
Fahrenheit        = [R] x + 459.67 ; x - 459.67  #             # non-linear
deg F             = [R] x + 459.67 ; x - 459.67  # Fahrenheit  # non-linear
degree Fahrenheit = [R] x + 459.67 ; x - 459.67  #             # non-linear

[temp. diff.]
C deg             = K        # Celsius degree
Celsius degree    = C deg
F deg             = R        # Fahrenheit deg.
Fahrenheit degree = F deg


#
# electrical units
#
[current]
A              = !              # ampere
ampere         = A
amp            = A
milliampere    = 0.001 A
milliamp       = milliampere
mA             = milliampere    # milliampere
microampere    = 0.001 mA
kiloampere     = 1000 A
kA             = kiloampere     # kiloampere
[charge]
coulomb        = A*s
amp hour       = A*hr
mAh            = 0.001 amp hour # milliamp hour
milliamp hour  = mAh
[potential]
volt           = W/A
V              = volt           # volt
millivolt      = 0.001 volt
mV             = millivolt      # millivolt
kilovolt       = 1000 volt
kV             = kilovolt       # kilovolt
[resistance]
ohm            = V/A
milliohm       = 0.001 ohm
microhm        = 0.001 milliohm
kilohm         = 1000 ohm
[conductance]
siemens        = A/V
[capacitance]
farad          = coulomb/V
millifarad     = 0.001 farad
microfarad     = 0.001 millifarad
nanofarad      = 1e-9 farad
picofarad      = 1e-12 farad
[magn. flux]
weber          = V*s
Wb             = weber          # weber
maxwell        = 1e-8 Wb
[inductance]
henry          = Wb/A
H              = henry          # henry
millihenry     = 0.001 henry
mH             = millihenry     # millihenry
microhenry     = 0.001 mH
[flux density]
tesla          = Wb/m^2
T              = tesla          # tesla
gauss          = maxwell/cm^2


#
# molecular units
#
[molecular qty]
mol          = !           # mole       # gram mole
mole         = mol         #            # gram mole
gram mole    = mol
kilomole     = 1000 mol
kmol         = kilomole    # kilomole
pound mole   = mol*lbm/gram
lbmol        = pound mole  # pound mole
[size of a mol]
avogadro     = gram/(amu*mol)


#
# Illumination units
#
[lum. intens.]
cd          = !          # candela
candela     = cd

[luminous flux]
lumen        = cd * sr
lm           = lumen     # lumen

[illuminance]
lux          = lumen/m^2
footcandle   = lumen/ft^2
metercandle  = lumen/m^2

[luminance]
lambert      = cd/(pi*cm^2)
millilambert = 0.001 lambert
footlambert  = cd/(pi*ft^2)


#
# angular units
#
[angle]
radian      = !
rad         = radian         # radian
circle      = 2 pi*radian
turn        = circle
revolution  = circle
rev         = revolution     # revolution
degree      = 1/360.0 circle
deg         = degree         # degree
arc min     = 1/60.0 degree  # minute
arc minute  = arc min
min arc     = arc min        # minute
minute arc  = arc min
arc sec     = 1/60.0 arc min # second
arc second  = arc sec
sec arc     = arc sec        # second
second arc  = arc sec
quadrant    = 1/4.0 circle
right angle = quadrant
gradian     = 0.01 quadrant


#
# solid angle units
#
[solid angle]
sr         = !      # steradian
steradian  = sr
sphere     = 4 pi*sr
hemisphere = 1/2.0 sphere


#
# information units
#
[data]
bit              = !
kilobit          = 1000 bit          #                  # based on power of 10
megabit          = 1000 kilobit      #                  # based on power of 10
gigabit          = 1000 megabit      #                  # based on power of 10
terabit          = 1000 gigabit      #                  # based on power of 10
byte             = 8 bit
B                = byte              # byte
kilobyte         = 1024 byte         #                  # based on power of 2
kB               = kilobyte          # kilobyte         # based on power of 2
megabyte         = 1024 kB           #                  # based on power of 2
MB               = megabyte          # megabyte         # based on power of 2
gigabyte         = 1024 MB           #                  # based on power of 2
GB               = gigabyte          # gigabyte         # based on power of 2
terabyte         = 1024 GB           #                  # based on power of 2
TB               = terabyte          # terabyte         # based on power of 2
petabyte         = 1024 TB           #                  # based on power of 2
PB               = petabyte          # petabyte         # based on power of 2

kilobyte SI std  = 1000 byte         #                  # based on power of 10
kB SI std        = kilobyte SI std   # kilobyte         # based on power of 10
megabyte SI std  = 1000 kB SI std    #                  # based on power of 10
MB SI std        = megabyte SI std   # megabyte         # based on power of 10
gigabyte SI std  = 1000 MB SI std    #                  # based on power of 10
GB SI std        = gigabyte SI std   # gigabyte         # based on power of 10
terabyte SI std  = 1000 GB SI std    #                  # based on power of 10
TB SI std        = terabyte SI std   # terabyte         # based on power of 10
petabyte SI std  = 1000 TB SI std    #                  # based on power of 10
PB SI std        = petabyte SI std   # petabyte         # based on power of 10

kibibyte         = 1024 byte
KiB              = kibibyte          # kibibyte
mebibyte         = 1024 KiB
MiB              = mebibyte          # mebibyte
gibibyte         = 1024 MiB
GiB              = gibibyte          # gibibyte
tebibyte         = 1024 GiB
TiB              = tebibyte          # tebibyte
pebibyte         = 1024 TiB
PiB              = pebibyte          # pebibyte

[data transfer]
bps              = bit/sec           # bits / second
kbps             = 1000 bps          # kilobits / sec.  # based on power of 10


#
# Unitless numbers
#
[quantity]
unit               = !!
1                  = unit            # unit
pi                 = 3.14159265358979323846 unit
pair               = 2 unit
hat trick          = 3 unit          # # sports
dozen              = 12 unit
doz                = dozen           # dozen
bakers dozen       = 13 unit
score              = 20 unit
gross              = 144 unit
great gross        = 12 gross
ream               = 500 unit
percent            = 0.01 unit
%                  = percent
mill               = 0.001 unit
[interest rate]
APR                = [unit] log(1 + x/100) ;  (exp(x) - 1)*100 \
                     # annual % rate # based on continuous compounding
[concentration]
proof              = 1/200.0 unit    # # alcohol content
ppm                = 1e-6 unit       # parts per million
parts per million  = ppm
ppb                = 1e-9 unit       # parts per billion
parts per billion  = ppb
ppt                = 1e-12 unit      # parts per trillion
parts per trillion = ppt
karat              = 1/24.0 unit     # # gold purity
carat gold         = karat           # # gold purity


#
# force units
#
[force]
newton         = kg*m/s^2
N              = newton           # newton
dekanewton     = 10 newton
kilonewton     = 1000 N
kN             = kilonewton       # kilonewton
meganewton     = 1000 kN
millinewton    = 0.001 N
dyne           = cm*g/s^2
kg force       = kg * gravity     # kilogram f
kgf            = kg force         # kilogram force
kilogram force = kg force
kp             = kg force         # kilopond
kilopond       = kg force
gram force     = g * gravity
pound force    = lbm * gravity    #              # avoirdupois
lbf            = pound force      # pound force  # avoirdupois
ton force      = ton * gravity
ounce force    = ounce * gravity
ozf            = ounce force      # ounce force
tonne force    = tonne * gravity  # # metric
pdl            = lbm * ft / sec^2 # poundal # Imperial force
poundal        = pdl              # # Imperial force


#
# area units
#
[area]
barn                     = 1e-28 m^2       # # particle physics
are                      = 100 m^2
decare                   = 10 are
dekare                   = 10 are
hectare                  = 100 are
stremma                  = 1000 m^2
acre                     = 10 chain^2
section                  = mile^2
township                 = 36 section
homestead                = 160 acre
square perch             = 30.25 yd^2
rood                     = 0.25 acre
rai                      = 1600 m^2        # # Thai
ngaan                    = 400 m^2         # # Thai
circular inch            = 1/4.0 pi*in^2   # # area of 1 inch circle
circular mil             = 1/4.0 pi*mil^2  # # area of 1 mil circle
AWG Area                 = [in^2] pi/4*pow(pow(92.0,(36-x)/39.0)/200.0,2) ; \
                           36 - 39.0*log(200.0*sqrt(x*4.0/pi))/log(92.0) \
                           # American Wire Gauge \
                           # use -1, -2 for 00, 000; non-linear
American Wire Gauge Area = [in^2] pi/4*pow(pow(92.0,(36-x)/39.0)/200.0,2) ; \
                           36 - 39.0*log(200.0*sqrt(x*4.0/pi))/log(92.0) \
                           #  # use -1, -2 for 00, 000; non-linear


#
# volume units
#
[volume]
cc                   = cm^3                 # cubic centimeter
cubic centimeter     = cc
liter                = 1000 cc
l                    = liter                # liter
litre                = liter
deciliter            = 0.1 liter
centiliter           = 0.01 liter
milliliter           = cc
ml                   = milliliter           # milliliter
microliter           = 1e-6 liter
dekaliter            = 10 liter
hectoliter           = 100 liter
kiloliter            = 1000 liter
kl                   = kiloliter            # kiloliter
megaliter            = 1000 kiloliter
gallon               = 231 in^3             #             # US liquid
gal                  = gallon               # gallon      # US liquid
quart                = 1/4.0 gallon         #             # US liquid
qt                   = quart                # quart       # US liquid
pint                 = 1/2.0 quart          #             # US liquid
pt                   = pint                 # pint        # US liquid
fluid ounce          = 1/16.0 pint          #             # US
fl oz                = fluid ounce          # fluid ounce # US
ounce fluid          = fluid ounce          #             # US
fluid dram           = 1/8.0 fluid ounce    #             # US
minim                = 1/480.0 fluid ounce  #             # US
imperial gallon      = 4.54609 liter
imp gal              = imperial gallon      # imperial gallon
gallon imperial      = imperial gallon
imperial quart       = 1/4.0 imp gal
imp qt               = imperial quart       # imperial quart
quart imperial       = imperial quart
imperial pint        = 1/8.0 imp gal
imp pt               = imperial pint        # imperial pint
pint imperial        = imperial pint
imperial fluid ounce = 1/160.0 imp gal
imp fl oz            = imperial fluid ounce # imperial fluid ounce
imperial fluid dram  = 1/8.0 imp fl oz
imperial minim       = 1/480.0 imp fl oz
cup                  = 8 fl oz
tablespoon           = 1/16.0 cup
tbsp                 = tablespoon           # tablespoon
teaspoon             = 1/3.0 tbsp
tsp                  = teaspoon             # teaspoon
barrel               = 42 gallon
bbl                  = barrel               # barrel
shot                 = 1.5 fl oz
fifth                = 1/5.0 gallon         #             # alcohol
wine bottle          = 750 ml
magnum               = 1.5 liter            #             # alcohol
keg                  = 15.5 gallon          #             # beer
hogshead wine        = 63 gal
hogshead beer        = 54 gal
bushel               = 2150.42 in^3
peck                 = 1/4.0 bushel
cord                 = 128 ft^3
board foot           = ft^2*in
board feet           = board foot


#
# velocity units
#
[velocity]
knot          = nmi/hr
kt            = knot             # knot
light speed   = 2.99792458e8 m/s
mph           = mi/hr            # miles/hour
kph           = km/hr            # kilometers/hour
mach          = 340.29 m/s       # # speed sound at STP
Beaufort wind = [m/s] 0.836 * x**1.5 ; (x / 0.836)**(2/3) \
                # # wind speed, non-linear
[rot. velocity]
rpm           = rev/min          # rev/min
rps           = rev/sec          # rev/sec


#
# flow rate units
#
[fluid flow]
gph         = gal/hr           # gallons/hour
gpm         = gal/min          # gallons/minute
cfs         = ft^3/sec         # cu ft/second
cfm         = ft^3/min         # cu ft/minute
lpm         = l/min            # liter/min
[gas flow]
sccm        = atm*cc/min       # std cc/min      # pressure * flow
sccs        = atm*cc/sec       # std cc/sec      # pressure * flow
slpm        = atm*l/min        # std liter/min   # pressure * flow
slph        = atm*l/hr         # std liter/hour  # pressure * flow
scfh        = atm*ft^3/hour    # std cu ft/hour  # pressure * flow
scfm        = atm*ft^3/min     # std cu ft/min   # pressure * flow


#
# pressure units
#
[pressure]
Pa                    = N/m^2                    # pascal
pascal                = Pa
hPa                   = 100 Pa                   # hectopascal
hectopascal           = hPa
kPa                   = 1000 Pa                  # kilopascal
kilopascal            = kPa
MPa                   = 1000 kPa                 # megapascal
megapascal            = MPa
GPa                   = 1000 MPa                 # gigapascal
gigapascal            = GPa
atm                   = 101325 Pa                # atmosphere
atmosphere            = atm
bar                   = 1e5 Pa
mbar                  = 0.001 bar                # millibar
millibar              = mbar
microbar              = 0.001 mbar
decibar               = 0.1 bar
kilobar               = 1000 bar
megabar               = 1000 kilobar
mm Hg                 = mm*density Hg*gravity
millimeter of Hg      = mm Hg
torr                  = mm Hg
micron of Hg          = micron*density Hg*gravity
in Hg                 = in*density Hg*gravity    # inch of Hg
inch of Hg            = in Hg
m water               = m*density water*gravity  # meter of H2O # fresh water
m H2O                 = m water                  # meter of H2O # fresh water
meter of water        = m water                  #              # fresh water
in water              = in*density water*gravity # inch of H2O  # fresh water
in H2O                = in water                 # inch of H2O  # fresh water
inch of water         = in water                 #              # fresh water
ft water              = ft*density water*gravity # feet of H2O  # fresh water
ft H2O                = ft water                 # feet of H20  # fresh water
feet of water         = ft water                 #              # fresh water
foot of head          = ft water                 #              # fresh water
ft hd                 = ft water                 # foot of head # fresh water
psi                   = lbf/in^2                 # pound / sq inch
pound per sq inch     = psi
ksi                   = 1000 psi                 # 1000 lb / sq inch


#
# density units
#
[density]
density water         = gram/cm^3
density sea water     = 1.025 gram/cm^3
density Hg            = 13.5950981 gram/cm^3
density air           = 1.293 kg/m^3          # # at STP
density steel         = 0.283 lb/in^3         # # carbon steel
density aluminum      = 0.098 lb/in^3
density zinc          = 0.230 lb/in^3
density brass         = 0.310 lb/in^3         # # 80Cu-20Zn
density copper        = 0.295 lb/in^3
density iron          = 0.260 lb/in^3         # # cast iron
density nickel        = 0.308 lb/in^3
density tin           = 0.275 lb/in^3
density titanium      = 0.170 lb/in^3
density silver        = 0.379 lb/in^3
density nylon         = 0.045 lb/in^3
density polycarbonate = 0.045 lb/in^3


#
# energy units
#
[energy]
joule                 = N*m
J                     = joule             # joule
kilojoule             = 1000 joule
kJ                    = kilojoule         # kilojoule
megajoule             = 1000 kilojoule
gigajoule             = 1000 megajoule
millijoule            = 0.001 joule
mJ                    = millijoule        # millijoule
calorie               = 4.1868 J
cal                   = calorie           # calorie
kilocalorie           = 1000 cal
kcal                  = kilocalorie       # kilocalorie
calorie food          = kilocalorie
thermie               = 1000 kcal
Btu                   = cal*lb*R/(g*K)    # British thermal unit
British thermal unit  = Btu
therm                 = 100000 Btu
erg                   = cm*dyne
electronvolt          = 1.602176634e-19 J
eV                    = electronvolt      # electronvolt
Ry                    = 2.179872361103542e-18 J # Rydberg unit
Rydberg unit          = Ry
hartree               = 2 Ry
kWh                   = kW*hour           # kilowatt-hour
kilowatt hour         = kWh
ton TNT               = 4.184e9 J
tonne oil equivalent  = 41.868 gigajoule
tonne coal equivalent = 7000000 kcal


#
# power units
#
[power]
watt              = J/s
W                 = watt            # watt
kilowatt          = 1000 W
kW                = kilowatt        # kilowatt
megawatt          = 1000 kW
MW                = megawatt        # megawatt
gigawatt          = 1000 MW
GW                = gigawatt        # gigawatt
milliwatt         = 0.001 W
horsepower        = 550 ft*lbf/sec
hp                = horsepower      # horsepower
metric horsepower = 75 kgf*m/s
ton refrigeration = 12000 Btu/hr
MBH               = 1000 Btu/hr     # 1000 Btu/hr
boiler horsepower = 33475 Btu/hr


#
# frequency
#
[frequency]
hertz       = unit/sec
Hz          = hertz      # hertz
millihertz  = 0.001 Hz
kilohertz   = 1000 Hz
kHz         = kilohertz  # kilohertz
megahertz   = 1000 kHz
MHz         = megahertz  # megahertz
gigahertz   = 1000 MHz
GHz         = gigahertz  # gigahertz


#
# radioactivity
#
[radioactivity]
becquerel       = unit/sec
Bq              = becquerel     # becquerel
curie           = 3.7e10 Bq
millicurie      = 0.001 curie
roentgen        = 2.58e-4 coulomb/kg
[radiation dose]
gray            = J/kg
Gy              = gray          # gray
centigray       = 0.01 Gy
rad. abs. dose  = 0.01 Gy       # # commonly rad
sievert         = J/kg          # # equiv. dose
millisievert    = 0.001 sievert # # equiv. dose
Sv              = sievert       # sievert # equiv. dose
rem             = 0.01 Sv       # # roentgen equiv mammal
millirem        = 0.001 rem     # # roentgen equiv mammal


#
# viscosity
#
[dyn viscosity]
poise        = g/(cm*s)
P            = poise       # poise
centipoise   = 0.01 poise
cP           = centipoise  # centipoise

[kin viscosity]
stokes       = cm^2/s
St           = stokes      # stokes
centistokes  = 0.01 stokes
cSt          = centistokes # centistokes


#
# misc. units
#
[acceleration]
gravity                = 9.80665 m/s^2
galileo                = cm/s^2
[constant]
gravity constant       = 6.673e-11 N*m^2/kg^2
gas constant           = 8.314472 J/(mol*K)   # R
Planck constant        = 6.62607015e-34 J*s
[fuel consumpt.]
mpg                    = mi/gal               # miles/gallon
mpg imp                = mi/gallon imperial   # miles/gallon imp
liter per 100 km       = [mpg] 3.785411784 / (x * 0.01609344) ; \
                         3.785411784 / (x * 0.01609344) # # non-linear
[optical power]
diopter                = m^-1                 # # American spelling
dioptre                = diopter              # # British spelling
[permeability]
darcy                  = 1 cm^2*centipoise/atm/s
millidarcy             = 0.001 darcy
[thermal resistance]
Rvalue                 = R*ft^2*hr/Btu
RSI                    = K*m^2/W              # R-value SI
Rvalue SI              = RSI