MathGroup Archive 2008

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

Search the Archive

Re: Re: Complex Plot

  • To: mathgroup at smc.vnet.net
  • Subject: [mg88315] Re: [mg88288] Re: Complex Plot
  • From: "Jean-Marc Gulliet" <jeanmarc.gulliet at gmail.com>
  • Date: Thu, 1 May 2008 03:22:45 -0400 (EDT)
  • References: <fv9a83$mjo$1@smc.vnet.net> <200804301103.HAA04939@smc.vnet.net>

On Wed, Apr 30, 2008 at 2:52 PM, W_Craig Carter <ccarter at mit.edu> wrote:

> Hello Jean-Marc,
>  In 6.0, we can use ContourPlot for implicit equations, but the timing
>  seems much slower that what you are getting:
>
>  Timing[cp1 =
>    ContourPlot[Sin[x^2*y] == Log[x/y], {x, -12, 35}, {y, -8, 23}];]
>  (*about 1 second my machine)
>
>  cp1
>
>  Timing[cp2 =
>
>    ContourPlot[Sin[x^2*y] == Log[x/y], {x, -12, 35}, {y, -8,
>  23},PlotPoints-> 25];]
>  (*about 3 seconds my machine*)
>
>  cp2
>
>  Timing[cp3 =
>
>    ContourPlot[Sin[x^2*y] == Log[x/y], {x, -12, 35}, {y, -8,
>  23},PlotPoints-> 50];]
>  (*about 15 seconds my machine*)
>
>  Timing[cp3 =
>
>    ContourPlot[Sin[x^2*y] == Log[x/y], {x, -12, 35}, {y, -8, 23},
>     PlotPoints -> 75];]
>  (*about 36 seconds my machine*)
>
>  The estimate is about 1/2 hour on my machine (if no swapping)...
>
>  So, unless your machine is about 6 times faster than mine, the
>  implicit version is slower...
>
>  However, PlotPoints->50, seems to be sufficient to see the lovely structure.

Hi Graig,

My machine is about 10% slower than yours, indeed. (I have just ran
the test you provided.) The "magic" in my original code was to use a
high number of points but to turn off the adaptive algorithm by
setting the option  MaxRecursion to zero. For instance, the fourth
plot (75 points) took about 40 seconds with the default settings,
while it took only 0.75 second with MaxRecursion->0. That explains the
huge discrepancy in timing and why I could claim that it took only few
minutes for Mathematica to draw the plot with a sampling of 500
points. (Note that the memory consumption is relatively slow too.)

Timing[cp1 =
   ContourPlot[Sin[x^2*y] - Log[x/y], {x, -12, 35}, {y, -8, 23},
    MaxRecursion -> 0, PlotPoints -> 25];]
(*about 0.04 seconds my machine*)
cp1

Timing[cp2 =
   ContourPlot[Sin[x^2*y] - Log[x/y], {x, -12, 35}, {y, -8, 23},
    MaxRecursion -> 0, PlotPoints -> 25];]
(*about 0.07 seconds my machine*)
cp2

Timing[cp3 =
   ContourPlot[Sin[x^2*y] - Log[x/y], {x, -12, 35}, {y, -8, 23},
    MaxRecursion -> 0, PlotPoints -> 50];]
(*about 0.29 seconds my machine*)
cp3

Timing[cp4 =
   ContourPlot[Sin[x^2*y] - Log[x/y], {x, -12, 35}, {y, -8, 23},
    MaxRecursion -> 0, PlotPoints -> 75];]
(*about 0.73 seconds my machine*)
cp4



>
>  On Wed, Apr 30, 2008 at 7:03 AM, Jean-Marc Gulliet
>  <jeanmarc.gulliet at gmail.com> wrote:
>  > Chris Degnen wrote:
>  >
>  >  > Can anyone tell me how I can re-express this
>  >  > equation in terms of x for plotting?
>  >  >
>  >  > Sin[x^2*y]==Log[x/y]
>
>  >
>
> >  ContourPlot[Sin[x^2*y] - Log[x/y], {x, -12, 35}, {y, -8, 23},
>  >   ImageSize -> 500]
>  >
>  >  ContourPlot[Sin[x^2*y] - Log[x/y], {x, -12, 35}, {y, -8, 23},
>  >   ImageSize -> 500, ColorFunction -> (White &), ContourStyle -> Black,
>  >   MaxRecursion -> 0, PlotPoints -> 500]
>
>
>
> >  Hope this helps,
>  >  -- Jean-Marc
>  >
>  >
>
>
>
>  --
>  W. Craig Carter
>


Best regards.
-- 
Jean-Marc


  • Prev by Date: Re: Does Mathematica really need more printed, introductory documentation?
  • Next by Date: Re: diff equation
  • Previous by thread: Re: Re: Complex Plot
  • Next by thread: function to check if array is empty