MathGroup Archive 2000

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

Search the Archive

Re: Complex Function Plot

  • To: mathgroup at
  • Subject: [mg25577] Re: [mg25541] Complex Function Plot
  • From: BobHanlon at
  • Date: Mon, 9 Oct 2000 01:16:42 -0400 (EDT)
  • Sender: owner-wri-mathgroup at

In a message dated 10/7/2000 3:51:14 AM, rlbrambilla at writes:

>I have often to plot the real and the imaginary part
>of a complex valued function of a real variable : f(t).
>The obvious solution is
>      PlotStyle->{Hue[.7],Hue[.9]}]
>and the function is evaluated two times for each value of t. 
>In the case of a long-time-eating function (as in the case
>of series expansions with hypergeometric f.,integrals with
>parameters,etc) it would be suitable a trick to evaluate 
>f[t] only once.
>I'd like also to avoid to use interpolation like
>      PlotStyle->{Hue[.7],Hue[.9]}]
>since it requires the optimum choice of n, mr and mi
>for each (t1,t2) interval, especially if the two parts
>oscillate with very different periods. 
>I use Math. version 3.0 .
>Any suggestion will be greatly appreciated.

f[t_] := Cos[t] + I*Sin[t];

Plot[{f[t] // Re, f[t] // Im}, {t, 0, 2*Pi}, 
    PlotStyle -> {Hue[.7], Hue[.9]}] // Timing

Plot[Evaluate[{(func = f[t]) // Re, func // Im}], {t, 0, 2*Pi}, 
    PlotStyle -> {Hue[.7], Hue[.9]}] // Timing

Bob Hanlon

  • Prev by Date: Graphing Hyperboloids
  • Next by Date: Re: Can I force arbitary precision
  • Previous by thread: Re: Complex Function Plot
  • Next by thread: Complex Function Plot