MathGroup Archive 2013

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Quantity

  • To: mathgroup at
  • Subject: [mg131732] Re: Quantity
  • From: H. Keßler <kessler.hannes at>
  • Date: Wed, 25 Sep 2013 02:36:25 -0400 (EDT)
  • Delivered-to:
  • Delivered-to:
  • Delivered-to:
  • Delivered-to:
  • References: <> <l1rhnn$qd5$>

Am Dienstag, 24. September 2013 10:15:51 UTC+2 schrieb Itai Seggev:
> On Sun, Sep 22, 2013 at 02:47:41AM -0400, Bill Rowe wrote: > On 9/21/13 at 4:35 AM, kessler.hannes at (H. Ke=C3=9Fler) wrote: > > >But what I am especially looking for is the list of the unit strings > >in the correct spelling for Mathematica in > >Quantity[magnitude,unitstring], not only the general overview of > >units in the NIST-website. In the old Units-package (Mathematica 8 > >and earlier) each unit was a symbol and a list of all units > >available could be obtained in the correct format and spelling by > >?Units`*. This is obviously not possible anymore as there is no > >package and all units are strings. > > There does not seem to be a specific set of unit strings. Note > that doing: > > In[1]:= UnitConvert[Quantity[12., "Feet"], "Meters"] > > Out[1]= 3.6576 m > > returns a result essentially immediately. But doing > > In[2]:= UnitConvert[Quantity[12., "Foot"], "Meters"] > > Out[2]= 3.6576 m > > returns the same result after a small delay. You should see a >
  brief m
 essage indicating Mathematica is interpreting the units. > I believe what is happening here is Mathematica is using Wolfram > Alpha to interpret the unit string which increases the allowable > number of unit strings significantly and makes it essentially > impossible for a user to create a list of allowable unit strings. I'm not sure if you are complaining about or praising the flexibility of input, but you can always see the canonical unit name by looking at the InputForm. In[3]:= Quantity[5, "Foot"]//InputForm Out[3]//InputForm= Quantity[5, "Feet"] You can also turn off internet connectivity in the preferences if you don't want Quantity to try to interpret units for you by asking W|A. -- Itai Seggev Mathematica Algorithms R&D 217-398-0700

Thank you for the tip with InputForm.

Mathematica's flexibility is of course a good feature.

In my case, however, needing the correct unit string at work without having Wolfram Alpha available, it's a bit cumbersome, to go home first, enter Quantity[5, "Foot"]//InputForm in Mathematica and retrieve the answer from Wolfram Alpha.

I tried also to ask the web interface of Wolfram Alpha directly. But there Quantity[5, "Foot"]//InputForm does not return the corresponding input form for Mathematica.

Best regards,
Hannes Kessler

  • References:
  • Prev by Date: Re: Import CSV can not understand string correctly
  • Next by Date: BitAnd[True,False]
  • Previous by thread: Re: Quantity
  • Next by thread: Re: Quantity