TI-84 Programs/Mandelbrot Set

I’ve been screwing around the TI-84 recently, and because I cannot write asm while I am on it, the only thing I can use is TI-BASIC.  I’ll start by posting one program I made after seeing a section in our math textbook involving imaginary numbers.  This man called Mandelbrot used recursive functions and the complex number plane to create interesting fractal drawings.

He made a formula that determines whether or not a complex number is included in his set of numbers.  They way he determined if a number in his set, is that he would first add an initial complex number to another number initially starting at zero squared, the he would add the starting complex number to this.  He then took that number and squared it, then and again added the initial complex number to it.  The steps keep on going, he then took the complex number from the last step, squared it, and again added the initial number.  If when he did these steps, the number proved to keep becoming infinitely large, it was not in his set.  If the absolute value of the sum at each step always remained under 2, it was included in the set.  When you plot these numbers on the complex number plane, it can make some neat images.

An Example of the Mandelbrot set.  THe black represents points that are in the set.

An Example of the Mandelbrot set. THe black represents points that are in the set.

The cool thing about these images is that as you zoom in, there is an infinite level of detail.  The black figure above will always exist in some part of the set no matter how far you zoom in, as well as many other common patterns.

When you test these points to see whether or not they are actually in the Mandelbrot set, you need to basically set a point at which you will just stop squaring and adding numbers and just assume that it is part of the set.  The amount of times you try this is the number of iterations.  The higher the iteration count, the more accurately it resembles the shape of the actual set, but the longer it takes to calculate.

Now for seeing this set calculated on the TI-84, you have to have a bit of patience.  These calculators use the same processor architecture as the original Pac-Man machine.  To draw one of the Mandelbrot fractals at 40 iterations at the screen’s resolution of 94×62, it took me a little over an hour.  To see these fractals at much higher resolutions, iterations, and hundreds of times faster, you can use more recent software such as Chaos Pro to view the Mandelbrot set, as well as other fractals.  If you are interested in seeing this on your TI calculator, be my guest.  The code I used for is is as follows:

ClrDraw

Disp “ITERATIONS”

Input N

For(A,Xmin,Xmax,(ΔX))

For(B,Ymin,Ymax,(ΔY))

A+Bi→C

0→K

For(I,N,2,-1)

K² +C->K

if abs(K)>2

Then 1→I

End

if I=1

Then

Pt-On(A,B)

End

End

End

End

Try something around 8 Iterations if you want to see results relatively quickly, and set the Xmin to -1.5 Xmax to .5 Ymin to -1 and Ymax to 1.  I am currently looking at a completed drawing at 40 iterations, but I have unfortunately misplaced my computer cable and cannot upload an image off of it.

P.S.  I’m sorry for any inaccuracies in this post.  I just learned about the subject today and I am likely to be wrong about many things

No Comments

Site redone

I cleaned up the site a little.  I got rid of that ugly frontpage and installed WordPress with a nice looking template.

No Comments