MathGroup Archive 2003

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

Search the Archive

FW: A better Units package

  • To: mathgroup at smc.vnet.net
  • Subject: [mg40725] FW: A better Units package
  • From: "Ersek, Ted R" <ErsekTR at navair.navy.mil>
  • Date: Tue, 15 Apr 2003 03:58:36 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

> Recall the recent thread (Weirdness with symbol Degree vis Units).  This
> thread discussed the fact that Mathematica uses \[Degree] as a unit and as
> a numeric value.  
> 
> I wrote an "improved" units package that solves the problem mentioned in
> this thread and posted it at:  
>    http://library.wolfram.com/infocenter/MathSource/4283/
> 
> Here are some things that my package does better than other Units
> packages.
> -------------------------------------
> 
> In[1]:=  Sqrt[ 20 + 5 + 16*25*Pi ]  Ohm
> 
> Out[1]=  Sqrt[ 25 + 400 Pi^2 ]  Ohm
> 
> Without my package the above output doesn't look write because the Ohm
> would be displayed before the Sqrt[ ].
> 
> -------------------------------------
> 
> In[2]:=  t1 = 5 Second;
>             t2 = 2 Second;
>             t3 = 3 Second;
>             t1 - t2 - t3
> 
> Out[5]=  0 Second
> 
> Normally you get simply zero in the last output because zero times
> anything is zero.
> 
> -------------------------------------
> 
> In[6]:=  Convert [ 0.36 Radian,  /[Degree] ]
> 
> Out[6]=  20.6265 \[Degree]
> 
> ------------------------------------
> 
> In[7]:=  Sqrt[ (2 Second)^2 - (1.99 Second)^2 ]
> 
> Out[7]=  0.19975 Second
> 
> My package automatically uses PowerExpand on symbols that are units.
> 
> 
> ----------------------
> Regards,
>    Ted Ersek
> 
> Download Mathematica Tips & Tricks from: 
> http://www.verbeia.com/mathematica/tips/Tricks.html
> 
> 
> 


  • Prev by Date: Re: Calculating Easter
  • Next by Date: Re: Simplification of definite integral?
  • Previous by thread: Re: Problem solving equation
  • Next by thread: Re: MathLink with C++