cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X

Gallons to Cubic Inches (in^3)

tvanrhein
4-Participant

Gallons to Cubic Inches (in^3)

I queried Mathcad Prime 3.0 for the number of cubic inches in a gallon and got 231.  I wondered to myself if this was an exact conversion so I increased the displayed decimal points to 15 and realized it is not exact.  I did some internet research to find where this weird number came from and found that it should be exactly 231 in^3.  Is this a mistake in Mathcad or am I missing something?  

1 ACCEPTED SOLUTION

Accepted Solutions
LucMeekes
23-Emerald III
(To:tvanrhein)

The numeric part of Mathcad already/always uses 'double precision', you cannot tell it to do less, you cannot tell it to do more.

If you want more precision, you must use the symbolics of Mathcad. But there's a downside: The symbolics don't know about units. And defining one in terms of the other will not help, since 231 is not a third power of an integer. Note that 1 foot is (defined to be exactly) 12 inches. The relation between gallons and inches is not exact, instead there, apparently, is a (defined) relation between gallons and cubic inches, your number 231...You could define 1 inch as the 3rd power root of (1gallon/231), but where does that leave 1 inch as 0.0254 metre?

Conclusion: you'll have to learn to live with finite precision, and abandon using non-international units: just use SI.

 

Success!
Luc

View solution in original post

6 REPLIES 6
LucMeekes
23-Emerald III
(To:tvanrhein)

You are overlooking the point that mathcad internally represents any physical quantity that it knows units for, using SI unit values to represent them.

So the gallon is internally represented in cubic metres, and the inch in metres (being 0.0254).

These decimal numbers cannot be represented to infinite accuracy in binary data. So you get small digitization errors, somewehere at the 15 or 16 significant digit.

 

Success!
Luc

Barrel.png

tvanrhein
4-Participant
(To:LucMeekes)

Is there a way to specify a worksheet to use double precision?  (or some higher precision?)

We can do it in Mathcad 11.

Luc, check please!

 

 

LucMeekes
23-Emerald III
(To:tvanrhein)

The numeric part of Mathcad already/always uses 'double precision', you cannot tell it to do less, you cannot tell it to do more.

If you want more precision, you must use the symbolics of Mathcad. But there's a downside: The symbolics don't know about units. And defining one in terms of the other will not help, since 231 is not a third power of an integer. Note that 1 foot is (defined to be exactly) 12 inches. The relation between gallons and inches is not exact, instead there, apparently, is a (defined) relation between gallons and cubic inches, your number 231...You could define 1 inch as the 3rd power root of (1gallon/231), but where does that leave 1 inch as 0.0254 metre?

Conclusion: you'll have to learn to live with finite precision, and abandon using non-international units: just use SI.

 

Success!
Luc

tvanrhein
4-Participant
(To:LucMeekes)

I feel like error at the 5th decimal place (8th significant digit) is too large to be binary truncation error at double precision, but I don't have time to prove it to myself right now.  So you win this round.  

 

Thank you for your help.  I appreciate your time and expertise.  

Top Tags