Questions tagged [units]

Questions about using, converting, or interpreting units of measurement in Mathematica.

Useful Links:

Prior to version 9, functionality for handling units was not built into Mathematica, but was available as an add-on package: Units

307 questions
40
votes
4 answers

Are Mathematica 9 and 10 units really slow?

This generates 75 unitized pairs for a plot that displays physical units: x = UnitConvert@Quantity["PlanckConstant" "SpeedOfLight" / "BoltzmannConstant"] x1 = UnitConvert@Quantity[2,"PlanckConstant" ("SpeedOfLight")^2] B[L_,T_]:= (L^-5) /(Exp[x/(L…
geraldcecil
  • 551
  • 4
  • 8
39
votes
8 answers

Simpler input for the new unit support

I've been playing with the new unit support in Mathematica 9. It seems very useful, but the syntax is very verbose. Instead of typing: UnitConvert[Quantity[1, "Meters"/"Seconds"^2]*Quantity[1, "Minutes"]^2, "Kilometers"] I would much rather type…
Niki Estner
  • 36,101
  • 3
  • 92
  • 152
36
votes
3 answers

Built-in unit strings recognized by Quantity?

It’s great that Quantity can utilize Wolfram Alpha to interpret unit strings that it doesn’t recognize, but I need my code to work on machines that do not have Internet access. Is there a complete list of built-in (i.e. canonical) unit strings…
SWB
  • 625
  • 4
  • 8
20
votes
1 answer

Is there a "No Units" (i.e., dimensionless) unit?

I would like to be able to call the Quantity function with a null unit so that it returns the original dimensionless value. For example, Quantity[3.0,"NoUnits"] would return 3.0. Is there a dimensionless unit?
Cassini
  • 5,556
  • 5
  • 28
  • 38
18
votes
5 answers

Implementing CGS unit system in Mathematica 9

So I've just installed the trial version of Mathematica 9. The first noticeable feature for me is the new built-in physical units. I used AutomaticUnits package before; it was almost perfect except that its units aren't usable inside many other…
swish
  • 7,881
  • 26
  • 48
17
votes
4 answers

How to dequantify units in mathematica?

Is there a function which applied to a quantity returns its numerical value so I for instance can fill it into my Predictorfunction?
TetstName123
  • 977
  • 7
  • 14
16
votes
2 answers

Where to see all Mathematica units

Is there a tutorial page that have all Mathematica units? I sometimes have hard time figuring out the correct unit spelling when using quantities
Yituo
  • 1,389
  • 9
  • 15
15
votes
1 answer

Unexpected behavior of UnitConvert

When I evaluate this expression: UnitConvert[Quantity[1920*1080, "Bytes"]*Quantity[24, "1/Seconds"] + Quantity[44, "Kilohertz"]*Quantity[16, "Bits"], Quantity["Megabytes"/"Seconds"]] I get an error message: UnitConvert::unkunit: Unable…
Niki Estner
  • 36,101
  • 3
  • 92
  • 152
14
votes
3 answers

Dimensionless units like Percent are not treated consistently by functions like Exp or Log. How can pitfalls be avoided?

There are so many false calculations out there that working with Quantity und units—at least initially—should be mandatory in many applications. Alas, implementation in the Wolfram Language sometimes seems to be in the way. I will give a simple…
gwr
  • 13,452
  • 2
  • 47
  • 78
12
votes
2 answers

Is it reasonable to have both TemperatureUnit and TemperatureDifferenceUnit?

When adding the bugs header to the question "Kelvin per Kelvin Difference" I was confused by the fact that I cannot determine for sure whether the described bug is fixed in version 10.2 or not: from the one hand the code in the question now produces…
Alexey Popkov
  • 61,809
  • 7
  • 149
  • 368
12
votes
0 answers

Differences of Quantities gives different result in different Mathematica version

In Mathematica 12.2 Differences[{Quantity[1, "mm"], Quantity[1, "mm"]}] gives {Quantity[0, "Millimeters"]} In Mathematica 13.1, same expression gives {0} with no unit! This introduces inconsistency. For example StandardDeviation@ …
matheorem
  • 17,132
  • 8
  • 45
  • 115
10
votes
1 answer

Mathematica seems confused about Kilograms vs KilogramsForce

This does what I expect: Quantity["Kilograms"*"Meters"] // InputForm Quantity[1, "Kilograms"*"Meters"] This, on the other hand, bungles the units: Quantity[1, "Kilograms*Meters"] // InputForm Quantity[1, "KilogramsForce"*"Meters"] Note that…
Roman
  • 47,322
  • 2
  • 55
  • 121
10
votes
2 answers

Why does using different units but same physical value give different result?

I'm trying to define a variable with the value of the thermal constant $V_T$. The value of the thermal constant is given in Volts as $V_T = \frac{k T}{q}$, where $k$ is the Boltzmann constant and $q$ is the charge on an electron. Why am I getting…
sgdsgyhetwaraw
  • 489
  • 2
  • 9
10
votes
1 answer

Where is the unit after a calculation?

I was playing with some of the new features, and when I type e.g. Quantity[10, "ml"] + Quantity[250 - 100, "ml"] I get 160 mL as expected. But when I want to solve the following equation Solve[Quantity[x, "ml"] Quantity[5, "mol"] + Quantity[250 -…
Mockup Dungeon
  • 1,854
  • 12
  • 16
9
votes
2 answers

Physical (and other) constants

As Mathematica documentation likes to say, "As of Version 9.0, physical constant functionality is built into the Wolfram Language". After clicking on the ">>", one gets Units main help page. But there is no mention of physical (or any other for that…
atapaka
  • 3,954
  • 13
  • 33
1
2 3 4 5 6