6

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.

Kevin Ausman
  • 2,267
  • 8
  • 16

2 Answers2

7

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

Carl Woll
  • 130,679
  • 6
  • 243
  • 355
4

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]
Kevin Ausman
  • 2,267
  • 8
  • 16