17
$\begingroup$

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

$\endgroup$
3

2 Answers 2

27
$\begingroup$

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

$\endgroup$
6
  • 2
    $\begingroup$ Notice the typo: "FeetfRainfall" (reported to Support) $\endgroup$
    – paw
    Commented Sep 3, 2014 at 18:13
  • $\begingroup$ That panels make Mathematica 10 crash if pressing "panel format" in the suggestion bar. Can anybody confirm that please? $\endgroup$
    – rhermans
    Commented Sep 4, 2014 at 12:28
  • 1
    $\begingroup$ Can confirm! (Windows 7 64-bit, MMA10) $\endgroup$
    – paw
    Commented Sep 4, 2014 at 13:23
  • $\begingroup$ Thanks for the confirmation. I'm Not in front of a proper computer now, I will file a report in a few hours unless somebody else does it before me. $\endgroup$
    – rhermans
    Commented Sep 4, 2014 at 13:27
  • $\begingroup$ Do that! Funny how this answer revealed a typo and a bug. $\endgroup$
    – paw
    Commented Sep 4, 2014 at 13:30
12
$\begingroup$

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

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.