MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: How to handle Units of Measure

Use the Units package that is listed in the Standard Extra Packages section
of the Documentation Center. It is loaded with the following statement:


(You may also sometimes wish to use the Physical Constants package.) Then my
recommendation is to never use units directly in symbolic equations but make
them part of the data values and substitute these only at the conclusion of
any symbolic manipulations you might do, such as solving symbolic equations.
Solving equations that contain some units and/or data values is usually a
mess. So, for example, define a set of data:

data = {R -> 5 Ohm, w -> .25 Mega Hertz, L -> 5 Micro Henry};

Then you could use this in your expression, which just for fun I have
converted to an equation, as follows:

Z == R + I w L
% /. data
MapAt[Convert[#, Ohm] &, %, 2]         giving

Z == R + I L w
Z == 1.25 I Henry Hertz Mega Micro + 5 Ohm
Z == (5 + 1.25 I) Ohm

The ExtendUnits6 package at my web site ($30) contains a number of features
that make it more convenient to use units in physical problems: more
convenient postfix form of conversion; ability to automatically pick prefix
forms and keep them before the unit; ability to parse compatible descending
units such as hours, minutes, seconds; ability to install new units or
synonyms such as mph; ability to deunitize expressions to any specified
implied set of compatible input and output units; ability to used reduced
unit systems such as geometric units in particle physics, or atomic units
where certain physical constants are set to 1; ability to convert
approximate value degrees; and ability to convert any kind of decibel units.

David Park
djmpark at  

From: Teodoro [mailto:jwheeler51 at] 

In this very simple example if I write
where R is measured in Ohms, w in s^-1, L in H, I expect that the
result is given in Ohms.
Why it doesn't happen in Mathematica ? Ho can I do to handle in a
simple way those conversions ?

  • Prev by Date: Re: Bug of NotebookRead
  • Next by Date: Re: Re: Logscale Tick Function
  • Previous by thread: How to handle Units of Measure
  • Next by thread: Re: How to handle Units of Measure