# Questions tagged [units]

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

304 questions
Filter by
Sorted by
Tagged with
365 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: ...
223 views

### How to find all InformationUnits by code method?

As I know, the "Megabytes" and "Gigabits" both are ...
138 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. ...
56 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 ...
21 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 ...
68 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 ...
35 views

### quantity of Around with "DimensionlessUnit"

Quantity[1, "DimensionlessUnit"] gives pure number 1 However, ...
99 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 ...
56 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 ...
79 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., ...
86 views

### Issue with unit conversion

I am getting an error converting energy unit Pa*m^3 (Pascal * Meters^3) to J (Joules). ...
67 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. ...
66 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}...
132 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 ...
59 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
50 views

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 ...
83 views

### MixedUnit in Fractions

Is there a way to have a more common output format on MixedUnit? ...
153 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, ...
65 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
66 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." : ...
89 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. ...
94 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
89 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 ...
68 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 ...
107 views

### Differences of Quantities gives different result in different Mathematica version

In Mathematica 12.2 Differences[{Quantity[1, "mm"], Quantity[1, "mm"]}] gives ...
321 views

### Why does SystemPrivateConstructNoEntry[Quantity, 1, "kg"] enter a Recursion?

SystemPrivateConstructNoEntry[BesselJ, 0, x] works fine, and outputs BesselJ[0, x] However, ...
68 views

### How to make Quantity remember interpretation?

Units with micro μ prefix needs internet connection to interpret. For example, Quantity[1, "μm"] Though after one ...
193 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 ...
682 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, ...
91 views

### Why does the following RegionPlot command not evaluate?

I have some trouble understanding the RegionPlot command. I have defined the following input ...
87 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 ...
63 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
104 views

### Why does RegionPlot show an empty plot?

Problem Setting I have defined the following functions. ...
342 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 ...
197 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
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 ...
67 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 ...
209 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, ...
29 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 ...
110 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
93 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 ...
57 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 ...
99 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 ...
70 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 ...
107 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 ...
397 views

### How to convert a Quantity to a simple Integer or Float? [closed]

How can I convert a quantity, such as: Quantity[3, "Euros"] To the simple number that represents it, in that case 3 ? ...
543 views

### How do I get a numerical value for a physical constant in Mathematica 12.1 [closed]

I've been working on some optics problems and regularly need to use constants like the charge of an electron, vacuum permittivity, etc. I'd like to be able to call these constants in Mathematica as ...
96 views

### Using units in NBodySimulation function

I'm trying to use NBodySimulation to run a simulation of objects such as stellar masses. I've tried using the InverseSquare and Newtonian settings on NBodySimulation for this, but InverseSquare doesn'...