6
$\begingroup$

There are many cases in science where a quantity should end up unitless. Yet the units capabilities of Mathematica seem to have a problem with such situations. For example:

shouldBeUnitless = Quantity[1, ""]

enter image description here

UnitConvert[shouldBeUnitless]

enter image description here

It would seem that this should result in "DimensionlessUnit", similar to what is discussed in this question. Am I missing something?

My application involves user input into a dynamic interface of a wide range of compound unit types, and then determining conversion factors among them. The result I am ending up with ends up throwing in this 56.62 factor whenever the units end up cancelling. Frustrating to say the least.

$\endgroup$

2 Answers 2

7
$\begingroup$

Perhaps you can use "Unities" or "PureUnities". The unit "PureUnities" automatically gets turned into a number, while "Unities" needs a UnitConvert:

Quantity[1, "Unities"] //UnitConvert
Quantity[1, "PureUnities"]

1

1

$\endgroup$
4
$\begingroup$

I have confirmation from Wolfram Technical Support that this is a bug. Apparently Quantity[1,""] is being interpreted as the cryptocurrency "LiteCoin." They also claim that the intended method of representing dimensionless units is:

Quantity[a,1]
$\endgroup$

Your Answer

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

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