diff --git a/TR2D.m b/TR2D.m index 160c89b..36d95d9 100644 --- a/TR2D.m +++ b/TR2D.m @@ -23,7 +23,7 @@ sigma = 0; ksi = (dt * sigma) / ( 2 * eps0* eps_r ); %calculation parameters -n_iter = 10000; +n_iter = 500; %initalization Hx = zeros(nx,ny); Hy = zeros(nx,ny); @@ -40,7 +40,7 @@ Ez(2:nx-1,2:ny-1) = ((1-ksi)/(1+ksi))*Ez(2:nx-1,2:ny-1) - ((1/(1+ksi))*(dt/(eps0*eps_r)))*((1/dx)*Hyx(2:nx-1,2:ny-1) - (1/dy)*Hxy(2:nx-1,2:ny-1)); for i=1:1:23 - Ez(i*10,:) = Ez(i*10,:) + receivers(i,end:-1:1); + Ez(i*10,srcy) = Ez(i*10,srcy) + receivers(i,n); end %Neuman Condition Ez(:,2) = -Ez(:,1); diff --git a/bitirme5.asv b/bitirme5.asv deleted file mode 100644 index 5cbf329..0000000 --- a/bitirme5.asv +++ /dev/null @@ -1,61 +0,0 @@ -clear all -close all -%TMz Polarization -%physical constants -c = 2.998e8; -eta0 = 120*pi; -mu0 = pi*4e-7; -eps0 = 1e-9/(36*pi); -%environment parameters -nx = 249; -ny = 249; -delta = 1.2e-2; %1.2cm -dx = delta; -dy = delta; -dt = 20e-12; %0.95/(c*sqrt(dx^-2+dy^-2)); -%f0 = 2e9; %2GHz -tw = 16*dt; -t0 = 200*dt; -srcx = round(nx/2); -srcy = round(ny/2); -eps_r = 4.58; -sigma = 0.52; %S/m -ksi = (dt * sigma) / ( 2 * eps0* eps_r ); -%calculation parameters -n_iter = 10000; -%initalization -Hx = zeros(nx,ny); -Hy = zeros(nx,ny); -Ez = zeros(nx,ny); -receivers = zeros(23,ny); -%iteration -for n=1:1:n_iter - %Maxwell Equations (TMz) - Ezx = diff(Ez,1,1); - Ezy = diff(Ez,1,2); - Hx(2:nx-1,2:ny) = Hx(2:nx-1,2:ny) - (dt/(mu0*dy))*Ezy(2:nx-1,:); - Hy(2:nx,2:ny-1) = Hy(2:nx,2:ny-1) + (dt/(mu0*dx))*Ezx(:,2:ny-1); - Hxy = diff(Hx,1,2); - Hyx = diff(Hy,1,1); - Ez(2:nx-1,2:ny-1) = ((1-ksi)/(1+ksi))*Ez(2:nx-1,2:ny-1) + ((1/(1+ksi))*(dt/(eps0*eps_r)))*((1/dx)*Hyx(2:nx-1,2:ny-1) - (1/dy)*Hxy(2:nx-1,2:ny-1)); - %Gaussian Source - f(n)= (-2*(n*dt-t0)*dt/(tw^2))*exp(-(n*dt-t0)^2/(tw^2))/dy; - Ez(srcx,srcy) = Ez(srcx,srcy) + f(n); - %Neuman Condition - Ez(:,2) = -Ez(:,1); - Ez(2,:) = -Ez(1,:); - Ez(:,ny-1) = -Ez(:,ny); - Ez(nx-1,:) = -Ez(nx,:); - %display - %n = n + 1; - for i=1:1:23 - receivers(i,:) = Ez(i*10,:); - end - pcolor(Ez'); - shading interp; - drawnow -end - -save('bitirme5.mat','receivers'); - - diff --git a/bitirme5.m b/bitirme5.m index ec26eb9..2fffa5c 100644 --- a/bitirme5.m +++ b/bitirme5.m @@ -22,12 +22,12 @@ sigma = 0.52; %S/m ksi = (dt * sigma) / ( 2 * eps0 * eps_r ); %calculation parameters -n_iter = 10000; +n_iter = 500; %initalization Hx = zeros(nx,ny); Hy = zeros(nx,ny); Ez = zeros(nx,ny); -receivers = zeros(23,ny); +receivers = zeros(23,n_iter); %iteration for n=1:1:n_iter %Maxwell Equations (TMz) @@ -49,7 +49,7 @@ %display %n = n + 1; for i=1:1:23 - receivers(i,:) = Ez(i*10,:); + receivers(i,n) = Ez(i*10,srcy); end pcolor(Ez') colorbar diff --git a/bitirme5.mat b/bitirme5.mat new file mode 100644 index 0000000..0cb570f Binary files /dev/null and b/bitirme5.mat differ