Re: using units and plotting
- To: mathgroup at smc.vnet.net
- Subject: [mg80912] Re: [mg80852] using units and plotting
- From: Bob Hanlon <hanlonr at cox.net>
- Date: Wed, 5 Sep 2007 02:56:37 -0400 (EDT)
- Reply-to: hanlonr at cox.net
I believe that David Park recently answered this question.
$Version
6.0 for Mac OS X x86 (32-bit) (June 19, 2007)
(* In earlier versions use
Needs["Miscellaneous`PhysicalConstants`"] *)
Needs["PhysicalConstants`"];
dist[t_, a_: AccelerationDueToGravity] := a t^2;
dist[t]
(9.80665*Meter*t^2)/Second^2
Plot[dist[t] /. {Meter -> 1, Second -> 1},
{t, 0 , 10}]
Plot[dist[t] /. Thread[Variables[dist[1]] -> 1],
{t, 0 , 10}]
Bob Hanlon
---- phillman5 <PHILLMAN5 at gmail.com> wrote:
> Is there any hints how to plot things other than downloading custom
> 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?
>
>