Re: Quantity

*To*: mathgroup at smc.vnet.net*Subject*: [mg131738] Re: Quantity*From*: Itai Seggev <itais at wolfram.com>*Date*: Thu, 26 Sep 2013 03:43:44 -0400 (EDT)*Delivered-to*: l-mathgroup@mail-archive0.wolfram.com*Delivered-to*: l-mathgroup@wolfram.com*Delivered-to*: mathgroup-outx@smc.vnet.net*Delivered-to*: mathgroup-newsendx@smc.vnet.net*References*: <20130922064741.960CC6A70@smc.vnet.net>

On Wed, Sep 25, 2013 at 02:36:25AM -0400, H. Ke=DFler wrote: > 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 gmail.com (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 o= f all units > >available could be obtained in the correct format and spelli= ng 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 specifi= c set of unit strings. Note > that doing: > > In[1]:= UnitConvert[Quantit= y[12., "Feet"], "Meters"] > > Out[1]= 3.6576 m > > returns a result essen= tially immediately. But doing > > In[2]:= UnitConvert[Quantity[12., "Foot= "], "Meters"] > > Out[2]= 3.6576 m > > returns the same result after a sm= all delay. You should see a > > brief m > essage indicating Mathematica is interpreting the units. > I believe wha= t is happening here is Mathematica is using Wolfram > Alpha to interpret th= e unit string which increases the allowable > number of unit strings signif= icantly and makes it essentially > impossible for a user to create a list o= f allowable unit strings. I'm not sure if you are complaining about or prai= sing the flexibility of input, but you can always see the canonical unit na= me by looking at the InputForm. In[3]:= Quantity[5, "Foot"]//InputForm Ou= t[3]//InputForm= Quantity[5, "Feet"] You can also turn off internet conne= ctivity in the preferences if you don't want Quantity to try to interpret u= nits for you by asking W|A. -- Itai Seggev Mathematica Algorithms R&D 217-3= 98-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 havi= ng 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. This tutotrial lists the new names of all the physical constants: Compatibility/tutorial/PhysicalConstants There was also supposed to be an equivalent tutorial for the Units` package, but it fell through the cracks for version 9. We are working on it for inclusion in version 10 (and apologize for its lack in version 9). > 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. They way to this would be the type "5 feet" into WolframAlpha, then click on the "A" button which appears when you hover over the "Input Interpretation" result. This will have a copyable plaintext version, and also the Mathematica Input version you can copy out. -- Itai Seggev Mathematica Algorithms R&D 217-398-0700

**References**:**Re: Quantity***From:*Bill Rowe <readnews@sbcglobal.net>