16

Is there a tutorial page that have all Mathematica units? I sometimes have hard time figuring out the correct unit spelling when using quantities

Yituo
  • 1,389
  • 9
  • 15

2 Answers2

26

This should list you all available units in Mathematica.

Needs["QuantityUnits`"]    
Keys[QuantityUnits`Private`$UnitReplacementRules]

Inspired by eldo I made a little dynamic interface:

Needs["QuantityUnits`"]
table = Keys[QuantityUnits`Private`$UnitReplacementRules];

Panel[DynamicModule[{f = ""}, Column[{Text[Style["Mathematica Unit Search:", Bold]], InputField[Dynamic[f], String, ContinuousAction -> True], Dynamic[Union@Flatten[StringCases[#, ___ ~~ f ~~ ___] & /@ table] // TableForm]}]]]

enter image description here

alexchandel
  • 155
  • 5
paw
  • 5,650
  • 23
  • 31
12

Expanding a little bit on paw's nice discovery:

Needs["QuantityUnits`"]    
table = Keys[QuantityUnits`Private`$UnitReplacementRules];

Since this table is very long one can restrict the output, f.e. with

Union @ Flatten[StringCases[#, "Feet" ~~ ___] & /@ table] // TableForm

enter image description here

UPDATE

A similar question could arise with the more than 1000 inbuilt formula names:

formulas = FormulaLookup[All];

Find all formulas including "speed":

(speed =
   Union@Flatten[
     StringCases[#, ___ ~~ "speed" ~~ ___, IgnoreCase -> True] & /@
      formulas]) // Multicolumn

enter image description here

Extract those with FormulaData:

(inter = Intersection[FormulaData[], speed]) // Multicolumn

enter image description here

TraditionalForm@
 Framed[Grid[{#, FormulaData[#]} & /@ inter,
   Dividers -> All,
   Spacings -> {{2, 2}, 3},
   Alignment -> Left,
   BaseStyle -> {FontFamily -> "Helvetica"},
   Background -> {None, {{Hue[.6, .15, .9], GrayLevel[.9]}}},
   FrameStyle -> Directive[Thick, White]
   ],
  FrameMargins -> 0.5,
  FrameStyle -> GrayLevel[.7]]

enter image description here

eldo
  • 67,911
  • 5
  • 60
  • 168