MathGroup Archive 2006

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

Search the Archive

Re: Making plots using transformation rules


David Park wrote:
>  >> From: amannuc at yahoo.com [mailto:amannuc at yahoo.com]
>> 
>> I've read about making plots of functions, for example:
>> 
>> Plot[Evaluate[f[x]], {x, 0, 10}]
>> 
>> I don't have this sort of function to plot. Because it involves
>> derivatives, I only get numerical output after defining a
>> transformation rule. A simple example (not the real one) is the
>> following:
>> 
>> g[t_] := D[t^2, t]
>> g[t] /. t -> 1
>> 
>> I cannot evaluate g[1], because then Mathematica thinks I am trying to
>> take a derivative with respect to the number 1, and flags that as
>> error. So I need the transformation rule to get function values.
>>
> Why do you use a SetDelayed instead of a simple Set?
> 
> g[t_] = D[t^2, t]
> 2 t
> 
> Plot[g[t], {t, 0, 10}]; 

Or even more simply,

g[t_]=t^2

Plot[g'[t],{t,0,10}]

-- 
Helen Read
University of Vermont


  • Prev by Date: Re: Numerical Integration
  • Next by Date: Re: How can I get this spiked Integral evaluated???
  • Previous by thread: Re: Making plots using transformation rules
  • Next by thread: (revision) NIntegrate that upper limit is infinite