[1d fdtd yee algorithm using fortran 90] unexpected graph- what is the problem?
时间:03-26
整理:3721RD
点击:
hi all,
i have codes about reflective 1d fdtd maxwell equation as below:
the problem is after compiling the wave line i got is not as i expected since i expected gaussian envelope, but the result is as below:
can anyone explain to me why it is happened?
i have codes about reflective 1d fdtd maxwell equation as below:
Code:
!d fdtd Simulation in free space subroutine fd1d01(f0,miu,delta,S,E0) implicit none real :: f0 real :: miu real :: delta real :: S real :: E0 integer :: iinit integer :: ilast integer :: i,j integer :: t,t0 double precision :: di integer :: n double precision :: Ca double precision :: Da double precision :: tdelta double precision :: c double precision,dimension(100) :: Ez double precision,dimension(100) :: Hy real, parameter :: pi = 3.14159265 double precision :: Cb double precision :: Db double precision :: lambda double precision :: alpha character(len=20) :: filename f0 = 1.0 miu = 1.0 delta = 1.0 S = 1.0 E0 = 1.0 iinit = 0 ilast = 100 c = 3.e8 lambda = c/f0 alpha = 0.04*lambda tdelta = 1.0*alpha/(S*c) !initialization Ez = 0 Hy = 0 Ca = 1.0 Cb = tdelta/(delta*alpha) Da = 1.0 Db = tdelta/(miu*alpha) do n = 0,500 write (filename, "('ez',I3.3,'.dat')") n open (unit=130,file=filename) do j = 0,2*ilast di = 0.5*j if (Mod(j,2) == 0 ) then !j is even; hence di is whole number Ez(Int(di-0.5)) = Ca*(Ez(Int(di-0.5)))+Cb*(Hy(Int(di))-Hy(Int(di-1))) else !j is odd; hence di is 1/2 of whole number Hy(Int(di)) = Da*(Hy(Int(di)))+Db*(Ez(Int(di+0.5))-Ez(Int(di-0.5))) end if write (130,*) Ez(Int(di)) end do !plane wave source Ez(50) = E0*sin (2*pi*f0*n*tdelta) close (unit=130) end do !n end SUBROUTINE fd1d01
can anyone explain to me why it is happened?