MathGroup Archive 2007

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

Search the Archive

Re: Mathematica 6.0 Desperation

  • To: mathgroup at smc.vnet.net
  • Subject: [mg83670] Re: Mathematica 6.0 Desperation
  • From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
  • Date: Wed, 28 Nov 2007 05:26:04 -0500 (EST)
  • Organization: The Open University, Milton Keynes, UK
  • References: <figtq9$fa7$1@smc.vnet.net>

Jesus M. Goiri wrote:

>  I have tried some items that seem to hang Mathematica 6.0. However  
>  they work perfectly fine in the 5.2 version. I have tried to  
>  discover the flaw and I have not been able to do so. The problem  
>  pertains at some code I extracted from a book about Mathematica  
>  applications by Boccara, particularly the examples that relate to  
>  fractals, Julia and Mandelbrot Sets.
> 
>  I have below the lines of code. I you try them, I'd wish to see if  
>  you are able to make them work.
> 
>  Yours sincerely,
> 
>  Jesus M, Goiri
> 
>  Clear[JuliaTest]
>  JuliaTest = Compile[{x, y, {n, _Integer}, {c, _Complex}},
>    Module[{z, num = 0}, z = x + y I;
>      While[Abs[z] < 2.0 && num < n, z = z^2 + c; num++]; num]]
>  DensityPlot[JuliaTest[x, y, 50, -0.75 + 0.5 I],
>  {x, 1.24, 1.27}, {y, -0.13, -0.1}, PlotPoints -> 500,
>  Mesh -> False, ColorFunction -> Hue]

The graphic engine in v6 has changed dramatically. The option 
*PlotPoints* set to 500 is much to high. Use a smaller value and 
increase it if needed (and keep in mind that there exists now several 
other options that control the speed and the quality of a plot). The 
following example use the default value for *PlotPoints* and plots the 
Julia set in matter of seconds.

Clear[JuliaTest]
JuliaTest =
  Compile[{x, y, {n, _Integer}, {c, _Complex}},
   Module[{z, num = 0}, z = x + y I;
    While[Abs[z] < 2.0 && num < n, z = z^2 + c; num++]; num]]

DensityPlot[
  JuliaTest[x, y, 50, -0.75 + 0.5 I], {x, 1.24,
   1.27}, {y, -0.13, -0.1}, PlotPoints -> Automatic, Mesh -> False,
  ColorFunction -> Hue]

Regards,
-- 
Jean-Marc


  • Prev by Date: Re: Mathematica 6.0 Desperation
  • Next by Date: Re: Mathematica 6.0 Desperation
  • Previous by thread: Re: Mathematica 6.0 Desperation
  • Next by thread: Re: Mathematica 6.0 Desperation