Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [units]

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

0
votes
0answers
25 views

Problem with UnitConvert with a list

I'm studying this part of the course units convert I have two list the first: is in Megaparsec and I need to transform it to kilometers ...
0
votes
1answer
51 views

How can I add units to variables inside Manipulate?

I've created a Manipulate expression with many variables. I would like each of these variables to have associated units as in the standard Quantity[Value,"Unit"] so that I can easily enter the values ...
0
votes
0answers
47 views

NDSolve and Quantity[]

I'm working on a set of relatively basic ODEs of a physical pendulum and motor: $$\left\{\text{jb} \theta ''(t\text{s})+\text{rb} \theta '(t\text{s})+\alpha \sin (\theta (t\text{s}))+\mu \tan ^{-1}\...
2
votes
1answer
75 views

Scientific Notation for Quantities

I am using Quantities (units) in Mathematica 11.3 and would like to express the numerical portion of the output in scientific notation. The command ...
10
votes
1answer
656 views

Mathematica seems confused about Kilograms vs KilogramsForce

This does what I expect: Quantity["Kilograms"*"Meters"] // InputForm Quantity[1, "Kilograms"*"Meters"] This, on the other hand, bungles the units: ...
5
votes
3answers
103 views

Specify set of base units to use in UnitConvert

I am trying to convert arbitrary units to CGS. I know this can get a bit tricky with ESU, but for this question that does not need to be addressed. What I would like to do is to give a quantity-to-...
1
vote
1answer
49 views

How to change all stock prices to USD?

I want to create DateListPlot that compares prices of cellphone manufacturers' stocks over the last 13 years. Stocks include Nokia, Blackberry, Samsung, LG, Motorola, and Sony-Ericsson. The problem is ...
9
votes
2answers
181 views

Why does using different units but same physical value give different result?

I'm trying to define a variable with the value of the thermal constant $V_T$. The value of the thermal constant is given in Volts as $V_T = \frac{k T}{q}$, where $k$ is the Boltzmann constant and $q$ ...
-2
votes
1answer
63 views

Bizarre Problem with Wolfram Knowledgebase: Extracting Values

