Professional Documents
Culture Documents
Physical units
collapse all in page
Syntax
unit::nam
Description
Objects such as unit::m, unit::kg, unit::sec etc. represent the physical units "meters",
"kilograms", "seconds" etc.
domain provides some methods for simplifying and converting arithmetical
expressions involving such units.
unit
objects such as unit::m or unit::kg serve for representing physical units. They
are domain objects of domain type unit.
unit
These objects behave like symbolic names (identifiers) and can be used to build
arithmetical expressions involving numbers and symbols such
as3*unit::m^2 or a*unit::cm + b*unit::inch^2/unit::mm. Units must be used
consistently in expressions, and should be specified for unknown variables so that the
variables themselves are dimensionless. In calls to solve, you should always solve for
dimensionless variables by specifying the dimensions. Cf. Example 3.
Expressions such as 20*unit::cm + 0.3*unit::m involving several units of the same type
(length,' mass,' time' etc.) are not simplified automatically.
Useunit::convert, unit::simplify, simplify, or Simplify to convert all subexpressions to
common units. These routines are described further down below.
On input, use the prefix unit:: as in unit::mm, unit::km for millimeters, kilometers etc.
On the screen, this prefix is stripped off. For example,1.23*unit::mm is displayed
as 1.23 mm.
The available units are listed further down below.
Note that some units such as unit::mm, unit::millimeter and unit::millimeters represent
the same physical unit. Use an interactive command such as info(unit::oz) to find
information on unit::oz including all the alternative names that can be used in MuPAD .
Cf. Example 7.
Note: Beware: If you mix different MuPAD units representing the same physical unit, no automatic simp
Use simplify to simplify an expression such as 2*unit::m + 3*unit::meter to 5*unit::m.
Expressions such as unit::kg*(unit::m/unit::s)^2 can be used to represent a composite
unit. You can convert them to other units such asunit::Joule via unit::convert.
Some of the conversion factors between the various units are given by exact rational
numbers (e.g., unit::inch = 127/50*unit::cm), while others are linked by floating-point
am, f (= Fermi
Ao
nm
My (= micron = microns
mm
dm
pt
ft (= foot
yd (= yard
AU (= AE), ly
ch, fm
li
= fermi), XU (= Xu = xu = XE), pm
Mass:
mg
kg (= kilogram
oz (= ounce
lb (= pound
cwt_UK
Pfd
dz
= microgram = micrograms)
(= Doppelzentner = doppelzentner)
Time:
mcsec
ms
h (= hour
week
year
Temperature:
K (= kelvin
Rankine
Plain Angle:
degree
Solid Angle:
sr (= steradian)
byte
Tbyte
bps
Bd (= Baud = baud)
Velocity:
Acceleration:
Gal, gn
Force:
ozf, tonf
Torque (= Energy):
Angular Momentum:
Nms
(= Newtonmetersec = newtonmetersec)
= newt
Energy, Work:
aJ
mJ
J (= Joule
kJ
GJ
cal
daeV, heV, keV, MeV, GeV, TeV, PeV, EeV, PSh, erg, Btu, therm
(= Calory = calory), kcal, aeV, feV, peV, neV, mceV, meV, ceV, deV, eV
Power:
tt)
mW
kW
Frequency:
GHz
= Mhertz)
Pressure, Stress:
mcbar
kbar
= pascal)
Area:
a (= are
ro
Volume:
pottle, pint_UK, pk_UK, qt_UK, gill, gill_UK, floz, floz_UK, fldr, fldr_UK
minim, minim_UK, liq_qt, liq_pt, dry_bu, dry_pk, bbl, dry_gal, dry_qt, dry_pt
European Currency:
cent
(= Cent), EUR (= EURO = Euro), ATS, DEM (= DM), BEF, ESP, FIM, FRF, LUF
Molecular Substance:
mmol
(= mMol), cmol, dmol, mol (= Mol), damol, hmol, kmol (= kMol), Mmol
mcA
(= nAmpere = nampere)
cA, dA, A
Electric Voltage:
mcV
V (= Volt
kV (= kVolt = kvolt)
MV (= MVolt
Electric Resistance:
aOhm
mcOhm
mOhm
Mohm)
GOhm
Electric Charge:
GC, TC
PC, EC
Electric Capacity:
aF, fF, pF
mcF
mF
kF
Electric Conductance:
S (= Siemens
Magnetic Inductance:
= siemens)
H (= Henry
= henry)
Magnetic Flux:
Wb (= Weber
Oe
(= Oersted = oersted)
Gb
(= Gilbert = gilbert)
Luminous Intensity:
Luminance:
Luminous Flux:
lm (= lumen)
Illuminance:
lx
(= lux), ph (= phot), nx
Radiation:
langley
Radioactivity:
= becquerel), daB
(= Curie)
Equivalent Dosage:
Sv (= Sievert
rem
Absorbed Dosage:
aGy,fGy,pGy,nGy,mcGy,mGy,cGy,dGy, Gy
y, GGy
TGy,PGy,EGy, rd
Ionising Dosage:
R (= Roentgen)
Lens Power:
dpt (= diopter
= dioptre)
Dynamic Viscosity:
P (= Poise)
Kinematic Viscosity:
St
(= Stokes)
Examples
Example 1
unit::convert(unit::km/unit::hour, unit::m/unit::sec)
Example 2
unit::simplify
unit::simplify(1.23*unit::kg^2/unit::pound*unit::inch^2/unit::mm)
Example 3
Specify units for unknown variables so that the variables you solve for are
dimensionless. If you apply units inconsistently, you get incorrect results.
Demonstrate this by omitting the unit for an unknown variable in an equation and
solving the equation. The solve function cannot solve the equation.
L := 1*unit::m:
y := 0.1*unit::m:
f := y - x*cos(L/x):
solve(f,x)
Solve the equation for the unknown variable by specifying the correct unit for the
variable.
f := y - x*unit::m*cos(L/(x*unit::m)):
solve(f,x)
Example 4
Now, the unit unit::SpeedOfLight exists and can be used like any other unit in
the unit domain. We use it to define yet another velocity unit:
unit::newUnit(Warp9 = 1.516*unit::SpeedOfLight)
We convert the velocity of 123.4 miles per hour into the new speed units:
unit::convert(123.4*unit::mile/unit::hour, unit::SpeedOfLight)
unit::convert(123.4*unit::mile/unit::hour, unit::Warp9)
unit::convert(unit::Warp9, unit::SpeedOfLight)
unit::convert(unit::Warp9, unit::km/unit::sec)
Example 5
float(%)
simplify(%)
unit::convert(%, unit::ounce)
Example 6
The probably most interesting method of the unit domain is the conversion
routine unit::convert. Given any expression involving units, you can specify a target
unit which is to be used to express the units:
unit::convert(unit::ounce, unit::kilogram)
The target unit needs not be of the same physical type as the expression that is to be
rewritten. In the following example, we wish to rewrite a torque (given in "Newton
meters") in terms of units involving the power unit "Watt." Note that a torque is an
energy, i.e., "power" multiplied by "time":
unit::convert(1.23*unit::Nm, unit::W)
The target unit may be a composite expression. We wish to rewrite "Newton meters" in
terms of "grams," "centimeters," and "milliseconds":
unit::convert(unit::Nm, unit::g*unit::cm^2/unit::msec^2)
Example 7
The info command
units:
mass := 2*unit::cal*unit::msec^2/unit::inch^2 - 45*unit::carat
unit::convert2SIunits(mass)
delete mass:
Example 9
Most system functions such as dif, factor, normal etc. treat units like ordinary symbolic
identifiers:
dif(x/unit::m*exp(-x^2/unit::m^2), x)
factor(%)
Parameters
The name of the physical unit, see the list below. Some units
such as unit::mm and unit::millimeter represent the same
physical unit.
nam
Methods
collapse all
expressed by the same mass unit, all time units are expressed by the same time unit etc.
newUnit Define a new unit
newUnit(newname = expression)
unit::newUnit(newname = f*oldunit) creates a new unit that may be addressed
by unit::newname. Its name newname must be an identifier. It is declared as the f-fold
of some unit oldunit that must be an expression such as unit::mm/unit::sec involving
units provided by the unit domain. The conversion factor f must be an arithmetical
expression (typically, a numerical conversion factor).
display Format for output
formats the screen output of the arithmetical expression x such that the units
appear as a separate factor at the end of each term.
display(x)