Questions tagged [units]

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

Filter by
Sorted by
Tagged with
1
vote
1answer
69 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 ...
4
votes
1answer
101 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 ...
2
votes
0answers
25 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 ...
2
votes
3answers
400 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? ...
2
votes
0answers
43 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 ...
7
votes
2answers
98 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 ...
3
votes
2answers
50 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: ...
1
vote
1answer
43 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 ...
2
votes
3answers
53 views

Changing Y-Axis to “Billions of Dollars”

Is there a way to change my bar chart's Y-axis from powers of 10 to "billions of dollars"? For example $100,000,000,000 should read as ...
5
votes
2answers
69 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: ...
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
41 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
36 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
111 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
28 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 ...
0
votes
0answers
28 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
89 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 ...
1
vote
0answers
77 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
88 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
671 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
167 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
54 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
188 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
67 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
68 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
60 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
115 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
275 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
73 views

Join on QuantityArray

I need to merge two QuantityArray objects of mixed type. My first attempt looks something like: ...
1
vote
3answers
128 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
73 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
46 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
75 views

Meter newtons revolutions / second is not compatible with Watts

When I do ...
8
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
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 ...
3
votes
3answers
590 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
41 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
99 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 ...
8
votes
5answers
458 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
243 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
81 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 ...
4
votes
0answers
64 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
103 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
104 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
39 views

Buggy IntervalUnion with Quantities?

IntervalUnion can give wrong output when used with Quantity: ...
4
votes
0answers
134 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
327 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
88 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 ...

1 2 3 4 5