Group Abstract Group Abstract

Message Boards Message Boards

0
|
23.1K Views
|
14 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Why doesn't Quantity[] and related functions work for me?

I'm a new user of MMA ver. 10.3.0 Home Edition. I'm trying to learn how to use Units, but it's not working. For example

In[47]:= UnitConvert[Quantity[12, "Meters"/"Seconds"], "Miles"/"Hours"]

Out[47]= UnitConvert[
 QuantityUnits`Private`ToQuantity[
  QuantityUnits`Private`UnknownQuantity[12, ("Meters")/(
   "Seconds")]], ("Miles")/("Hours")]

If I load the Units` package I get the answer I seek:

In[48]:= << Units`

Convert[12  Meter/Second, Mile/Hour]

Out[49]= (37500 Mile)/(1397 Hour)

But starting with ver 9 I shouldn't have had to do that. Any ideas about what's going on?

14 Replies

Actually I see now that you were getting as a result the Private context expression -- my mistake. ;-)

My comment about not using the Needs["Units`"] package still holds, but there is something wrong with your setup which a bona fide Wolfram employee may comment on. One thing to try is to execute

RebuildPacletData[] 

as well as restart Mathematica.

Sorry for the confusion!

POSTED BY: David Reiss
POSTED BY: David Reiss

I often see this problem where units stop working but I have not been able to produce a sequence of commands to reproduce it. However, I have found this commands fixes the issue:

<<QuantityUnitsLoader`

This does not prevent the issue from hapening again in the future but at least fixes it when it happens.

POSTED BY: Gustavo Delfino
POSTED BY: David Reiss
Posted 10 years ago
POSTED BY: Dana DeLouis
Posted 10 years ago
POSTED BY: Dana DeLouis

"Any port in a storm." I'm glad it's working now!

POSTED BY: David Reiss
POSTED BY: David Reiss

That seems to have done the trick. Thanks.

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard