MathGroup Archive 2009

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

Search the Archive

Re: How to handle Units of Measure

  • To: mathgroup at smc.vnet.net
  • Subject: [mg100475] Re: How to handle Units of Measure
  • From: John Jowett <John.M.Jowett at gmail.com>
  • Date: Fri, 5 Jun 2009 03:01:53 -0400 (EDT)
  • References: <gvlhom$djb$1@smc.vnet.net>

You could try the Accelerator`ConstantsUnits` package, I have
mentioned in previous posts:

http://jowett.home.cern.ch/jowett/Accelerator/ConstantsUnits.html

Then a numerical version of your example (choosing unusual frequency
units just to demonstrate the power)  is

Z = R + I*w*L /. {R -> 10.*Ohm, w -> 300000./Day, L -> 5.*Henry}

Convert[Z,Ohm]

which returns

(10. + 17.3611 I) Ohm

A symbolic version would be


Z = R + I*w*L /. {R -> rO*Ohm, w -> wD/Day, L -> lH*Henry}


Convert[Z, Ohm]

returning

Ohm*(rO + (I*lH*wD)/86400)

It all looks better in a notebook of course.

John Jowett

On May 28, 10:24 am, Alexei Boulbitch <Alexei.Boulbi... at iee.lu> wrote:
> In this very simple example if I write
> R+iwL
> 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 ?
> Thanks
>
> Hi, Theodoro,
> I do it this way, simple enough:
>
> In[30]:=    R := x*Ohm;
>                 w := z*Hz;
>                 L := y*H;
>                 H = Ohm/Hz;
>                 R + w*L // Simplify
>
> Out[34]= Ohm (x + y z)
>
> --
> Alexei Boulbitch, Dr., habil.
> Senior Scientist
>
> IEE S.A.
> ZAE Weiergewan
> 11, rue Edmond Reuter
> L-5326 Contern
> Luxembourg
>
> Phone: +352 2454 2566
> Fax:   +352 2454 3566
>
> Website:www.iee.lu
>
> This e-mail may contain trade secrets or privileged, undisclosed or other=
wise confidential information. If you are not the intended recipient and ha=
ve received this e-mail in error, you are hereby notified that any review, =
copying or distribution of it is strictly prohibited. Please inform us imme=
diately and destroy the original transmittal from your system. Thank you fo=
r your co-operation.



  • Prev by Date: Re: directionfields from StreamPlot looks different from
  • Next by Date: Re: what is my error?
  • Previous by thread: Re: How to handle Units of Measure
  • Next by thread: Re: slightly malfunctioning Help -- a followup