Relatively new to Mathematica so I've been playing around with it trying to learn how to use it and came across an unusual 'bug' (most likely user error). A simplified example:
eq1 = P*n /. {
P -> Quantity[P, "Kilopascals"],
n -> Quantity[n, "DimensionlessUnit"]
};
UnitConvert[eq1, "Atmospheres"]
gives "(40 n P)/4053atm." On the other hand...
eq2 = P*n/(n + 1) /. {
P -> Quantity[P, "Kilopascals"],
n -> Quantity[n, "DimensionlessUnit"]
};
UnitConvert[eq2, "Atmospheres" ]
gives two identical errors, "Quantity::unkunit: Unable to interpret unit specification {DimensionlessUnit,Kilopascals}."
Any ideas as to what's going on and/or how to fix it? Removing the line which substitutes n as a dimensionless unit seems to help in this particular example; however, I still get the same error with my more complicated equation despite the general form being the same.