MathGroup Archive 2007

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

Search the Archive

Re: plotting equations with units

  • To: mathgroup at smc.vnet.net
  • Subject: [mg80863] Re: plotting equations with units
  • From: John Jowett <John.M.Jowett at gmail.com>
  • Date: Tue, 4 Sep 2007 06:32:37 -0400 (EDT)
  • References: <fbaqpi$qbs$1@smc.twtelecom.net>

Hello,
      I felt this need several years ago also and implemented a
function which allows you to do things like

PhysicalUnitsPlot[ x^2 +(10 Meter)  x,{x,1 Meter,20 Foot}]

PhysicalUnitsPlot[Eb^2,{Eb,.5 Nano Pascal Meter^3,5 GeV}]

i.e., the range of the x-axis is specified with explicit units and the
maximum and minimum can even be different provided they are of
physically equivalent dimensions.  The units are also included in the
axis labels.

I must admit, though, that since developing it I have hardly ever used
this function ...

You can download a version of the package containing this from:

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

The package notebook contains examples.

This is for Mathematica Version 5.2.  An update for Version 6 is more
or less ready but still being checked and will be available in a
different form.  Let me know if you would like an advance copy.

John Jowett
On Sep 1, 6:45 am, phillman5 <PHILLM... at gmail.com> wrote:
> If you have loaded the units package and have used units in your
> equations, is there an easy way to plot the equations?  For the y data
> you can easily divide by the 'units' to get a unitless number
>
> Plot[eq/units,{x, start,end}]
>
> but what about the x values?  If they have units, the plot functions
> croaks.  I suppose you can always make a table and use listplot, but
> there should be an easier way.  I have seen some people here with
> packages to download, is there a consensus on the best third part
> solution.  I'd like a universal solution that would work with other
> plotting functions too.
>
> I am using version 6.




  • Prev by Date: Re: Insert a Mathematica-Notebook
  • Next by Date: Re: Plot question
  • Previous by thread: Re: plotting equations with units
  • Next by thread: Re: How to use InputField inside Manipulate?