We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [units]

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

Filter by
Sorted by
Tagged with
5
votes
2answers
61 views

Unitless quantities

There are many cases in science where a quantity should end up unitless. Yet the units capabilities of Mathematica seem to have a problem with such situations. For example: ...
0
votes
1answer
71 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 ...
7
votes
2answers
803 views

Why do I get QuantityUnits`Private`ToQuantity when trying to use units?

I'm unable to use units in mathematica (10.3.1) When I do Quantity[500, "Feet"] + Quantity[50, "Meters"] the answer I get is ...
1
vote
0answers
37 views

What is used for the % symbol in mathematica? [duplicate]

Im new in mathematica i want to know logic about this program. I got this code: {{vo, vn, Ii}} = {vo, vn, Ii} /. %; i know that the syntax /. is for replacement but i dont know whats going on with ...
6
votes
2answers
1k views

How to get Planck length in meters to 6 decimal places

I want Mathematica to format quantities to more decimal places than the default. For example I have tried ...
1
vote
0answers
40 views

Manipulating a ParametricFunction to handle units

I have a pretty nice way to handle units on a result from NDSolve, which basically consists of converting all of the units to SI, stripping them, calling NDSolve, and then putting the units back. I'll ...
0
votes
1answer
34 views

TargetUnits aren't working as expected on an InterpolatingFunction

Short version: My understanding of the use of TargetUnits in a Plot statement is that if the function being plotted has units, MMA will attempt to convert the output of that function to the unit form ...
4
votes
1answer
102 views

Very slow rendering of Quantity

I noticed since Mathematica v12 a very slow frontend when rendering the Units. Easy to show: Quantity[Range[1, 100], "Euros"] Takes (timed with a stopwatch) ...
1
vote
0answers
27 views

SemanticImport changes “string” type to “quantity” type--how to change during import or after import?

This question may overlap with other questions about the quirks of SemanticImport, but I don't see this specific wrinkle on StackExchange and I hope it will be a simple answer to help me and others ...
14
votes
4answers
1k views

Automatically add appropriate prefix to Quantity

Is there a function that automatically adds the appropriate prefix to a Quantity object? For example, I would like a function ...
0
votes
0answers
27 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 ...
8
votes
2answers
670 views

Physical (and other) constants

As Mathematica documentation likes to say, "As of Version 9.0, physical constant functionality is built into the Wolfram Language". After clicking on the ">>", one ...
1
vote
0answers
67 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
83 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 ...
1
vote
1answer
52 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 ...
5
votes
3answers
131 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-...
10
votes
1answer
666 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: ...
3
votes
1answer
50 views

Why does the TimeObject seem to lose precision? (+ note on units)

According to the documentation (11.0.1.0) Shorter lists can be used in TimeObject[{h,m,s}], which represents the time to whatever accuracy is specified: {h} is not [sic?*] treated as being ...
9
votes
2answers
185 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$ ...
37
votes
8answers
4k views

Simpler input for the new unit support

I've been playing with the new unit support in Mathematica 9. It seems very useful, but the syntax is very verbose. Instead of typing: ...
-2
votes
1answer
66 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[{...
5
votes
1answer
145 views

Get Isotope Data and Electron Mass in Same Units - kg and Kilograms

I'm trying to find the nuclear mass of $^{238}\text{U}$. To do this, I subtract the electron mass from the atomic mass. I'd like to find the final answer in kilograms. I'd also like to use Mathematica'...
3
votes
1answer
64 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 ...
8
votes
1answer
673 views

Using physical dimensions in Mathematica DSolve

I would like to calculate a system of two differential equations in Mathematica using DSolve, like: ...
16
votes
3answers
920 views

How to convert between various ItemSize/ImageSize units?

How can one convert between the implicit units used by Grid (ems and line height for horizontal and vertical dimensions) and printers points (in ...
2
votes
1answer
58 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
102 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
218 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
70 views

Join on QuantityArray

I need to merge two QuantityArray objects of mixed type. My first attempt looks something like: ...
1
vote
3answers
125 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
72 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
45 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: ...
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 =...
14
votes
1answer
606 views

Why is this evaluation halved when adding units?

Bug introduced in 9.0 or earlier and persisting through 11.2 or later Why does this strange behavior occur when dealing with units and quantities? ...
1
vote
0answers
42 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 ...
5
votes
1answer
85 views

MixedRadix rounds incorrectly

You can Round Quantitys. For example, how many inches are in a meter? ...
15
votes
2answers
6k views

Numerical value of physical constants Mathematica 10

Is there a way to use the physical constants in calculations and have Mathematica 10 figure out the final unit and numerical magnitude? When I try ...
4
votes
1answer
3k views

How to get the quantity of Physical constants?

I need to get the quantity of gravitational constant: QuantityMagnitude[GravitationalConstant] why this is not work? Already load the ...
7
votes
1answer
293 views

Quantity and Trig functions

I have a bunch of data to which I've assigned units using Quantity, including some angular measurements in degrees. I'd like to be able to use these measurements ...
11
votes
4answers
304 views

How to prevent Quantity calculations from converting units

I have an accrual calculation that I would like to preserve the units even though they are of the same dimension (e.g. time). For example, I would like the following ...
1
vote
2answers
494 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$-...
3
votes
3answers
877 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). ...
6
votes
1answer
97 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
106 views

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

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

Buggy IntervalUnion with Quantities?

IntervalUnion can give wrong output when used with Quantity: ...
2
votes
0answers
101 views

Plotting Time Series in the same currency value [closed]

I'm working with Financial Data and I'm using this code: ...
0
votes
1answer
111 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
0answers
61 views

QuantityForm does not work with MixedRadixQuantity?

Bug introduced after 9.0 and in 10.1 or earlier, and persisting through 11.2 or later From 10.1 to 10.3.1, QuantityForm[q, "Abbreviation"] outputs From 10.4 to 11....
1
vote
2answers
195 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 ...