program eigen implicit none integer pgopen, i, odd_even, n_steps, i_again, i_colour real x, phi, dphi_dx, V0, a, eigenvalue, phi_ini, dphi_dx_ini real delta_x, Vx(6), Vy(6), V, phi_new, half_a write(*,*) 'Type in depth V0 and width a of the potential well:' read (*,*) V0, a write(*,*) 'Type in small spacing delta_x:' read(*,*) delta_x if (pgopen('/xwin').le.0) stop call pgpap (5.0,0.75) call pgenv (-20.0,20.0,-50.0,20.0,0,0) Vx(1) = -20.0 Vy(1) = 0.0 Vx(2) = -1*a/2 Vy(2) = 0.0 Vx(3) = -1*a/2 Vy(3) = -1*V0 Vx(4) = a/2 Vy(4) = -1*V0 Vx(5) = a/2 Vy(5) = 0.0 Vx(6) = 20.0 Vy(6) = 0.0 call pgline (6,Vx,Vy) i_colour = 2 100 write(*,*) 'Type in parity (1=Odd;0=Even) and trial eigenvalue:' read (*,*) odd_even, eigenvalue c -38.7315 for example if ((odd_even.ne.1).and.(odd_even.ne.0)) goto 100 if (odd_even .eq. 1) then phi_ini = 0.0 dphi_dx_ini = 1.0 end if if (odd_even .eq. 0) then phi_ini = 1.0 dphi_dx_ini = 0.0 end if call pgsci(i_colour) call pgpt(1,0.0,phi_ini + eigenvalue,-1) n_steps = int(40.0/delta_x) phi = phi_ini dphi_dx = dphi_dx_ini half_a = a/2 do i = 1, n_steps x = i*delta_x if (x.le.half_a) then V = -1*V0 else V = 0.0 end if phi_new = phi + dphi_dx*delta_x dphi_dx = dphi_dx + (V - eigenvalue)*phi_new*delta_x phi = phi + dphi_dx*delta_x call pgpt (1,x,phi + eigenvalue,-1) if (odd_even.eq.0) then call pgpt(1,-1*x,phi + eigenvalue,-1) else call pgpt(1,-1*x,-1*phi + eigenvalue,-1) end if end do 200 write(*,*) 'Try one more time ? (1=Yes;0=No)' read (*,*) i_again if (i_again.eq.1) then i_colour = i_colour + 1 goto 100 end if if (i_again.ne.0) goto 200 call pgclos end