8
$\begingroup$

Why can't Mathematica 9 simplify mol/L to M, when it can simplify M*L to mol?

 Quantity["Moles" / "Liters"] // UnitSimplify
 (* => 1 mol/L *)

 Quantity["Molar" * "Liters"] // UnitSimplify
 (* => 1 mol *)

And is there a way to fix this behaviour?

$\endgroup$
  • 3
    $\begingroup$ Perhaps this is because molar is not in the base SI system and mole is? $\endgroup$ – Sjoerd C. de Vries Aug 21 '13 at 22:07
  • 1
    $\begingroup$ @Sjoerd: I'm not sure if the base vs non-base unit is the issue here. The example in the documentation is UnitSimplify[Quantity[1, ("Joules"/"Seconds")]] which yields the non-base SI Quantity[1, "Watts"]. $\endgroup$ – Simon Oct 13 '13 at 12:12
4
$\begingroup$

I can't comment on whether this functionality is by design or by omission; however, to fix this behavior, one can use UnitConvert

Quantity["Moles" / "Liters"] // UnitSimplify
UnitConvert[%,"Molar"]

(* 1 mol/L *)
(* 1 M *)
$\endgroup$
  • 2
    $\begingroup$ Also, there's no problem doing calculations like Quantity[3, "Moles"/"Liters"] - Quantity[1, "Molar"] $\endgroup$ – Jason B. Jul 22 '16 at 19:14

Your Answer

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

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