

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


Tuesday 7 October, 2006 - Due: Thursday 16 November
In this lab, you will take a closer look at a particular complex dynamical system, called a Julia Set. As in the case of the Sierpinski Triangle, the Julia sets display some interesting structures at all length scales. To see this, we will first highlight the structure with colors, then we will add a zooming feature. With these features, you’ll now be free to roam about the various Julia Sets.
Open julia.py in IDLE and run it. You should notice that it is a little faster than the version presented in class. Rather than using VPython’s box() for each picture-element (“pixel”), we are using VPython’s faces(), which is a low-level graphical object that lets us draw triangular faces. From this segment of code, observe that
while ( (abs(z) < 2.0) and (iter<MAXITS) ): z = z*z + a #JULIA iter += 1
if(iter==MAXITS): bins[i,j]=
marks the initial point in the complex plane black if it survives MAXITS iterations without escaping the circle of radius 2 in the complex plane. It might be interesting to see which points escape the circle of radius 2, color-coded by the number of iterations needed to escape. Download the code snippet color.py from the LABS page. Cut and paste this into the draw_region function after the line
if (bins[i,j]==MAXITS): mycolor=color.black
Delete the line which includes the else statement. Run the code and make a screen capture of the result for your writeup.
In our visualization of a Julia Set, we only sample a region of space with a finite fixed level of resolution in space and iteration-time. To see more detail, we would like to zoom in on a selected region of interest, in order to resample that region at a higher resolution.
Download the code snippet zoom.py from the LABS page. Cut and paste it at the bottom of your new julia.py code. Run the code and left click a particular part of the picture close to the boundary of the fractal. Include several screen captures as you successively zoom in on that region with further left mouse clicks. What happens when you right click with the mouse? Explore the Julia set with different values of a at various locations and at various length scales. Include screen-captures in your write-up. (Some interesting choices of this parameter are found the writeup for lecture 6)
A related fractal can be obtained by considering the Julia set map z = z^2 + a not as a function of z 0 , the initial value of z, but as a function of the complex parameter a (setting z 0 = 0 always). Modify your Julia set program to display the results of this – the so-called Mandelbrot fractal named after the discoverer of fractals Benoit Mandelbrot. It is perhaps the most famous fractal of them all. Capture a few pictures of this fractal at different resolutions for your writeup.