[System: Mas OS Mojave; Version: 11.3.0.0] I tried to use the knowledgebase, because why not, but got a strange result: I also tried another lookup for good measure: Plaintext code: EntityValue[{...
3
votes
1answer
58 views

Custom conversion rules in UnitConvert

I want to make UnitConvert operate on custom units with special rules. For instance, I would like to be able to convert between ...
2
votes
1answer
56 views

Convert time interval to mixed units without leading zeros

Let's say I have time intervals in seconds. I am looking for a method that produces the following conversions: 3660 => ...
4
votes
1answer
82 views

Problem using UnitConvert

As we know in physics, power = torque * (angular velocity). But when I use UnitConvert to convert a quantity expressing power/(angular velocity) into newton-meters, ...
2
votes
1answer
159 views

Convert decibels to amplitude - Built-in function

Is there a built-in function to convert decibels to amplitude in Mathematica? I tried with: UnitConvert[Quantity[40, "decibels"], "amplitude"] but it does not ...
5
votes
0answers
67 views

Join on QuantityArray

I need to merge two QuantityArray objects of mixed type. My first attempt looks something like: ...
1
vote
3answers
118 views

Multiplying quantities by scalars in Mathematica 11.3

I'm no longer able to multiply scalars by quantities in Mathematica 11.3. In previous versions the code 3*Quantity[1, "mm"] evaluated to ...
2
votes
1answer
63 views

FinancialData returns undefined Units for Volume or randomly fails

Recently FinancialData["IBM","Volume"] started failing and when it does randomly work, it returns Quantity[3073167,Shares] but ...
0
votes
0answers
43 views

Interpreter for Quantities without magnitude

When using a quantity interpreter on a unit without magnitude, the interpreter fails, but works fine on quantities with magnitudes. Ex: ...
2
votes
1answer
67 views
6
votes
2answers
1k views

Conversion between GB and MB (and KB)

UnitConvert[Quantity[1, "GB"], "MB"] Quantity[1000, "Megabytes"] Which is NOT something we would normally expect. Is this a bug? How can I use 1024MB =...
1
vote
0answers
41 views

Plot[func,…] shows incorrect function, but ListPlot@Table[func,…] is correct

When trying to Plot the function 1/(1 + E^(((e + Quantity[-7.05, "Electronvolts"]) *(Quantity[1, 1/("BoltzmannConstant")]))/T)) I get an incorrect plot ...
1
vote
2answers
349 views

How do I properly use Quantities (units) in plots?

I'm having some problems making plots with quantities in Mathematica Online 11.3.0. If I make a plot that is defined with the $x$-axis as an independent quantity (e.g., 0 to 3 seconds) and the $y$-...
4
votes
0answers
39 views

Preventing changes in TimeObject's TimeZone with subsequent operations

Is there an option or method to lock TimeZone in TimeObjects? For example, ...
4
votes
1answer
96 views

Max[] is being inconsistent when applied to time series

I am trying to create a list of annual maxima wind speeds. However the code I have come up with works inconsistently. i.e will produce a list for one weather station but will return ...
7
votes
4answers
396 views

Mathematica function which formats Physics calculation

One small step toward automating homework :) My lecturer doesn't accept calculations done in Mathematica code as homework. I have 30 pages of small calculations such as the one below. I don't want to ...
1
vote
2answers
160 views

Assign a unit to a variable in a function

I have the following input: PVW[V_, T_] := (R*T/(V - b)) - (a/(V^2)) Where I have already defined R as the molecular gas constant with its corresponding units ...
9
votes
2answers
77 views

Can Quantity interpretation be accepted using the keyboard?

Entering Ctrl+= on selected text results in the display of an interpreted Quantity, with the option to accept it, or choose other interpretations. The only way I ...
2
votes
0answers
44 views

Timeout in implicit Wolfram|Alpha calls, but WolframAlpha works

In general we expect this to work: Quantity["Speed of light"] Quantity[1, "SpeedOfLight"] And it does because it can make use of Wolfram|Alpha. Oddly, though, ...
2
votes
0answers
97 views

Plotting Time Series in the same currency value [closed]

I'm working with Financial Data and I'm using this code: ...
6
votes
1answer
92 views

Is it possible to get the name of a physical quantity related to a quantity, e.g. watts->power?

Is there a way to get the name of the physical quantity given by a particular unit? For example, QuantityUnit[Quantity[1, "Henries"]] returns ...
1
vote
1answer
105 views

How to `Reduce` an inequality with `QuantityVariable`s?

Without QuantityVariables I can Reduce a Quantity inequality. ...
1
vote
0answers
34 views

Buggy IntervalUnion with Quantities?

IntervalUnion can give wrong output when used with Quantity: ...
3
votes
0answers
99 views

Setting default units for output

Is it possible to set a default set of units for output? I've just discovered the joys of units and Quantity. Ideally, I'd like to be able to tell Mathematica to ...
8
votes
1answer
301 views

Change units in PlanetData[“Earth”, “Diameter”] from miles to km

When I enter AstronomicalData["Earth", "Radius"] I get Quantity[6.3674447*10^6, "Meters"] I would have preferred kilometers, ...
3
votes
0answers
76 views

Can FindFit be used with units?

I am trying to use the units capabilities of Mathematica throughout a course that I am teaching, but am finding that it isn't uniformly implemented across many functions. In particular, I would love ...
3
votes
1answer
94 views

How do I express Quantity values in different notations?

I am trying to obtain the value of physical constants such as speed of light $c = 2.998 \times 10^8\,\rm{m/s}$. But Mathematica doesnt seem to give me a direct answer. I have to do a round-about ...
4
votes
1answer
451 views

Convert natural unit to SI unit

Is it possible for MMA to convert natural unit (particle physics), for example, $1 eV^{-1}$ wavelength, to about $2\times 10^{-7}m$? I think the key is to tell MMA it's a length unit but I don't see ...
3
votes
1answer
61 views

Does Table handle Quantities differently?

I tried make a list with Table using quantities as inputs, but for some values of x, (e.g.,5,10,13..), the output is different than the same Table call without quantities. The last entry that I'm ...
1
vote
1answer
926 views

How to convert astronomical RA and Dec from sexagesimal to degree?

Astronomers use right ascension (RA) and declination (Dec) to refer to the sky coordinates of celestial objects. RA and Dec can take be represented degrees or in sexagesimal (base 60). How can I ...
2
votes
2answers
283 views

How to summon Acceleration due to Gravity in Mathematica 11?

How to summon Acceleration due to Gravity in Mathematica 11? seems like a simple thing but the documentation is no help.
2
votes
2answers
89 views

Getting physical units of MolarGasConstant

I want to be able to get the MKS units and value of the molar gas constant $R$. If I enter Quantity["MolarGasConstant"], Mathematica returns $1R$, which is quite ...
4
votes
2answers
169 views

FindMinimum with units?

Is there a way to use FindMinimum with quantities? For example: ...
3
votes
2answers
216 views

Mathematica refuses to simplify units

Here is a minimal example: Quantity[z, "m"]/(Quantity[x, "m"] Log[q] + Quantity[y, "m"]) where z,x,q,y are undefined ...
2
votes
1answer
204 views

Calculating with scientific notation

I want to calculate the gravitational force between the Earth and its Moon using Newton's gravitational formula: (G M1 M2)/d^2 and its appropriate physical units. I'd include the code I wrote for ...
3
votes
3answers
611 views

Can I format units using engineering prefixes?

I'm in the early stages of learning about units. It seems easy enough to express numerics and symbolics in units, but what I would really like to do is append engineering prefixes (km, mA, MW, etc). ...
8
votes
3answers
784 views

Why are Dalton and Grams / Moles not equivalent units?

The following code throws an error: UnitConvert[Quantity["Daltons"], "Grams"/"Moles"] Why?
2
votes
0answers
55 views

Plotting InterpolationFunction over Quantities

What's the proper syntax to plot Interpolation functions defined over Quantities? points = {{0, 0}, {1, 1}, {2, 3}, {3, 4}, {4, 3}, {5, 0}}; Change domain to ...
0
votes
0answers
28 views

How to format time durations for media clips {audio, video, music, science etc}

Mathematica has powerful date, time and timeseries functions and options. Yet they all seem to be tightly tied to Time in global clock-calendar-astronomic perception. I need to do basic time-duration ...
0
votes
0answers
20 views

Plot3D including units [duplicate]

I am trying to plot a 3D plot with a formula containing units. When I put the formula explicitly it works: ...
0
votes
1answer
95 views

Solving Equations with units is not working

I have the code Clear[distance, time, Vavg]; Solve[Quantity[Vavg, "Meters"/"Seconds"] == Quantity[distance, "Meters"]/Quantity[time, "Seconds"], distance] ...
4
votes
1answer
2k views

Convert radian to degree and add °

How can I convert a radian angle to a degree one and add ° after it? I am using N[(Pi/4)/Degree], but the output is 45. with ...