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$
2
  • 3
    $\begingroup$ Perhaps this is because molar is not in the base SI system and mole is? $\endgroup$ Commented Aug 21, 2013 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
    Commented Oct 13, 2013 at 12:12

1 Answer 1

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$
1
  • 2
    $\begingroup$ Also, there's no problem doing calculations like Quantity[3, "Moles"/"Liters"] - Quantity[1, "Molar"] $\endgroup$
    – Jason B.
    Commented Jul 22, 2016 at 19:14

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.