> # henon.ms # Draw the henon attractor by iterating the trapping quadrilateral. # # WINDOWS WORKSHEET DOESN'T WORK PROPERLY (STACK OVERFLOW) SO WE MUST # USE THE DOS VERSION WHICH WORKS GREAT. (can use kmax=4 in windows but # kmax =6 in DOS). # # The following Maple statements define this quadrilateral as 4 sides in # parametric form and plot it. > line := [xa + (xb-xa)*t, ya + (yb-ya)*t]: > v := [[-1.33,0.42], [1.32,0.133], [1.245,-0.14], [-1.06,-0.5], > [-1.33,0.42]]: > quad[0] := [seq(subs(xa=v[s][1],xb=v[s+1][1], > ya=v[s][2],yb=v[s+1][2],line), s=1..4 )]; quad[0] := [[-1.33 + 2.65 t, .42 - .287 t], [1.32 - .075 t, .133 - .273 t], [1.245 - 2.305 t, -.14 - .36 t], [-1.06 - .27 t, -.5 + .92 t]] > OPTS := -1.5..1.5, -0.5..0.5, color=RGB(0,0,0),axes=BOX: > quadrilateral := plot(v,OPTS): > #interface(plotdevice=postscript, plotoutput=`henon0.ps`); > plots[display](quadrilateral,title=`Iteration 0`); # Now we can iterate these parametric equations to obtain iterated # curves in parametric form. > a := 1.4: > b := 0.3: > kmax := 4: > Henon := [1 - a*x^2 + y, b*x]: > for k from 1 to kmax do > quad[k] := > [seq(subs(x=quad[k-1][s][1],y=quad[k-1][s][2],Henon),s=1..4)]; > od: # Finally we can make a sequence of plot structures for each iteration. # Since the length of the curve approximately doubles at each # itereation, due to the stretching and folding, it is necessary to # double the number of points used to render the parametric curves. > points := [50,100,200,600,1200,2400]: > for k from 1 to kmax do > caption := cat(`Iteration `,k); > p := seq(plot([op(quad[k][s]),t=0..1], > OPTS,numpoints=points[k]), s=1..4): > if k=1 or k=kmax then > #interface(plotdevice=postscript,plotoutput=`henon`.k.`.ps`); > print(plots[display]([quadrilateral,p],title=caption)); > fi; > od: > >