Questions tagged [units]

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

Filter by
Sorted by
Tagged with
2 votes
2 answers
34 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, ...
user avatar
  • 15.6k
3 votes
1 answer
51 views

How to make Quantity remember interpretation?

Units with micro μ prefix needs internet connection to interpret. For example, Quantity[1, "μm"] Though after one ...
user avatar
  • 15.6k
0 votes
0 answers
26 views

Why doesn't Quantity support micro unit prefix μ? [closed]

Take Meter as an example: Quantity[1, "m"] Quantity[1, "mm"] Quantity[1, "μm"] Quantity[1, "nm"] gives On the other hand, ...
user avatar
  • 15.6k
6 votes
1 answer
90 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 ...
user avatar
  • 30.4k
13 votes
3 answers
643 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, ...
user avatar
  • 12.3k
2 votes
1 answer
79 views

Why does the following RegionPlot command not evaluate?

I have some trouble understanding the RegionPlot command. I have defined the following input ...
user avatar
4 votes
2 answers
74 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 ...
user avatar
  • 1,585
0 votes
0 answers
48 views

Why RegionPlot does not work in this example?

I have some trouble understanding the RegionPlot command. I have defined the following input ...
user avatar
0 votes
0 answers
29 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 ...
user avatar
  • 1,478
1 vote
1 answer
76 views

Why does RegionPlot show an empty plot?

Problem Setting I have defined the following functions. ...
user avatar
14 votes
1 answer
306 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 ...
user avatar
  • 12.3k
4 votes
1 answer
170 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 ...
user avatar
1 vote
1 answer
25 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 ...
user avatar
0 votes
1 answer
48 views

FindRoot with Quantities throws error FindRoot::nlnq

I have a fluid mechanics problem, but when I try to solve an equation to get the flow rate Q (m^3/s) it throws an error that I can't track ...
user avatar
2 votes
0 answers
63 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 ...
user avatar
  • 51
6 votes
2 answers
191 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, ...
user avatar
  • 36.2k
0 votes
0 answers
27 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 ...
user avatar
  • 1,478
3 votes
1 answer
72 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 ...
user avatar
0 votes
0 answers
33 views

Currency Interpretation for VND

As I was helping an OP with a question involving Vietnamese currency, I didn't realize at the time that the currency amount was not being interpreted accurately (or so I think now). Apparently, the ...
user avatar
  • 16.2k
0 votes
1 answer
45 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 ...
user avatar
5 votes
1 answer
89 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 ...
user avatar
  • 25.3k
0 votes
0 answers
57 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 ...
user avatar
0 votes
0 answers
46 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 ...
user avatar
  • 8,217
0 votes
1 answer
81 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 ? ...
user avatar
  • 227
2 votes
2 answers
173 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 ...
user avatar
2 votes
0 answers
86 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'...
user avatar
0 votes
1 answer
43 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 ...
user avatar
1 vote
1 answer
46 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 ...
user avatar
1 vote
1 answer
112 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 ...
user avatar
  • 125
0 votes
2 answers
78 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 ...
user avatar
  • 636
0 votes
1 answer
48 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 * .. ...
user avatar
  • 223
0 votes
0 answers
55 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 ...
user avatar
  • 902
1 vote
1 answer
48 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 ...
user avatar
  • 636
2 votes
2 answers
85 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 ...
user avatar
  • 636
2 votes
1 answer
74 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 ...
user avatar
  • 223
4 votes
2 answers
144 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 ...
user avatar
  • 223
2 votes
2 answers
355 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 ...
user avatar
1 vote
2 answers
135 views

Planck's Law 3D Plot with units outputting blank graph

I'm trying to plot Planck's Law for black body radiation on a wavelength-temperature graph where the output (z-axis) is the intensity. The function has multiple variables so I tried Plot3D. https://en....
user avatar
6 votes
4 answers
390 views

Converting an equation with units to one without units

I may have a solution but it is not slick! See below Doing numerical calculations with functions that use units can be very slow. I would like to have a function or operator that can turn my functions ...
user avatar
  • 1,372
2 votes
0 answers
64 views

How to get Integrate to determine units

In a similar fashion to the question asked here, I am having trouble trying to get Integrate to correctly determine the units of the integrand: Here I have plugged in specific values into the general ...
user avatar
4 votes
1 answer
150 views

Is there a reason why "Revolutions" and "Radians" or "AngularDegrees" are not CompatibleUnitQ?

I understand that keeping a consistent unit framework across multiple domains is complicated and not everyone will be satisfied with the choices made, like when people ask why "Radians" are ...
user avatar
  • 161
3 votes
0 answers
40 views

How to stop Quantity from evaluating

I'm trying to get an expression to display, without it evaluating it's internal arguments, but for some reason, when given the Quantity function, HoldForm doesn't seem to do what I expect: Code ...
user avatar
1 vote
0 answers
78 views

How can I get Mathematica to display PSI instead of lbf/in^2 as a unit? [closed]

I'm new to Mathematica and I've been trying to figure out if there was a way for Mathematica to display psi instead of its standard output, "lbf/in^2."
user avatar
2 votes
1 answer
142 views

How do I make a general solver for a system of equations (e.g. thermodynamic processes) with different inputs and outputs?

Background Let's say I have a system of equations (e.g. thermodynamics equations), where the "knowns" and "unknowns" are subject to change, and the system of equations can also ...
user avatar
  • 493
1 vote
0 answers
30 views

Issue displaying units with Quantity[] inside bar legend

Quantity[] is displaying some inconsistent behaviour when used in BarLegend[]. Compare the following two examples: ...
user avatar
  • 249
1 vote
1 answer
56 views

Issues arising when using UnitSimplify for getting a dimensionless expression

I am having some difficulties when using UnitSimplify in manipulating expressions for obtaining dimensionless quantities in Mathematica 12.0.0. Here is a minimal ...
user avatar
  • 432
1 vote
0 answers
41 views

Plotting a quantity-based function doesn't work

Creating the function: ...
user avatar
  • 11
3 votes
2 answers
69 views

Comparison of tagged units

Consider this data set: BNikkei = {{10.0032, 27 Days}, {10.0527, 22 Days}, {10.1283, 18 Days}} from a recent question, "More effective way to apply a function ...
user avatar
  • 590
4 votes
0 answers
69 views

Force Solve to respect unit system

I give Solve quantities in FPS and it returns resulting quantities in SI, necessitating that I add an entire section to my workflow where I pick apart the solution ...
user avatar
3 votes
0 answers
76 views

UnitConvert having trouble multiplying Boltzmann's Constant with Fahrenheit?

T:=70 Quantity["DegreesFahrenheit"] kb:=Quantity["BoltzmannConstant"] UnitConvert[kb UnitConvert[T, "Kelvins"], "Electronvolts"] // N Returns 0.0253575 eV while <...
user avatar
  • 51

1
2 3 4 5 6