Mathematics 3DC3
ASSIGNMENT 5 Solutions
3.
#sierpinski.ode
#drawing the Sierpinski triangle
#
par c0=0,c1=2,c2=4
par d0=0,d1=2,d2=0
p=flr(ran(1)*3)
dx/dt=.5*x+.5*shift(c0,p)
dy/dt=.5*y+.5*shift(d0,p)
@ xp=cx,yp=cy
@ maxstor=20000000,total=20000,meth=discrete
@ xlo=0,xhi=4,ylo=0,yhi=2,lt=0
@ xp=x,yp=y
aux pp=p
done
0
0.2
0.4
0.6
0.8
1
1.2
1.4
1.6
1.8
0 0.5 1 1.5 2 2.5 3 3.5
Figure 1: 3. Sierpinsky triangle with vertices (0,0), (2,2), (0,4).
4. In both cases the contraction factor is 1
3.
On the left the fixed points are:(0,.5), (0.25,0), (025,1), (0.75), (0.75,1), (1,.5)On the right the fixed points are:(0,.5), (0.3333333,0), (0.3333333,1), (0.666666770), (0.6666667,1), (1,.5)
#hexagon_fractal.ode on left
#
par c0=0.25,c1=.25,c2=.75,c3=.75,c4=0,c5=1
par d0=0,d1=1,d2=0,d3=1,d4=.5,d5=.5,s=6
p=flr(ran(1)*s)
dx/dt=(1/3)*(x-shift(c0,p))+shift(c0,p)
dy/dt=(1/3)*(y-shift(d0,p))+shift(d0,p)
@ xp=cx,yp=cy
@ maxstor=20000000,total=20000,meth=discrete
@ xlo=0,xhi=1,ylo=0,yhi=1,lt=0
@ xp=x,yp=y
aux pp=p
done
#hexagon_fractal.ode on right
#
par c0=0.3333333,c1=.3333333,c2=.6666667,c3=.6666667,c4=0,c5=1
par d0=0,d1=1,d2=0,d3=1,d4=.5,d5=.5,s=6
p=flr(ran(1)*s)
dx/dt=(1/3)*(x-shift(c0,p))+shift(c0,p)
dy/dt=(1/3)*(y-shift(d0,p))+shift(d0,p)
@ xp=cx,yp=cy
@ maxstor=20000000,total=20000,meth=discrete
@ xlo=0,xhi=1,ylo=0,yhi=1,lt=0
@ xp=x,yp=y
aux pp=p
done
-----------------
0
0.2
0.4
0.6
0.8
0 0.2 0.4 0.6 0.8
0
0.2
0.4
0.6
0.8
0 0.2 0.4 0.6 0.8
Figure 2:
5.
-0.025
-0.02
-0.015
-0.01
-0.005
0
0.005
0.01
0.015
0.02
cy
-1.8 -1.79 -1.78 -1.77 -1.76 -1.75 -1.74cx
-2
-1.5
-1
-0.5
0
0.5
1
1.5x
-1.8 -1.79 -1.78 -1.77 -1.76 -1.75 -1.74c
-0.3
-0.2
-0.1
0
0.1
0.2
0.3
-1.5 -1 -0.5 0 0.5 1 1.5
Figure 3: 5. Period 3 window of the Mandelbrot set; the orbit diagram for the quadratic map in the period3 window; Julia set for a point in the period 3 bulb.