How Do I Use Units in Mathematica?
In order to make use of units in Mathematica, it is useful to load the
Miscellaneous`Units` package.
Needs["Miscellaneous`Units`"]
When this package is loaded, 270 units of measure and five
functions used for conversion are defined. The conversion
functions are Convert, ConvertTemperature,
SI,
CGS, and MKS. Units are
treated as any other symbol in Mathematica, so expressing a number
with a unit is like multiplying a number by a symbol.
Most units
defined in this package are singular, not plural, so always use
the singular form to be safe. For example, this package uses 3 Acre, not
3 Acres. There are some exceptions to this rule. For
example, you can use Feet or Foot. A
complete list of symbols can be found below.
Numbers with units can be multiplied.
12 Foot * 16 Foot
192 Foot2
More complicated units can also be used.
85 Meter/Second * 10 Second
850 Meter
Conversions between units can be carried out.
Convert[78 Pole, Foot]
1287. Foot
Convert[9.8 Meter/Second, Foot/Second]

Converting between temperature units is handled differently. For this
reason, a separate function is defined to handle temperature conversions.
ConvertTemperature[212, Fahrenheit, Celsius]
100
Here is a list of all of the symbols defined when the
Miscellaneous`Units` package is loaded.
Flatten[Names/@{"Miscellaneous`Units`*",
"Miscellaneous`SIUnits`*"}]
{Abampere, Abcoulomb, Abfarad, Abhenry, Abmho,
Abohm, Abvolt, Acre, AMU, Angstrom, Apostilb, ArcMinute, ArcSecond, Are,
AssayTon, AstronomicalUnit, Atmosphere, AtomicMassUnit, Atto, AU, AvoirdupoisOunce,
AvoirdupoisPound, Bag, BakersDozen, Bale, Bar, Barn, Barrel, Barye, Baud, Biot, Bit,
BoardFoot, BohrMagneton, Bolt, BritishThermalUnit, BTU, Bucket, Bushel, Butt, Cable,
Caliber, Calorie, Candle, Carat, Celsius, Cental, Centi, Centigrade, Centimeter, Century,
CGS, Chain, ChevalVapeur, Cicero, Convert, ConvertTemperature, Cord, Cubit, Cup, Curie,
Dalton, Day, Deca, Decade, Deci, Denier, Didot, DidotPoint, Diopter, Dozen, Drachma, Dyne,
ElectronVolt, Ell, Ephah, Erg, Exa, Fahrenheit, Fathom, Feet, Femto, Fermi, Fifth, Firkin,
FluidDram, FluidOunce, Foot, FootCandle, Fortnight, Furlong, Gal, Gallon, Gauss, Geepound,
Giga, Gilbert, Gill, Grade, Grain, Gram, GramWeight, Gravity, Gross, GrossHundredweight,
Hand, Hectare, Hecto, Hefner, Hogshead, Horsepower, Hour, Hundredweight, ImperialGallon, I
mperialPint, Inch, InchMercury, Jeroboam, Jigger, Kayser, Kilo, KilogramForce, KilogramWeight,
Knot, Lambert, League, Libra, LightYear, Link, Liter, Lumerg, Magnum, Maxwell, Mega,
MetricTon, Mho, Micro, Micron, Mil, Mile, Millennium, Milli, MillimeterMercury, Mina, Minim,
Minute, MKS, Month, Nano, NauticalMile, NetHundredweight, Nibble, Nit, Noggin, NuclearMagneton,
Obolos, Oersted, Omer, Ounce, Parsec, Peck, Pennyweight, Percent, Perch, Peta, Phot, Pica,
Pico, Pint, Poise, Pole, Pondus, Pony, Pound, Poundal, PoundForce, PoundsPerSquareInch,
PoundWeight, PrintersPoint, PSI, Puncheon, Quadrant, Quart, Quintal, Rad, Radian, Rankine,
RegisterTon, Reyn, Rhes, RightAngle, Rod, Roentgen, Rontgen, Rood, Rope, Rutherford,
Rydberg, Seam, Section, Shekel, ShortHundredweight, ShortTon, Shot, SI, SiderealSecond,
SiderealYear, Skein, Slug, SolarMass, Span, Stadion, Stadium, Statampere, Statcoulomb,
Statfarad, Stathenry, Statohm, StatuteMile, Statvolt, Steradian, Stere, Stilb, Stokes,
Stone, SurveyMile, Tablespoon, Talbot, Talent, Teaspoon, Tera, Therm, Ton, TonForce,
Tonne, Torr, Township, TropicalYear, TroyOunce, Tun, UKGallon, UKPint, Week, Wey,
WineBottle, XUnit, Yard, Year, Yocto, Yotta, Zepto, Zetta, Amp, Ampere, Becquerel,
Candela, Coulomb, Farad, Gray, Henry, Hertz, Joule, Kelvin, Kilogram, Lumen, Lux,
Meter, Mole, Ohm, Pascal, Siemens, Tesla, Volt, Watt, Weber}
For more information on units and their use in
Mathematica, refer to the Documentation
Center and The Beginner's
Guide to Mathematica Version 4 by Jerry Glynn and Theodore Gray.
| |