2
|
6111 Views
|
|
2 Total Likes
View groups...
Share
GROUPS:

# Unit Cancelation Problem ~ Why does the syntax matter?

Posted 11 years ago
 In[1]:= Quantity["AvogadroConstant"]         Quantity["Mole"]         Quantity["AvogadroConstant"] Quantity["Mole"]         Quantity["AvogadroConstant"] Quantity["Mole"]/Quantity["Liter"]         Quantity["AvogadroConstant"] (Quantity["Mole"]/Quantity["Liter"])         Quantity["AvogadroConstant"] Quantity["Mole/Liter"]        (Quantity["AvogadroConstant"] Quantity["Mole"])/Quantity["Liter"] Out[1]= 1 Avogadro constants Out[2]= 1 molOut[3]= 6.022141 x 10^23Out[4]= 1 mol Avogadro constants / LOut[5]= 1 mol Avogadro constants / LOut[6]= 1 mol Avogadro constants / LOut[7]= 6.022141 x 10^23 / LMy question is why doesn't the output from the 4th, 5th, & 6th lines match the 7th line, specifically regarding units.  Avogadro constants and moles clearly cancel when multiplied as in line three.   Why isn't Mathematica canceling these units in the 4th, 5th, and 6th input lines?This is a simplified example of this problem, as I am trying to perform some more complicated calculations and the units are giving me this difficulty in not canceling when multiplying Molarity and Avogadro's Constant as in input line 6.
Sort By:
Posted 11 years ago
 Use UnitConvert to simplify. In some involved units it is customary to retain the individual unit parts even if they are of the same dimension. In this way you can decide for yourself what you want to collapse and what not.
Community posts can be styled and formatted using the Markdown syntax.