Group Abstract Group Abstract

Message Boards Message Boards

5
|
10.2K Views
|
3 Replies
|
5 Total Likes
View groups...
Share
Share this post:

Recently reported issues with Quantity

POSTED BY: Daniel Lichtblau
3 Replies

This might be veering off the main subject, but referring back to David Park’s suggestion that units could be introduced at the end of an evaluation sequence, I think this has some merit. I’ve found that using units can slow down evaluation speeds massively (by up to several orders of magnitude). The slow down isn’t noticeable for trivial calculations, but becomes an issue when solving larger problems. Using QuantityArray can help. A bit. Sometimes. But, for large computations I’d consider deunitizing and reunitizing either side of the evaluation process.

POSTED BY: Ian Williams

It was pointed out that the "expected" units would be "Meters"/"Seconds".

Yes, because the D[ Length [meters], time [seconds] ] is a velocity, which of course may have the value zero (in the actual frame of coordinates), but a coordinate transformation can change this to a non-zero value. So in my opinion it must have the units of velocitiy .

POSTED BY: Hans Dolhaine

All,

As the original ranter, let me now try to describe this bug with as little ranting as possible.

Here is the entire issue in one line of code:

     Quantity[200, "Kilograms"] * 0 == D[Quantity[200, "Kilograms"], t]

I think both sides should equal "0", not "0 kg". And clearly, Mathematica should output "True" or "False". But V12 outputs:

      0 kg == 0

That is, V12 appears unable to determine if the left hand side equals the right hand side, or not!

To see this issue regarding the V12 Quantity function, consider:

 Quantity[200, "Kilograms"] * 0

Which "incorrectly" returns:

 Quantity[0, "Kilograms"]

Now notice how that the D Function (Derivative) , which can also at times, involve multiplication of a Quantity by zero behaves very differently when it generates a "product" by multiplying the exact same Quantity as above, by zero:

  D[Quantity[200, "Kilograms"], t]

Here, correctly, though inconsistently with the first example, D outputs a value without units:

 0

This is the Quantity inconsistency issue in a nutshell.

Thanks for all for the help. And good luck to the Wolfram kernel guys in crafting a fix.

  • Joe
POSTED BY: Francis Bush
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard