I am trying to use the units capabilities of Mathematica throughout a course that I am teaching, but am finding that it isn't uniformly implemented across many functions. In particular, I would love to be able to do the following:

p = (R T ρ)/M;
pressures = Quantity[{12.223, 25.20, 36.97, 60.37, 85.23, 101.3}, "kPa"];
massdensities = 
  Quantity[{0.225, 0.456, 0.664, 1.062, 1.468, 1.734}, "kg per (m m m)"];
data = {massdensities, pressures}\[Transpose];
R = Quantity["MolarGasConstant"];
T = Quantity[25 + 273.15, "Kelvins"];

FindFit[data, p, M, ρ]

Unfortunately, FindFit seems to require that everything be unitless. Am I missing something?

  • 3
    $\begingroup$ No, unit functionality isn't yet implemented in FindFit $\endgroup$ – ilian Jan 10 '18 at 3:21
  • $\begingroup$ Thank you. It's a shame, as the units functionality is quite useful, and yet my students and I are repeatedly coming across cases where we have to strip the units in order to do something, and it often takes quite some time to track down to it being the units that are the problem. $\endgroup$ – Kevin Ausman Jan 15 '18 at 23:31
  • $\begingroup$ Help > Give feedback brings you to: wolfram.com/support/contact/email $\endgroup$ – rhermans Jul 9 '18 at 22:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.