3
$\begingroup$

I'm using Mathematica 9.0.1. Sorry for using an image, but pasting code messed up the output formatting.

I'd like to represent 25 Btu/(hr ft F).

enter image description here

All units are spelled correctly as identified in the second attempt... not sure what is going wrong in the first attempt?

I've also tried: "DegreesFahrenheit", "DegreesFahrenheitDifference", and "BritishThermalUnitsIT".

No luck. I've seen other posts where people used the Wolfram Alpha capabilities to "interpret" which units were used... I hope I don't need internet connectivity for this simple task?

$\endgroup$
4
  • 1
    $\begingroup$ This worked in 9. Quantity[25,"BTU"]/(Quantity["Feet"]Quantity["Hour"]Quantity["Fahrenheit"]) I think the small print on this may be the line "Quantity will automatically attempt to parse an unknown unit string to its canonical form.". They key word being attempt. Some combinations of units it may give up on. $\endgroup$
    – Ymareth
    Commented Oct 31, 2013 at 18:14
  • 3
    $\begingroup$ maybe Quantity[25,"BritishThermalUnitsIT"/("Hours"*"Feet"*"DegreesFahrenheitDifference")] $\endgroup$
    – chuy
    Commented Oct 31, 2013 at 18:31
  • $\begingroup$ @Ymareth: yes that worked. I guess I'll resort to doing it that way... but it seems like it should work "cleaner" than that. Perhaps I'll make a palette of buttons with commonly used units so I don't have to type Quantity[""] each and every time. $\endgroup$
    – cjpembo
    Commented Oct 31, 2013 at 19:53
  • $\begingroup$ It's OK to paste in output, but don't do it with input, even through it's a little more work to break up the into several pieces. $\endgroup$
    – m_goldberg
    Commented Nov 1, 2013 at 1:58

1 Answer 1

3
$\begingroup$

A work-around for the OP's problem is to enter the units expression into Quantity as a single string, not as several strings separated by arithmetic operators. Thus

k = Quantity[25, "BTU/(Hour Feet Fahrenheit)"]

BTU.png

$\endgroup$
3
  • $\begingroup$ It's confusing, though, when the documentation does have examples of multiple strings... $\endgroup$
    – cormullion
    Commented Nov 2, 2013 at 22:10
  • 1
    $\begingroup$ @cormullion. Your make a good point. What's more the documentation example works! I have edited my answer to remove the assertion that OP's is due to a simple error. $\endgroup$
    – m_goldberg
    Commented Nov 2, 2013 at 22:38
  • $\begingroup$ @m_goldberg. Looks like your method might be the easiest to implement. I'm going to cross my fingers and hope that it holds up. Thanks. $\endgroup$
    – cjpembo
    Commented Nov 4, 2013 at 15:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.