Questions tagged [units]
Questions about using, converting, or interpreting units of measurement in Mathematica.
309
questions
7
votes
2
answers
129
views
Inverse of UnitDimensions[]
Is there a straightforward way to write an inverse of UnitDimensions to get the SI unit from dimensions?
For example,
...
0
votes
1
answer
50
views
Integrate & Unit: unable to determine the units of quantities
In a Wolfram Notebook,
I declare a function F1[x]=1/x where x is in "Meters"
F1[X_] = With[{x=Quantity[X,"Meters"]},1/x]
I integrate F1. ...
0
votes
1
answer
68
views
Clear Guidelines for Symbolic Calculation With Units?
The following notebook performs a relatively simple physical calculation interacting position, velocity and acceleration of two charged point particles according to Weber electrodynamics.It is simple ...
8
votes
3
answers
498
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 <...
5
votes
1
answer
70
views
QuantityArray vs Array of Quantities
If memory and speed are not concerns, is there a reason to use QuantityArray instead of an array of quantities?
1
vote
3
answers
391
views
How to handle units of measurement?
I'm trying to understand how Mathematica handles units of measurement.
That is I expect that a calculation should return a certain unit, but I don't succeed. Let's consider this example:
...
5
votes
3
answers
233
views
How to find all InformationUnits by code method?
As I know, the "Megabytes" and "Gigabits" both are ...
4
votes
3
answers
147
views
Cases syntax when expression sought is a Quantity
From the following list I wish to extract those cases for which the magnitude of a quantity is greater than zero for which I would like to then create a DateListPlot.
...
2
votes
1
answer
61
views
Create by hand a formatted form of quantities
If I evaluate the following cell:
Quantity["PlanckConstant"]
I get as an output a very concise format of this quantity:
Also, compare the legibility of ...
0
votes
0
answers
24
views
Why is ExternalEvaluate running the command Quantity[471.04`, "Kilobytes"] on RaspberryPi
Raspberry Pi 4B with 32 bit Raspberry Pi OS Full:
Linux raspberrypi 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr 3 17:24:16 BST 2023 aarch64 GNU/Linux
Mathematica for Raspberry Pi 13.1
The command
...
1
vote
0
answers
78
views
How to prohibit automatic DegreesCelsius converting to Kelvins?
On this wiki page, temperature conversion is presented clearly. For example.
It also warns that we should take care of temperature difference conversion which is a different conversion as
It is ...
0
votes
0
answers
41
views
quantity of `Around` with "DimensionlessUnit"
Quantity[1, "DimensionlessUnit"]
gives pure number
1
However,
...
4
votes
1
answer
116
views
How can the units of the "AtomCoordinates" in a Molecule be changed while keeping the resulting MoleculePlot3D consistent?
Mathematica provides the Molecule function that can be visualized with MoleculePlot3D since version 12.0. Before, importing "XYZ" files would produce a ...
2
votes
2
answers
60
views
ToPolarCoordinates not working with units
I am trying to convert some quantities with units from rectangular to polar coordinates (to get the magnitude and angle). It seems that ToPolarCoordinates command does not calculate the angle when ...
0
votes
1
answer
86
views
Dealing with exponents that contain units?
Many of the equations I deal with involve powers of quantities which contain units. However, when the exponent contains units (e.g., ...
3
votes
2
answers
98
views
Issue with unit conversion
I am getting an error converting energy unit Pa*m^3 (Pascal * Meters^3) to J (Joules).
...
3
votes
1
answer
73
views
Solve not working with cross product with units
I recently asked this question about using Solve with cross product.
Solve not working when doing cross-product
When I use the units in the definition of the variables, I am not able to get an answer.
...
2
votes
0
answers
72
views
Why does different nondimensionalizations give different results? Although the results should be the same
I have some problems with the non-dimensionalization of the Hamiltonian of motion in a Coulomb field.
The Hamiltonian has a following form:
$$H=-\frac{\hbar^2}{2\mu^*} \Delta_r-\frac{e^2}{\epsilon_0 r}...
3
votes
2
answers
156
views
Importing scientific data with uncertainties and units
I want to import scientific data from a CSV file. The data are length measurements in centimeters with uncertainties. I want to import the data with uncertainties and units into a vector - please see ...
5
votes
1
answer
62
views
mesh / region creation in unit meters or mm:
How can we know the unit of mesh or create a mesh in specified length units:
such as, for example I have:
...
1
vote
1
answer
57
views
A problem about the integration of blackbody radiation law using FormulaData. QuantityVariable limits
I am trying to integrate blackbody radiation law under 1500 Kelvin using the FormulaData command.
The integration seems not to work properly after I designate the ...
4
votes
0
answers
84
views
MixedUnit in Fractions
Is there a way to have a more common output format on MixedUnit?
...
2
votes
3
answers
161
views
Accuracy and precision control for a simple calculation [closed]
Consider a very simple calculation: $231 \times (2.54) ^ 3$, which is the number of cubic cm in a US gallon.
On my phone app calculator I got the exact answer, which is $3785.411784$.
On Mathematica, ...
0
votes
1
answer
70
views
How to convert units from percent per year to real number with CountryData? [closed]
I have CountryData coming in via e.g.
...
1
vote
0
answers
94
views
StreamPlot "Part is not a Graphics primitive or directive."
I am trying to use StreamPlot with units. Here is a minimal example to produce the error "Part is not a Graphics primitive or directive." :
...
3
votes
1
answer
98
views
Plotting a function with units gives two different results
With the following code block, I plot a function with units in it in two different ways. Both ways should do the same in my understanding of the documentation.
...
4
votes
1
answer
131
views
Getting Molecular Weight for Stoichiometry Calculations
I love the units system in Mathematica, it's an extremely useful addition to the language. Unfortunately there are still some sharp corners that I run into on a daily basis. For example, if I want to ...
1
vote
2
answers
117
views
Incompatible Units Problem
I am trying to use quantities with physical units to calculate my result, but I encountered the "Incompatible units" problem. I don't know what is going on. Here is my code, could I have ...
0
votes
0
answers
84
views
Extending Dimensional Analysis?
Is there some way to extend Mathematica's dimensional analysis? For example, I'd like to be able to provide it with dimensional equations like energy=mass with units scalings like c^2 and have it ...
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
...
2
votes
2
answers
327
views
Why does System`Private`ConstructNoEntry[Quantity, 1, "kg"] enter a Recursion?
System`Private`ConstructNoEntry[BesselJ, 0, x]
works fine, and outputs
BesselJ[0, x]
However,
...
3
votes
1
answer
69
views
How to make Quantity remember interpretation?
Units with micro μ prefix needs internet connection to interpret. For example,
Quantity[1, "μm"]
Though after one ...
6
votes
1
answer
212
views
Exporting results containing Entities to JSON?
I am looking for a straightforward way to export results from functions like ImageContents, FacialFeatures, and WolframAlpha - symbols that return stuff containing knowledgebase content.
Aside from ...
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, ...
2
votes
1
answer
93
views
Why does the following RegionPlot command not evaluate?
I have some trouble understanding the RegionPlot command. I have defined the following input
...
4
votes
2
answers
89
views
Format Time Reported by AbsoluteTiming
I am trying to format the timing reported by AbsoluteTiming so that it states the hours minutes and seconds of the result. However, probably because ...
0
votes
0
answers
66
views
Why RegionPlot does not work in this example?
I have some trouble understanding the RegionPlot command. I have defined the following input
...
1
vote
1
answer
118
views
Why does RegionPlot show an empty plot?
Problem Setting
I have defined the following functions.
...
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 ...
4
votes
1
answer
204
views
Why do expressions with physical units not get simplified?
I am trying to calculate precise values for certain expressions, see the image below.
The output testZPF of the function $\Delta$Fn should be a single output. I am ...
1
vote
1
answer
27
views
Evaluating combinations of variables in a table, produces inconsistent results
I am trying to evaluate a combination of pairs of variables and then print them in a table, at the beginning it evaluates totally fine, but when reaching the last rows something strange happens
...
2
votes
0
answers
70
views
Why will a Log expression with Quantity expressions not get simplified? [closed]
I'm having trouble with numerically evaluating some functions. The problem essentially comes down to
...
6
votes
2
answers
214
views
`AccelerationOfFreeFall` has wrong units
Fixed in 13.0
On earth, the acceleration of free fall is around $9.81\,\text{m}/\text{s}^2$. In Mathematica,
...
1
vote
0
answers
36
views
Safely coercing units from Wolfram|Alpha freeform input
How do I coerce unexpected units from free-form input? For instance, if I request the binding energy of hydrogen I expect an answer with dimensions of energy. Instead I get
...
3
votes
1
answer
154
views
How to use `Quantity` to convert Degrees of Latitude into Kilometers?
I want to convert 0.018 Degrees of Latitude into kilometers using the Quantity function in Mathematica. Unfortunately I do not know what Degrees of Latitude are ...
1
vote
1
answer
95
views
Currency Interpretation for VND
Bug introduced in v12.2.0 or earlier, persisting through v13.2.1. Case number: 4973722
As I was helping an OP with a question involving Vietnamese currency, I didn't realize at the time that the ...
0
votes
1
answer
62
views
Get Real Solutions works in Solve but PositiveReals don't (Quantities)
I'm trying to get the R+ Solutions to a school problem with solve. Everything works fine with Dom -> Reals but when I try ...
5
votes
1
answer
103
views
How to make Tooltip work with Quantity?
When I execute the code below:
Tooltip[Quantity[1, "Month"], "how to make it works?"]
The tooltip that is automatically generated by ...
0
votes
0
answers
78
views
Mathematica not performing simplifications with units with ScientificForm
I've run into a little problem, and I think in my research I've run into a dead end. I'm trying to perform some basic calculations with units, but Mathematica refuses to simplify the most basic ...
0
votes
0
answers
137
views
How to use the autocomplete for built-in function's argument for a user defined symbol?
Suppose I have myFunction as follows:
ClearAll[myFunction];
myFunction[unitName_,somethingElse_]:=...definition...;
I want to ...