########################################################################### # # # File: 4_01.maple # # # # 2D plots for jpx 2.4 # # Miraquad map # # # ########################################################################### fig := `Fig 4-1`: ########################################################################### # # # Step 1: Set the domain within the plane # # # ########################################################################### xmin := -1.5: xmax := 1.5: ymin := -1.1: ymax := 1.8: domain := xmin..xmax, ymin..ymax: ########################################################################### # # # Step 2: Define the map of the plane to itself # # T: (x,y) -> ( f(x,y), g(x,y) ) # # and set the control parameters for the map # # # ########################################################################### a := 0.7: b := -0.8: f := (x, y) -> a*x+y: g := (x, y) -> x^2+b: ########################################################################### # # # Step 2.5: Compute fixed point # # # ########################################################################### Q_x := ( (1-a) - sqrt( (1-a)^2 - 4*b) )/2: Q_y := (1-a)*Q_x: ########################################################################### # # # Step 3: Specify arcs of the critical curves and a_n # # segment - interval of arcs parameter # # p_x[n], p_y[n] - parametric equations for L_n # # M - number of images of the arc L_0 to be drawn # # curvelist - list of the L_n # # a_x[n], a_y[n] - endpoints of L_n arc # For Miraquad map x=0 is the critcle set # # # ########################################################################### segment := t = -1..1: p_x[-1] := 0: p_y[-1] := t: L[-1] := [p_x[-1], p_y[-1], segment]: M := 4: curvelist := L[-1]: a_x[-1] := 0.0: a_y[-1] := 0.0: b_x[0] := 0.0: b_y[0] := 0.685: for n from 0 to M do p_x[n] := f(p_x[n-1], p_y[n-1]): p_y[n] := g(p_x[n-1], p_y[n-1]): L[n] := [p_x[n], p_y[n], segment]: curvelist := curvelist, L[n]: a_x[n] := f(a_x[n-1], a_y[n-1]): a_y[n] := g(a_x[n-1], a_y[n-1]): b_x[n+1] := f(b_x[n], b_y[n]): b_y[n+1] := g(b_x[n], b_y[n]): od: ########################################################################### # # # Step 4: Set initial point and compute trajectory # # front - first point of trajectory to be displayed # # back - last point of trajectory to be displayed # # trajectlist - list of points to be displayed in the trajectory # # # ########################################################################### x[0] := Q_x+0.001: y[0] := Q_y+0.001: front := 400: back := 600: for n from 1 to back do x[n] := f(x[n-1], y[n-1]): y[n] := g(x[n-1], y[n-1]): od: trajectlist := seq( [x[n], y[n]], n=front..back): ########################################################################### # # # Step 5: Choose screen or file to draw # # Not necessary on SGI or Athena # # We can select menu from screen display to convert to various # # formats. # # # # interface(plotdevice = win): # # interface( plotdevice = postscript , plotoutput=`f4-01. ps`): # # # ########################################################################### ########################################################################### # # # Step 6: Specify graphics options, label objects, and display results # # # # L_tag - procedure for labeling the L_n curves # # plotlist - list of graphics to be displayed # # # ########################################################################### with(plots): a_tag := proc(x,y,n) local char, sub: char := textplot( [x,y,` a`], align={ABOVE,LEFT}, font=[TIMES,ROMAN,24]): sub := textplot( [x,y,n], align=RIGHT, font=[TIMES,ROMAN,12]): RETURN(char,sub): end: b_tag := proc(x,y,n) local char, sub: char := textplot( [x,y,` b`], align={ABOVE,LEFT}, font=[TIMES,ROMAN,24]): sub := textplot( [x,y,n], align=RIGHT, font=[TIMES,ROMAN,12]): RETURN(char,sub): end: L_tag := proc(x,y,n) local char,sub: char := textplot( [x,y,`L`], align={ABOVE,LEFT}, font=[TIMES,ROMAN,27]): sub := textplot( [x,y,n], align=RIGHT, font=[TIMES,ROMAN,12]): RETURN(char,sub): end: Q_tag := proc(x,y) local char, sub: char := plot( {[x, y]}, style=point, symbol=CIRCLE): sub := textplot([x+0.06 , y+0.1,`Q`], font=[TIMES, ROMAN, 24]): RETURN(char,sub): end: plotlist := plot( {curvelist}, domain, scaling=constrained, axes=none, color=black, thickness=3 ), L_tag( 0.13, -0.35, `-1`), L_tag( -0.4, -1.02, `0`), L_tag( -1.17, -0.67, `1`), L_tag( -1.4, 0.6, `2`), L_tag( -0.19, 1.0, `3`), L_tag( 0.87, -0.6, `4`), plot( {seq( [a_x[n], a_y[n]], n=-1..M)}, color=black, style=point, symbol=CIRCLE), plot( {[b_x[0], b_y[0]],[b_x[1], b_y[1]]}, color=black, style=point, symbol=CIRCLE), a_tag( a_x[-1]+0.1, a_y[-1]-0.06, `-1`), a_tag( a_x[0]+0.09, a_y[0]-0.12, `0`), a_tag( a_x[1]+0.02, a_y[1]-0.15, `1`), a_tag( a_x[2]-0.04, a_y[2]-0.09, `2`), a_tag( a_x[3]+0.1, a_y[3]-0.10, `3`), a_tag( a_x[4]-0.02, a_y[4]-0.09, `4`), b_tag( b_x[0]+0.1, b_y[0]+0.03, `0`), b_tag( b_x[1]+0.05, b_y[1]-0.13, `1`), Q_tag( Q_x, Q_y), textplot([-1.0,1.8,`a=0.7 b=-0.8`], font=[TIMES, ROMAN, 24]), textplot([xmax,ymax,fig], font=[TIMES,ROMAN,24]): display({plotlist});