Message Boards Message Boards


Docs say Units change physical displacement??

Posted 9 years ago
2 Replies
2 Total Likes
Catastrophically wrong documentation? 
tutorial/SymbolicCalculationsWithUnits under Integrate section. 

There are 4 examples of "Calculate displacement over a given time.".  All 4 examples have the same physical integrand and limits, but differing units on the integration variable.  The results of 1st and 2nd example (250m) and the 3rd and 4th (25/6 m) are saying that the integrated displacement depends on the choice of units for the integration variable?????   That's dead wrong!!!  Or what am I missing (a brain)?

Here is a cut/paste from the docs:
 Calculate displacement over a given time.
 In[1]:= Integrate[Quantity[5, "Meters"/"Seconds"^2]*t, {t, Quantity[0, "Seconds"],
   Quantity[10, "Seconds"]}]
 Out[1]= Quantity[250, "Meters"]
 In this form, the variable t is explicitly declared to be measured in seconds.
In[2]:= Integrate[Quantity[5, "Meters"/"Seconds"^2]*t, {Quantity[t, "Seconds"],
  Quantity[0, "Seconds"], Quantity[10, "Seconds"]}]

Out[2]= Quantity[250, "Meters"]

Here, the variable t is explicitly declared to be measured in minutes, and the endpoints are automatically converted to the correct units.

In[3]:= Integrate[Quantity[5, "Meters"/"Seconds"^2]*t, {Quantity[t, "Minutes"],
  Quantity[0, "Seconds"], Quantity[10, "Seconds"]}]

Out[3]= Quantity[25/6, "Meters"]

In[4]:= Integrate[Quantity[5, "Meters"/"Seconds"^2]*t, {Quantity[t, "Minutes"],
  Quantity[0, "Minutes"], Quantity[1/6, "Minutes"]}]

Out[4]= Quantity[25/6, "Meters"]

Calculate displacement symbolically.

In[5]:= Integrate[Quantity[a, "Meters"/"Seconds"^2]*t, {t, Quantity[ti, "Seconds"],
  Quantity[tf, "Seconds"]}]

Out[5]= Quantity[((a tf^2)/2 - (a ti^2)/2), "Meters"]
POSTED BY: Frank Iannarilli
2 Replies
Include the Quantity wrapper around t in the integrand.
In[ ]:= Integrate[Quantity[5, "Meters"/"Seconds"^2]*Quantity[t, "Minutes"],
{Quantity[t, "Minutes"], Quantity[0, "Seconds"], Quantity[10, "Seconds"]}]
Out[ ]= Quantity[250, "Meters"]
Thanks, Christopher, that is a helpful workaround. 

Yet I'm still concerned that implementation of Quantity[], not to mention a portion of its documentation, is seriously flawed.  I've reported this to Wolfram Support. 
POSTED BY: Frank Iannarilli
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract