program logistic_map implicit none real r,x_ini,x,xi integer pgopen,i,i_again,isymbol,n_gen isymbol = 1 write (*,*) 'This program plot xn as x_n+1 = 4rx_n(1-x_n+1).' write (*,*) write (*,*) 'What is the initial value of x (0 < x < 1) ?' read (*,*) x_ini write (*,*) 'How many generations to plot ?' read (*,*) n_gen if ( pgopen('/xwin') .le. 0 ) stop call pgpap(5.0,0.75) 100 write (*,*) 'What is the value of the control parameter r ?' read (*,*) r call pgeras call pgenv(0.0, n_gen*1.0, 0.0, 1.0, 0, 0) call pglab('n','x\dn','x\dn+1\u = 4 r x\dn\u (1-x\dn\u)') x = x_ini call pgmove(0.0,x) do i=1,n_gen xi = i*1.0 x = 4*r*x*(1-x) call pgdraw(xi,x) end do 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