Questions tagged [units]

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

309 questions
Filter by
Sorted by
Tagged with
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, ...
• 153
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. ...
• 131
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 ...
• 121
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 <...
• 223
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?
• 5,626
1 vote
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: ...
233 views

How to find all InformationUnits by code method?

As I know, the "Megabytes" and "Gigabits" both are ...
• 27k
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. ...
• 1,943
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 ...
• 375
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 ...
• 2,590
1 vote
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 ...
• 17.3k
41 views

quantity of Around with "DimensionlessUnit"

Quantity[1, "DimensionlessUnit"] gives pure number 1 However, ...
• 17.3k
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 ...
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 ...
• 129
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., ...
98 views

Issue with unit conversion

I am getting an error converting energy unit Pa*m^3 (Pascal * Meters^3) to J (Joules). ...
• 129
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. ...
• 129
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}...
• 1,883
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 ...
• 129
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: ...
• 867
1 vote
57 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 ...
• 11
84 views

MixedUnit in Fractions

Is there a way to have a more common output format on MixedUnit? ...
• 1,623
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, ...
70 views

How to convert units from percent per year to real number with CountryData? [closed]

I have CountryData coming in via e.g. ...
• 225
1 vote
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." : ...
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. ...
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 ...
• 490
1 vote
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 ...
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 ...
• 121
108 views

Differences of Quantities gives different result in different Mathematica version

In Mathematica 12.2 Differences[{Quantity[1, "mm"], Quantity[1, "mm"]}] gives ...
• 17.3k
327 views

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

SystemPrivateConstructNoEntry[BesselJ, 0, x] works fine, and outputs BesselJ[0, x] However, ...
• 17.3k
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 ...
• 17.3k
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 ...
• 31.7k
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, ...
• 13.5k
93 views

Why does the following RegionPlot command not evaluate?

I have some trouble understanding the RegionPlot command. I have defined the following input ...
• 161
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 ...
• 1,991
66 views

Why RegionPlot does not work in this example?

I have some trouble understanding the RegionPlot command. I have defined the following input ...
• 161
1 vote
118 views

Why does RegionPlot show an empty plot?

Problem Setting I have defined the following functions. ...
• 161
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.5k
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 ...
• 161
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 ...
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 ...
• 151
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, ...
• 49.3k
1 vote
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 ...
• 1,844
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 ...
• 7,659
1 vote
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 ...
• 56.1k
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 ...
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 ...
• 26.3k