Using Units in Maple
Units conversions and manipulations can be done most efficiently at the top-level without using the Standard or Natural Units environments, but in general you can more easily perform the computations in the other environments.
For information on inline computations, see the example worksheets for the Simple Units environment, the Standard Units environment, or the Natural Units environment. Each example in this worksheet is also in the other worksheets to show how you can perform the computations in the other environments.
restart
Simple Examples
Add 4 feet to 3 inches.
convert⁡4,units,feet,inches+3
51
How many meters are equivalent to 4 yards?
convert⁡4,units,yd,m
2286625
How many liters are equivalent to 5 UK gallons?
convert⁡5,units,galUK,L
45460920000
How many liters are equivalent to 5 US gallons?
convert⁡5,units,galUS_liquid,L
47317647325000000
How many US liquid gallons are equivalent to a UK gallon?
convert⁡1,units,galUS_liquid,galUK,
473176473568261250
Unit Names and Symbols
Unit symbols and various spellings of unit names are recognized by the package.
convert⁡32,units,km,m,convert⁡32,units,km,meter,convert⁡32,units,km,metres
32000,32000,32000
This feature is expandable so that, for example, you can specify metr (the Polish word for this unit) as an alternate spelling of meter. See the AddUnit help page for more information.
Some units can be recognized with SI or IEC prefixes.
convert⁡32000,units,m,km,convert⁡32000,units,m,kilometer,convert⁡32000,units,m,kilometres
32,32,32
Sample Questions with Solutions
How many miles do you travel in 35 minutes moving at 55 miles per hour?
distance≔convert⁡55⋅35,units,mph minutes,mi
distance≔38512
evalf⁡distance
32.08333333
How many seconds are equivalent to 3 weeks?
convert⁡3,units,weeks,s
1814400
How many inches are equivalent to 5 feet 4 inches?
4+convert⁡5,units,ft,inches
64
Convert 50 km/h to cm/s.
convert⁡50,units,kmh,cms
125009
evalf⁡
1388.888889
How many seconds does it take an object, released from rest, to fall 20 meters?
From the equation d=gn⁢t22, we derive:
elapsed_time≔2⋅distaccel
elapsed_time≔2⁢distaccel
eval⁡elapsed_time,dist=20,accel=convert⁡1,units,gn,ms2
2⁢400000⁢196133196133
2.019619976
What is the rest energy of an electron?
Assume the mass of an electron is 9.11⁢10−31 kilograms.
mass≔9.11⁢10−31
mass≔9.110000000⁢10−31
Approximate the speed of light by 3.00⁢108 meters per second.
c≔3.00⁢108
c≔3.000000000⁢108
Using the formula E=m⁢c2, you can approximate the rest energy of the electron.
E≔mass ⋅⁢c2
E≔8.199000000⁢10−14
A more precise answer can be found by converting the known unit the electron mass (em) to joules using energy conversions.
convert⁡1,units,em,J,energy
8.187104141⁢10−14
Approximately what volume does 1,000,000,000 US dollars worth of gold occupy?
cost≔1210.00 # US dollars per troy ounce November 18th, 2016
cost≔1210.00
density≔19.3 # grams per cubic centimeter
density≔19.3
mass≔1000000000convert⁡cost,units,USDouncetroy,USDg
mass≔2.570535273⁢107
volume≔massdensity
volume≔1.331883561⁢106
What is the length of one side of a cube with this volume?
length_side≔volume3
length_side≔110.0243351
This is in centimeters. Convert it to meters.
convert⁡length_side,units,cm,m
1.100243351
An Su-27 Flanker can travel at mach 1.1 at sea level. How fast is this in miles per hour, miles per second, and meters per second?
convert⁡1.1,units,M,mph
815.6003937
convert⁡1.1,units,M,mis
0.2265556649
convert⁡1.1,units,M,ms
364.606
Approximately how many meters are there in 3.5 miles?
convert⁡3.5,units,mi,m
5632.704000
round m
5633⁢m
Given 50 US gallons of water, how many 750 mL bottles could you fill?
convert⁡50,units,galUS_liquid,mL750
157725491625000
floor
252
Given nylon with a linear mass density of 20 deniers, what length of thread is used in an object weighing 12 grams?
12convert⁡20,units,deniers,gm # meters
5400
What is the volume in cubic inches of a 2 liter engine.
convert⁡2,units,L,inches3
2500000002048383
122.0474882
For a given phenomena with a frequency of 1.420,405,761 GHz, find the:
1. period,
2. number of cycles per year, and
3. number of cycles since the beginning of the earth.
First you must convert the frequency from GHz to Hz (cycles per second).
frequency≔1.420405761⁢convert⁡1,units,GHz,1s
frequency≔1.420405761⁢109
The period is:
1frequency
7.040241792⁢10−10
convert⁡,units,s,nanoseconds
0.7040241792
The number of cycles per year is:
convert⁡frequency,units,1s,1yr
4.482363838⁢1016
The number of cycles since the beginning of the earth (10,000,000,000 years ago) is:
frequency ⋅⁢convert10000000000,units,yr,s
4.482363838⁢1026
Given inductance and capacitance, find the resistance in microohms.
The following formula relates the resistance to the inductance and capacitance.
resistance≔inductancecapacitance
Use an inductance of 124 nanohenries and a capacitance of 3.52 microfarads.
eval⁡resistance,inductance=convert⁡124.,units,nH,uH,capacitance=3.52
0.1876892984
convert⁡0.1876892984,units,Ω,uOmega
187689.2984
Given a molar energy, find the mass energy in Btu's per pound.
molar_energy≔523.432; # Btu/mol(carbon)
molar_energy≔523.432
carbon_mass≔12 # kg/mol(carbon)
carbon_mass≔12
mass_energy≔molar_energyconvert⁡carbon_mass,units,kg,lb
mass_energy≔19.78539678
Given a distance function, find the speed by differentiation, speed at 2.5 seconds and at 5 blinks by evaluation, and distance traveled between 1 and 2.5 seconds by integration and by subtraction of the distance function values.
distance≔51+4⁢ⅇ−3⁢t
To find the speed function, differentiate the distance function.
speed≔ⅆⅆ t distance
speed≔60⁢ⅇ−3⁢t1+4⁢ⅇ−3⁢t2
To find the speed at 2.5 seconds, evaluate the speed function at t=2.5.
speedt=2.5|speedt=2.5
0.03303871496
To find the speed at 5 blinks, evaluate the speed function at t=5. blink, converted to seconds.
dt ≔ convert5., units, blink, s
dt≔4.320000000
speedy|xt=dt
0.0001411518555
By using a definite integral, you can determine the distance traveled from the speed function.
∫12.5speedⅆt
0.8193365798
The distance traveled can also be calculated directly from the distance function.
distancet=2.5distancet=2.5−distancet=1distancet=1
4.988962733−51+4⁢ⅇ−3
0.819336584
Find the minimum and maximum length of 1.2 yards, 1 meter, 3.2 feet, and 0.6 fathoms.
values≔op⁡zip⁡x,y↦convert⁡x,units,y,m,1.2,1,3.2,0.6,yd,m,ft,fathom
values≔1.097280000,1,0.9753600000,1.097280000
minvalues # meters
0.9753600000
maxvalues # meters
1.097280000
Given a torque of 3 newton meters, how much energy is required to move a lever through 10 degrees?
The energy required is the product of the torque and the angle in radians.
energy≔torque ⋅⁢angle
energy≔torque⁢angle
eval⁡energy,torque=3,angle=convert⁡10,units,deg,radians
π6
evalf # joules
0.5235987758
The Hyper-X can travel at speeds up to 7200 miles per hour. How long would it take to circle the earth at maximum speed (assuming it could carry sufficient fuel)? How far does it travel in a 10 second flight at maximum speed?
To find the time to circle the earth, divide the distance by the speed.
The meter was originally defined as 1/10,000,000 th the distance from the North Pole to the Equator on the meridian passing through Paris. Therefore, 40,000 kilometers is a good approximation of the circumference of the earth.
40000convert⁡7200,units,mph,kms # seconds
15625000012573
convert,units,s,h; # hours
390625113157
evalf # hours
3.452062179
To find the distance traveled, multiply the speed by the time.
10⁢convert7200,units,mph,ms; # meters
80467225
32186.88000
convert,units,m,km # kilometers
32.18688000
Given 1032 UK gallons of oil, how many cylindrical cans with a height of 1.2 feet and diameter of 0.9 feet could you fill?
The volume of a cylinder is h⁢π⁢d22.
convert1032,units,galUK,ft31.2⋅π⋅0.922; # unitless number
217.0284617
Given an power gain from 332 microwatts to 23 milliwatts, what is the gain in decibels? What would the decibel gain be if the increase were a voltage increase?
A gain is a quotient of the final value divided by the initial value.
gain≔convert⁡23,units,mW,uW332
gain≔575083
To determine the decibel gain, use the formula:
10⁢log10gain; # decibels
10⁢ln⁡575083ln⁡10
evalf; # decibels
18.40589752
Power is proportional to the square of the voltage. Therefore, the decibel increase corresponding to the voltage gain should be a factor of 2 times that of the power gain.
voltage_gain≔convert⁡23,units,mV,uV332
voltage_gain≔575083
20⁢log10voltage_gain; # decibels
20⁢ln⁡575083ln⁡10
36.81179504
Given an initial velocity of 2.4 meters per second and an otherwise unspecified uniform acceleration, what is the generic formula for position? For starting at the origin and acceleration being gravity in the opposite direction to the initial velocity? After 0.4 seconds?
The general formula for velocity in a uniform acceleration is:
v ≔ v0 + a⋅t
v≔a⁢t+v0
Substitute the given starting velocity.
vs ≔ vy|xv0 = 2.4ms
vs≔a⁢t+2.4⁢ms
Integrating this over time answers the first question.
x ≔x0 + ∫0t0vs ⅆt
x≔x0+0.5000000000⁢a⁢t02⁢sm2+2.400000000⁢t0⁢sm⁢m2s2
Starting at the origin and with the specified gravity:
gravity ≔ evalfScientificConstants:-Constantg, units;
gravity≔9.80665⁢ms2
xy|xx0 = 0m, a=−gravity
−4.903325000⁢t02⁢ms2⁢sm2+2.400000000⁢t0⁢sm⁢m2s2
After 0.4 seconds, this is the location:
y|xt0 = 0.4s
−0.7845320000⁢ms2⁢sm2⁢s2+0.9600000000⁢s⁢sm⁢m2s2
combine, units
0.1754680000⁢m
Return to Index for Example Worksheets.
Download Help Document