# Questions tagged [units]

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

263 questions
Filter by
Sorted by
Tagged with
41 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 ...
82 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 ...
51 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 ...
36 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 ...
49 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 ? ...
91 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 ...
70 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'...
38 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 ...
42 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 ...
88 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 ...
76 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 ...
44 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 * .. ...
51 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 ...
46 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 ...
80 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 ...
57 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 ...
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 ...
311 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 ...
120 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....
327 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 ...
58 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 ...
136 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 ...
39 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 ...
67 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."
112 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 ...
26 views

### Issue displaying units with Quantity[] inside bar legend

Quantity[] is displaying some inconsistent behaviour when used in BarLegend[]. Compare the following two examples: ...
55 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 ...
32 views

### Plotting a quantity-based function doesn't work

Creating the function: ...
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 ...
61 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 ...
71 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 <...
91 views

α = Quantity[-3, ("Radians")/("Seconds")^2]; ω = Quantity[-4, ("Radians")/("Seconds")]; r = Quantity[2, "Feet"]; at = α r an = ω^2 r a = Sqrt[an^2 + at^2] ...
36 views

### Computing matrix eigenvalues with units

I apologize if this is a basic question or if I am not giving enough detail. I'm trying to solve for the eigenvalues of a matrix with matrix elements that have units. ...
200 views

### Using physics constant in calculation

I know that mathematica knows physical constants https://reference.wolfram.com/language/guide/Units.html If I write down = PlanckConstant it "recognizes" hbar. My question is: how can I use in an ...
23 views

### What is the reason StandardDeviation doesn't cooperate with Quantity "Percent"?

Consider the following list of numbers y = {13, 0.2, 11.201}; Turning y into a list of ...
78 views

### How to handle Units when Integrating?

I have some functions defined, which are to use units. Now another function is used to integrate over those, with the integration variable also quantified and the input to said function. I better just ...
63 views

### Does AroundReplace work with Quantity?

When I try to use AroundReplace with units it issues Around::compat message and outputs something strange: ...
66 views

### UnitSimplify rules?

Code as following: ...
39 views

### GeoDistance and Excel export

I'm trying to export the distance matrix below to an excel file. I have no interested on the unit. I just care the value of a distance. A standard export command does not work properly. How should I ...
41 views

### Any progress on Plots of Quantities?

Plots of quantities still don't seem to work. I've implemented the one suggestion people have: use Evaluate, but now the values of my plots are just completely off ...
139 views

### How to plot $\sin\theta$ in degree? [closed]

Please suggest how to plot $\sin\theta$ in degree. I am trying using the given below code but it is not working (It works if used Ticks without ...
106 views

### How to add some bytes quantity?

I have some strings like: st={"29M", "53K", "27K", "5.0M", "29M", "4.0K", "4.0M", "114M", "20K", "1.3G"} They are some bytes quantity, could we add or sort them ...
54 views

### Mathematica not simplifying expressions with units

Hi I'm having an issue with the Quantity system. On the guide for units on the wolfram page, there is an example ...
433 views

### Why is Mathematica messing with the time units in this simple equation? [closed]

If you lets say work 40 hours every week and your working days total to 251/5 weeks for a particular year. Then why is Mathematica messing this calculation and producing incorrect result? ...
47 views

### Is there a way to include holiday calendar into Quantity system?

Suppose I have a long list of business hours but in different denominations for postings like as follows. If I just use the vanilla UnitConvert it just does a ...
280 views

### Getting useful units for combinations of physical constants like on WolframAlpha?

When I need to do order of magnitude estimates, I often encounter situations where I have a mess of physical constants and difficulty putting them in sensible units. For example, consider the ...
92 views

### Extract values from strings according to units

I have a lot of strings, which have simple nomenclature of number-unit associations and am looking to extract the number according to the units. For example: ...
56 views

### Force UnitConvert to display the proper unit prefix and return inexact quantities? [closed]

I'm experimenting with units: UnitConvert[1/Quantity[2.0, "GHz"]] 5.*10^-10s ...