100 likes | 229 Views
Project 1 results nmax=100. Dependence on nmax. Wave function n=1. Wave function n=2. Wave function n=3. Wave function n=4. Wave function n=5. Specification part. implicit none INTEGER, PARAMETER :: nmax=100 INTEGER, PARAMETER :: nbin=1000
E N D
Specification part implicit none INTEGER, PARAMETER :: nmax=100 INTEGER, PARAMETER :: nbin=1000 REAL*8, PARAMETER :: L=10.0d0 REAL*8 :: pi,fac REAL*8 , dimension(nmax) :: w,fv1,fv2,wpert,e0 REAL*8 , dimension(nmax,nmax) :: hamil,z REAL*8 :: psi,x,dx INTEGER :: matz,ierr,m,n,nb pi=4.0d0*datan(1.0d0) hamil=0.0d0 wpert=0.0d0 dx=L/nbin
Execution part do m=1,nmax e0(m)=(pi*m)**2/(2.0d0*L**2) enddo do m=1,nmax hamil(m,m)=e0(m) do n=1,nmax fac=-(3.0d0/(2.0d0*L))*dsqrt(2.0d0*pi/L)* * (dcos(pi*(m-n)/2.0d0)*dexp(-(n-m)**2*pi**2/(2.0d0*L**3))- * dcos(pi*(m+n)/2.0d0)*dexp(-(n+m)**2*pi**2/(2.0d0*L**3))) hamil(m,n)=hamil(m,n)+fac if(m.eq.n) wpert(m)=wpert(m)+hamil(m,m) if(m.ne.n) wpert(m)=wpert(m)+fac**2/(e0(m)-e0(n)) enddo write(6,*) m,hamil(m,m) enddo matz=1 call rs(nmax,nmax,hamil,w,matz,z,fv1,fv2,ierr)
do n=1,nmax write(6,*) w(n),wpert(n),e0(n) enddo fac=dsqrt(2.0d0/L) do m=1,5 do nb=1,nbin psi=0.0d0 do n=1,nmax x=dx*nb psi=psi+fac*z(n,m)*dsin(pi*x*n/L) enddo write(6,*) x,psi enddo write(6,*) enddo stop end 55,2-9 4%