Numerical Calculations with Units

Mathematica's unit system utilizes various numerical methods, facilitating calculations using Quantity expressions within Mathematica's numerical functions.

N[quantity]numerical approximation of the specified quantity
FindRoot[lhs=rhs,{x,x0}]search for a numerical solution to an equation, starting with
FindMaximum[f,{x,x0}]search for a maximum of f, starting with

Numerical functions that operate on Quantity expressions.

N[quantity] gives you a numerical approximation of quantity.
In[1]:=
Click for copyable input
Out[1]=

For numerical functions like FindRoot and FindMaximum, if a variable is specified within a Quantity expression, then that variable is assumed to be a dimensionless value (representing the magnitude of its Quantity). If no unit is specifically associated with a variable, these functions will attempt to automatically determine the units associated with the variable, based on the expression and any specified start values.

Specifying within a Quantity indicates that is a dimensionless value.
In[2]:=
Click for copyable input
Out[2]=
Find the time it takes for a falling body to hit the ground.
In[3]:=
Click for copyable input
Out[3]=
Find a local maximum, starting the search at x=2.
In[4]:=
Click for copyable input
Out[4]=
Find the peak height of a bullet fired from a rifle vertically, without dampening.
In[5]:=
Click for copyable input
In[6]:=
Click for copyable input
Out[6]=
Find how long it takes the bullet to return to Earth.
In[7]:=
Click for copyable input
Out[7]=
Find the maximum height of a body shot vertically upward, with dampening.
In[8]:=
Click for copyable input
In[9]:=
Click for copyable input
Out[9]=
New to Mathematica? Find your learning path »
Have a question? Ask support »