Questions tagged [units]
Questions about using, converting, or interpreting units of measurement in Mathematica.
309
questions
40
votes
4
answers
3k
views
Are Mathematica 9 and 10 units really slow?
This generates 75 unitized pairs for a plot that displays physical units:
...
39
votes
8
answers
4k
views
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:
...
36
votes
3
answers
2k
views
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 ...
33
votes
3
answers
810
views
Speed of curated data calls in Version 10
Curated datasets underwent a significant overhaul in version 10, primarily in the way content is delivered in the form of Objects and Entities. Additionally, it appears that this change in content ...
31
votes
2
answers
4k
views
Unit Discovery: Is this some sort of a sick joke?
Alright, let's have some fun here. I am essentially following the documentation by Wolfram, just looking at different quantities.
...
29
votes
2
answers
689
views
Should 0 * 5ft be 0 or 0ft?
After playing with the new quantity system in Mathematica 9 for a while, I keep stumbling over this issue:
0 * Quantity[1, "Meters"]
is not the same as
...
20
votes
1
answer
4k
views
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,
...
20
votes
3
answers
2k
views
Kelvin per Kelvin Difference
Bug introduced in 9 and partially persists through 10.2 or later
The specific bug described in the original question is fixed ("Kelvin" is correctly recognized as <...
18
votes
5
answers
2k
views
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 ...
17
votes
2
answers
2k
views
Where to see all Mathematica units [duplicate]
Is there a tutorial page that have all Mathematica units? I sometimes have hard time figuring out the correct unit spelling when using quantities
17
votes
4
answers
8k
views
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?
16
votes
2
answers
8k
views
Numerical value of physical constants Mathematica 10
Is there a way to use the physical constants in calculations and have Mathematica 10 figure out the final unit and numerical magnitude?
When I try
...
16
votes
3
answers
1k
views
How to convert between various ItemSize/ImageSize units?
How can one convert between the implicit units used by Grid (ems and line height for horizontal and vertical dimensions) and printers points (in ...
15
votes
1
answer
649
views
Unexpected behavior of UnitConvert
When I evaluate this expression:
...
15
votes
1
answer
681
views
Why is this evaluation halved when adding units?
Bug introduced in 9.0 or earlier and persisting through 11.2 or later
Why does this strange behavior occur when dealing with units and quantities?
...
14
votes
3
answers
692
views
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, ...
14
votes
4
answers
1k
views
Automatically add appropriate prefix to Quantity
Is there a function that automatically adds the appropriate prefix to a Quantity object?
For example, I would like a function
...
14
votes
1
answer
388
views
How to have the units for energy show as kW h instead of h kW?
I observe the following in Wolfram Language:
Quantity[ 1, "Kilowatt hours" ] (* or "Kilowatts" * "Hours" *)
(* 1 h kW *)
That looks ...
13
votes
1
answer
352
views
Possible bug: Quantity[2,"meters"] returns 2 None meters
Bug introduced in version 10 or earlier and fixed in version 10.0.2
I'm using 10.0 for Linux.
Trial 1:
Quantity[2,"meters"]
2 None meters
Trial 2:
...
13
votes
1
answer
390
views
Is Quantity necessary?
Soft question: are Quantity - and newly added MixedUnit and MixedMagnitude - needed in a ...
12
votes
1
answer
554
views
How do I seamlessly migrate from the older Units package to Mathematica 9's Quantity objects?
I have several notebooks that make use of the Units package and would like to be able to work simultaneously with the older units and ...
12
votes
2
answers
599
views
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 ...
12
votes
1
answer
138
views
Display bug in Dataset's UnitConvert handling
Bug introduced in 11.0.1 or earlier and fixed in 11.1.0
Is this yet another annoying regression in v11 Dataset type handling? The display form seems to be a ...
12
votes
0
answers
108
views
Differences of Quantities gives different result in different Mathematica version
In Mathematica 12.2
Differences[{Quantity[1, "mm"], Quantity[1, "mm"]}]
gives
...
11
votes
1
answer
257
views
How can I get curated data to be expressed consistently in SI units?
AstronomicalData objects are consistently in SI units:
...
11
votes
4
answers
375
views
How to prevent Quantity calculations from converting units
I have an accrual calculation that I would like to preserve the units even though they are of the same dimension (e.g. time). For example, I would like the following
...
10
votes
1
answer
321
views
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
...
10
votes
2
answers
1k
views
Why do I get QuantityUnits`Private`ToQuantity when trying to use units?
I'm unable to use units in mathematica (10.3.1) When I do
Quantity[500, "Feet"] + Quantity[50, "Meters"]
the answer I get is
...
10
votes
1
answer
722
views
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:
...
10
votes
2
answers
269
views
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$ ...
9
votes
3
answers
678
views
Convert units to String
Is there a way to convert compound units to string?
For example, I have "Newtons"/"Meters"^2, how to I convert it to "N/m^2"?
I know If I do the following
...
9
votes
1
answer
442
views
Change units in PlanetData["Earth", "Diameter"] from miles to km
When I enter
AstronomicalData["Earth", "Radius"]
I get Quantity[6.3674447*10^6, "Meters"]
I would have preferred kilometers, ...
9
votes
2
answers
1k
views
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 ...
9
votes
1
answer
163
views
Why does the front-end no longer like MixedRadix as an argument for UnitConvert?
I often find MixedRadix very useful for make certain kinds of unit conversions. For example,
...
9
votes
2
answers
140
views
Can Quantity interpretation be accepted using the keyboard?
Entering Ctrl+= on selected text results in the display of an interpreted Quantity, with the option to accept it, or choose other interpretations. The only way I ...
8
votes
2
answers
2k
views
Conversion between GB and MB (and KB)
UnitConvert[Quantity[1, "GB"], "MB"]
Quantity[1000, "Megabytes"]
Which is NOT something we would normally expect.
Is this a bug?
How can I use 1024MB =...
8
votes
5
answers
566
views
Mathematica function which formats Physics calculation
One small step toward automating homework :)
My lecturer doesn't accept calculations done in Mathematica code as homework. I have 30 pages of small calculations such as the one below. I don't want to ...
8
votes
3
answers
499
views
How to "factor out" units?
I have a huge expression that makes use of Mathematica's units support (Quantity[]) that I know evaluates to a dimensionless quantity. However, I'm unable to get <...
8
votes
3
answers
6k
views
Why are Dalton and Grams / Moles not equivalent units?
The following code throws an error:
UnitConvert[Quantity["Daltons"], "Grams"/"Moles"]
Why?
8
votes
1
answer
794
views
Using physical dimensions in Mathematica DSolve
I would like to calculate a system of two differential equations in Mathematica using DSolve, like:
...
8
votes
1
answer
8k
views
Convert radian to degree and add °
How can I convert a radian angle to a degree one and add ° after it?
I am using N[(Pi/4)/Degree], but the output is 45. with ...
8
votes
2
answers
543
views
Getting useful units for combinations of physical constants like on WolframAlpha?
When I need to do order of magnitude estimates, I often encounter situations where I have a mess of physical constants and difficulty putting them in sensible units.
For example, consider the ...
8
votes
1
answer
518
views
Working with degrees minutes and seconds without conversion
Is there a way to work with angles in DMS without converting them to decimal degrees, that is to sum them, subtract them?
I do not know how to even enter it without using string. My idea is something ...
8
votes
4
answers
1k
views
Suppress connection to Wolfram|Alpha when making unit conversions
I want to speed up calculations with unit conversions. I suspect primarily that some units evaluate from Wolfram|Alpha. Any way to prevent this automatically, so that Mathematica throws errors/...
8
votes
1
answer
469
views
Moles/Liters doesn't get simplified to Molar even though Molar*Liters gets simplified to Moles
Why can't Mathematica 9 simplify mol/L to M, when it can simplify M*L to mol?
...
8
votes
1
answer
418
views
Cannot plot Quantity values with DateListPlot
Bug introduced in 9.0.0 and fixed in 9.0.1
Quantity is new in 9.0.0
Is there a way to use DateListPlot with ...
8
votes
1
answer
331
views
Quantity and Trig functions
I have a bunch of data to which I've assigned units using Quantity, including some angular measurements in degrees. I'd like to be able to use these measurements ...
8
votes
0
answers
345
views
Spectral Radiance unit Flicks is not correct
Bug introduced in version 10.3 or earlier and fixed in 11.1.
I was pleasantly surprised that Mathematica (10.3, 10.4, 10.4.1, 11.0 and 11.0.1) had the unit $\text{flick}$ until I spent several hours ...
8
votes
0
answers
742
views
Units: Custom-defined units possible? [closed]
Converting between revolutions per minute (RPM) and revolutions per second (RPS) is not straightforward for me in Mathematica.
I know that $1\; \text{RPM} = \frac{2\; \times\; \Pi\; \text{Radian}}{\...
7
votes
3
answers
500
views