       Re: using units and plotting

• To: mathgroup at smc.vnet.net
• Subject: [mg80878] Re: using units and plotting
• From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
• Date: Wed, 5 Sep 2007 02:28:35 -0400 (EDT)
• Organization: The Open University, Milton Keynes, UK
• References: <fbj32s\$nlr\$1@smc.vnet.net>

```phillman5 wrote:

> packages when you use units?  To plot position verus time.
>
> <<Units`
> dist:= a t^2
> a=9.8 Meter/Second^2
> Plot[dist,{t, 0 Second, 10 Second}]
>
> Does not work.  Of course you can use
>
> Plot[dist/Meter,{t, 0 Second, 10 Second}]
>
> to make the y axis unitless, but how about the x axis?

You could use a set of transformation rules as shown below in In.

In:= << Units`
dist := a t^2
a = 9.8 Meter/Second^2
Plot[dist, {t, 0 Second, 10 Second}]

Out= (9.8 Meter)/Second^2

During evaluation of In:= Plot::plln: Limiting value 10 Second in \
{t,0 Second,10 Second} is not a machine-size real number. >>

Out= Plot[dist, {t, 0 Second, 10 Second}]

In:= Plot[dist /. {Meter -> 1, Second -> 1}, {t, 0, 10}]

[... graphic deleted ...]

--
Jean-Marc

```

• Prev by Date: Re: StringCases kills Kernel
• Next by Date: Formula simplify for Solve
• Previous by thread: Re: using units and plotting
• Next by thread: Re: using units and plotting