program bifurcation_n_enlarge implicit none real r,x_ini,x,xi integer pgopen,i,i_again,isymbol,n_gen,j,n_group_size integer idummy,pgband real r_min,r_max,x_min,x_max,x_pos,y_pos,x1,x2,y1,y2,temp character*(1) ch isymbol = -1 write (*,*) 'This plots fix-points x* of x_n+1=4rx_n(1-x_n+1).' write (*,*) c write (*,*) 'What is the initial value of x (0 < x < 1) ?' c read (*,*) x_ini x_ini = 0.5 if ( pgopen('/xwin') .le. 0 ) stop c call pgpap(5.0,0.75) c pgask(0) means not to ask confirmation when erase a page call pgask(0) 100 write (*,*) 'What is the numer of generation for the mapping ?' read (*,*) n_gen call pgeras call pgsci(1) r_min=0.0 r_max=1.0 x_min=0.0 x_max=1.0 200 call pgenv(r_min, r_max, x_min, x_max, 0, 0) n_group_size = n_gen/15 do j=1,1000 r = r_min + j*(r_max-r_min)/1000 x = x_ini call pgbbuf do i=1,n_gen x = 4*r*x*(1-x) call pgsci(i/n_group_size) c if (i.gt.(0.1*n_gen)) call pgpt(1,r,x,isymbol) call pgpt(1,r,x,isymbol) end do call pgebuf end do write (*,*) 'Enlarge some parts ? (1=YES;0=NO)' read (*,*) i_again if (i_again.eq.0) goto 102 write (*,*) 'Now choose a range to enlarge using mouse pointer.' write (*,*) idummy = pgband (0, 1, 0.5, 0.5, x_pos, y_pos, CH) x1 = x_pos y1= y_pos idummy = pgband (2, 1, x1, y1, x_pos, y_pos, CH) x2 = x_pos y2 = y_pos if (x1.gt.x2) then temp = x1 x1 = x2 x2 = temp endif if (y1.gt.y2) then temp = y1 y1 = y2 y2 = temp endif write (*,*) 'Your choice is: ', ' r = (',x1,'~',x2,' y = (',y1,'~' &,y2,')' r_min = x1 r_max = x2 x_min = y1 x_max = y2 write (*,*) 'What is the numer of generation for the mapping ?' read (*,*) n_gen goto 200 102 write (*,*) 'Again ? (1=YES;0=NO)' read (*,*) i_again if (i_again.eq.1) goto 100 if (i_again.eq.0) stop goto 102 end