Questions tagged [units]

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

Filter by
Sorted by
Tagged with
3 votes
2 answers
82 views

Issue with unit conversion

I am getting an error converting energy unit Pa*m^3 (Pascal * Meters^3) to J (Joules). ...
  • 109
3 votes
1 answer
60 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. ...
  • 109
2 votes
0 answers
62 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}...
  • 771
3 votes
2 answers
105 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 ...
  • 109
5 votes
1 answer
56 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: ...
  • 703
1 vote
1 answer
46 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
73 views

MixedUnit in Fractions

Is there a way to have a more common output format on MixedUnit? ...
  • 1,613
2 votes
3 answers
138 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
60 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
47 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
75 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
71 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
63 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
56 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 ...
11 votes
0 answers
96 views

Differences of Quantities gives different result in different Mathematica version

In Mathematica 12.2 Differences[{Quantity[1, "mm"], Quantity[1, "mm"]}] gives ...
  • 16.6k
2 votes
2 answers
318 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, ...
  • 16.6k
3 votes
1 answer
65 views

How to make Quantity remember interpretation?

Units with micro μ prefix needs internet connection to interpret. For example, Quantity[1, "μm"] Though after one ...
  • 16.6k
6 votes
1 answer
154 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 ...
  • 30.8k
13 votes
3 answers
663 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, ...
  • 12.7k
2 votes
1 answer
86 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
81 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,857
0 votes
0 answers
57 views

Why RegionPlot does not work in this example?

I have some trouble understanding the RegionPlot command. I have defined the following input ...
0 votes
0 answers
32 views

Compiling functions with unit conversions

I have a numerical function that incorporates many units that I would like to speed up by using Compile. Here is a toy example of what I mean, doing it manually by ...
  • 1,706
1 vote
1 answer
90 views

Why does RegionPlot show an empty plot?

Problem Setting I have defined the following functions. ...
14 votes
1 answer
330 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 ...
  • 12.7k
4 votes
1 answer
181 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
65 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 ...
  • 51
6 votes
2 answers
200 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, ...
  • 41.1k
0 votes
0 answers
28 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,706
3 votes
1 answer
88 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
88 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 ...
  • 28.6k
0 votes
1 answer
56 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
97 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 ...
  • 25.8k
0 votes
0 answers
64 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
79 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 ...
  • 8,667
0 votes
1 answer
243 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 ? ...
  • 227
3 votes
2 answers
329 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 ...
2 votes
0 answers
92 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'...
0 votes
1 answer
52 views

How can I create a PasteButton that changes its "contents" dynamically?

I'm trying to make a units palette to help with my various engineering courses. I thought about creating a "meta-palette" of sorts, maybe one that changes on the fly, or one where I can ...
1 vote
1 answer
59 views

UnitSimplify for unit multiples and submultiples

Is there any way to automatically rewrite units so that they display more naturally looking magnitudes? By this I mean that ...
1 vote
1 answer
144 views

Plotting with hbar Griffiths 2nd edition quantum mechanics problem 10.1

I'm trying to plot the evolution of Psi from Problem 10.1 in Griffiths 2nd edition quantum mechanics. However, I'm having difficulty plotting because of the hbar in both numerator and denominator (so ...
  • 125
0 votes
2 answers
84 views

More Issues With Units

I have asked a couple questions here (and received terrific answers), and used that info. I am trying to fulfill a request from a colleague that liked the results of Astronomy info I had done, but ...
  • 656
0 votes
1 answer
61 views

Expression unexpectedly not evaluating to a numerical value [closed]

When I calculate the below, I get an unexpected output, not giving me the density, but rather a value M * .. ...
  • 223
0 votes
0 answers
64 views

Unit scaling: Human readable Quantity units

Consider some calculation yielding Quantity[x,"B"] as output ("B" interpreted as byte). Is there a way to automatically convert this to the ...
  • 998
1 vote
1 answer
57 views

Units Question for PlanetData[..]

I asked a similar question yesterday, which was answered splendidly, but I missed adding a detail. Attached is a command, its output, and the issue I have now. This outputs g/cm^3, but I'd rather have ...
  • 656
2 votes
2 answers
93 views

Converting Units [duplicate]

I'm using MMA 12.2. Trying to put together some astronomy pages, but the output of the command below is in miles. I would rather have it in SI units instead. On my system evaluating ...
  • 656
2 votes
1 answer
84 views

Getting error Solve::units [closed]

I'm trying to solve the following formula for i, given values for all other variables. There are two equations, the first one is a formula to show the transit ...
  • 223
4 votes
2 answers
149 views

AngularDegrees^2 and Steradians are incompatible units

UnitConvert[Quantity[360, "Degrees^2"], "Steradians"] AngularDegrees^2 and Steradians are incompatible units What am I doing wrong in not ...
  • 223
3 votes
2 answers
401 views

Why are Quantity and Units inconsistent with regular Mathematica behavior?

When I enter this in Wolfram Mathematica V12: 0 Dogs + 5 Cats Mathematica sensibly returns this: 5 Cats BUT, if I using the ...

1
2 3 4 5 6