Sinusoidal Wave of FDTD

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

EasyChair Preprint

№ 2291

Simulation of a wave propagation using Finite


Difference Time domain Modeling (FDTD) by
Matlab

Amro Ali

EasyChair preprints are intended for rapid


dissemination of research results and are
integrated with the rest of EasyChair.

January 1, 2020
Simulation of a wave propagation using Finite
Difference Time domain Modeling (FDTD) by
Matlab
Amro Emad Awad Ali


Abstract— the purposes from this paper are driving and II. SOLVING PROBLEMS (CODE AND RESULTS)
simulating the propagation of a wave by using Finite Difference
For explanation of this issues Matlab (R2015b) has been
Time Domain Modeling Analysis (FDTD), by drive the
corresponding FDTD codes from Maxwell's equation and used. The main idea for solving this problem is developing
simulate these codes in MATLAB. code from Maxwell's differential equations to simulate the
Index Terms—Matlab, Model, Simulation, Maxwell, FDTD. propagation of a sinusoidal wave as a source signal hitting on
a lossy dielectric medium.

I. INTRODUCTION One dimension FDTD:

F Inite difference time domain modeling method is a


numerical analysis technique used for modeling
I will derive the corresponding 1-D FDTD code from the
Maxwell’s equations and simulate a sinusoidal wave hitting on
a lossy dielectric material , starting from the middle of the
computational electrodynamics, introduced by Yee in 1966. At
that time it was the first direct time domain solutions of problem space, with a dielectric constant of 3.8 and a
Maxwell's differential (curl) equations on special grids or conductivity of 0.02 S/m. The source is a 1GHz sinusoidal
lattices [1]. wave originates at cell 10.i am going to take the problem
space as 400 cells and also plotting Ez with four values of ‘ T’
When Maxwell's differential equations are applied, it can (four graphs) to show the propagation of the wave throughout
be seen clearly that the electric field (E) and the the problem space.
electromagnetic field (H) are interleaved in both space and I will start by driving 1-D FDTD code from Maxwell's
time, also the electromagnetic field values are assumed to be equations as follow:
located between the electric field values. In addition to the
𝜕𝐸
new value of electric field are calculated from its previous 𝜀 =∇×𝐻−𝐽 (1)
𝜕𝑡
value and the most recent value of electromagnetic field [1].
𝜕𝐻 1
=− ∇×𝐸 (2)
The main objective of this paper is to derive corresponding 𝜕𝑡 𝜇0
FDTD code from Maxwell's equations and beside consider the
states of the media and simulated boundary. After that 𝐽 =𝜎∙𝐸 (3)
simulate the propagation of the given source wave in these
FDTD code in MATLAB for one–dimension. Then plot the Where 𝐽 is the current density, 𝜎 is the conductivity, and 𝜀
propagation for this wave in different time; to show the is the dielectric constant.
behavior for this wave in this given media. Now substitute (3) in (1) and dividing the whole equation
with 𝜀 which is equal to 𝜀0 𝜀𝑟 .
The rest part of the Report is organized as follows: Section
II briefly describes in details the derivation of FDTD code 𝜕𝐸 1 𝜎
= ∇×𝐻− 𝐸 (4)
from Maxwell's equations, Matlab code for the problem and 𝜕𝑡 𝜀0 𝜀𝑟 𝜀0 𝜀𝑟
the output of the described code. Section III Conclusion of
these problems. . Assume 𝐸 is along x axis, 𝐻 is along y axis, and the
propagation is along z axis.

This paper is a simulation of how a wave propagates in both space and 𝜕𝐸𝑥 (𝑡) 1 𝜕𝐻𝑦 (𝑡) 𝜎
time by using a clear explanation of maxwell's equations. =− ∙ − 𝐸 (𝑡) (5)
Amro Emad Awad Ali, Riyadh, Saudi Arabia. Studing a master degree in 𝜕𝑡 𝜀0 𝜀𝑟 𝜕𝑧 𝜀0 𝜀𝑟 𝑥
computer and control systems at King Saud University, (e-mail:
[email protected] edu.sa). 𝜕𝐻𝑦 (𝑡) 1 𝜕𝐸𝑥 (𝑡)
=− ∙ (6)
𝜕𝑡 𝜀0 𝜇0 𝜕𝑧
gbx=zeros(KE,1);
Now take the normalization of 𝐸𝑥 (𝑡) in equations (5) and %kc is the number of cell in which asinusoidal
wave originates
(6). kc=10;
%f0 the corresponding frequancy of the wave
𝜕𝐸̃𝑥 (𝑡) 1 𝜕𝐻𝑦 (𝑡) 𝜎 f0=1e9;
=− ∙ − 𝐸̃𝑥 (𝑡) (7) %c0 the speed of light in avacuum
𝜕𝑡 𝜀𝑟 √𝜀0 𝜇0 𝜕𝑧 𝜀0 𝜀𝑟
c0=3e8;
lambdaM=c0/(sqrt(epsr)*f0);
𝜕𝐻𝑦 (𝑡) 1 𝜕𝐸̃𝑥 (𝑡) ddx=lambdaM/10;
=− ∙ (8) dt=ddx./(2*c0);
𝜕𝑡 √𝜀0 𝜇0 𝜕𝑧
ex_low_m2=0;
ex_low_m1=0;
Now take the finite difference approximations for both the T =0;
temporal and spatial derivatives (FDTD code). NSTEPS=400;c=0;
%main FDTD loop
⁄ ⁄ for k=200:KE;
𝐸̃𝑥𝑛+1 2 (𝑘) − 𝐸̃𝑥𝑛−1 2 (𝑘)
gax(k,1)=1/(epsr+(sigma*dt/epsz0));
∆𝑡 gbx(k,1)=sigma*dt/epsz0;
1 𝐻𝑦𝑛 (𝑘 + 1⁄2) − 𝐻𝑦𝑛 (𝑘 − 1⁄2)
=− ∙ end
𝜀𝑟 √𝜀0 𝜇0 ∆𝑥 for m=100:100:400;
𝜎 𝐸̃𝑥 𝑛+1 ⁄ 2
(𝑘) + 𝐸̃𝑥𝑛−1⁄ 2
(𝑘) c=c + 1;
− (9) for n=1:m;
𝜀0 𝜀𝑟 2
T = T + 1;
for k=2:KE;
Where ∆𝑥 is the cell size which is ∆𝑡 = ∆𝑥 ∕ 2𝑐0 then: dx(k)=dx(k)+.5*(hy(k-1)-hy(k));
end
1 ∆𝑡 ∆𝑥⁄2 ∙ 𝑐0 1 source=sin(2*pi*f0*n*dt);
= 𝑐0 ∙ =
√𝜀0 𝜇0 ∆𝑥 ∆𝑥 2 dx(kc)=dx(kc)+source;
%calculate the e field of the FDTD
Now equation (9) becomes:
for k=2:KE;
ex(k)=gax(k,1)*(dx(k)-ix(k));
⁄ ∆𝑡 ∙ 𝜎
𝐸̃𝑥𝑛+1 2 (𝑘) [1 + ] ix(k)=ix(k)+gbx(k,1)*ex(k);
2𝜀0 𝜀𝑟 end
⁄ ∆𝑡 ∙ 𝜎 %absorbing boundary condition added
= 𝐸̃𝑥𝑛−1 2 (𝑘) [1 − ]
2𝜀0 𝜀𝑟 ex(1)=ex_low_m2;
1⁄2 𝑛 ex_low_m2=ex_low_m1;
− [𝐻𝑦 (𝑘 + 1⁄2) − 𝐻𝑦𝑛 (𝑘 − 1⁄2)] (10) ex_low_m1=ex(2);
𝜀𝑟
Or %calulate the h field of the FDTD
for k=1:(KE-1);
hy(k)=hy(k)+.5*(ex(k)-ex(k+1));
∆𝑡 ∙ 𝜎
(1 − ) end
⁄ 2𝜀0 𝜀𝑟 ̃ 𝑛−1⁄2
𝐸̃𝑥𝑛+1 2 (𝑘) = 𝐸 (𝑘) figure(c); plot(ex,'b'); hold on
∆𝑡 ∙ 𝜎 𝑥
(1 + ) xa=[200 200];ya=[-1.5 1.5];
2𝜀0 𝜀𝑟
plot(xa,ya,'r','LineWidth',2,'LineStyle','--
1⁄2 1
− [𝐻𝑦𝑛 (𝑘 + ) ')
∆𝑡 ∙ 𝜎 2 title(['T = ',num2str(n)]);
𝜀𝑟 (1 + )
2𝜀0 𝜀𝑟 ylabel('Propagation of E')
− 𝐻𝑦𝑛 (𝑘 − 1⁄2)] (11) xlabel('FDTD ')
axis([1 KE -2 2])
text(250,-1.15,'Conductivity(sigma)=0.02')
Matlab code has been written for four "T" (100,200,300 and 400) to
text(250,-1.3,'Epsilon=3.8')
show the propagation of the sinusoidal wave across the medium.
text(50,-1.3,'Epsilon=1','color','k')
clear;
hold off
clc;
end
%epsr is the dielectric constant
end
epsr=3.8;
%epsz0 is the permitivity of space
epsz0=8.854223e-12;
%sigma is the conductivity
sigma=0.02;
%KE is the number of cells to be used
KE=400;
dx=zeros(KE,1);
ex=zeros(KE,1);
hy=zeros(KE,1);
ix=zeros(KE,1);
gax=ones(KE,1);
T = 100 T = 400
2 2

1.5 1.5

1 1
Propagation of E

Propagation of E
0.5 0.5

0 0

-0.5 -0.5

-1 -1
Conductivity(sigma)=0.02 Conductivity(sigma)=0.02
Epsilon=1 Epsilon=3.8 Epsilon=1 Epsilon=3.8
-1.5 -1.5

-2 -2
50 100 150 200 250 300 350 400 50 100 150 200 250 300 350 400
FDTD FDTD

Fig. 1. 1-D FDTD sinusoidal wave start propagating from cell 10 in a lossy Fig. 4. 1-D FDTD sinusoidal wave start propagating from cell 10 in a lossy
dielectric material, output at T=100. dielectric material, output at T=400.

T = 200
2
III- Conclusion
1.5

1
One dimension FDTD simulation has been done for a
sinusoidal wave hitting a lossy dielectric material.
From all of the above it can be clearly seen that FDTD is
Propagation of E

0.5

accurate, robust and easy to do by applying a systematic


0
approach.
-0.5

-1
Conductivity(sigma)=0.02
REFERENCES
Epsilon=1 Epsilon=3.8
[1] Dennis M.Sullivan''Electromagnetic Simulation Using The FDTD
-1.5
Method'', Institute of Electrical and Electronics Engineers Inc ,
New York, 2000.
-2
50 100 150 200 250 300 350 400
FDTD

Fig. 2. 1-D FDTD sinusoidal wave start propagating from cell 10 in a lossy
dielectric material, output at T=200.
T = 300
Amro Emad Awad Ali received the
2 B.S.c degree in electrical engineering
(control) from Sudan University of
1.5
science and Technology, Khartoum,
1 Sudan, in 2014. He is currently
performing a postgraduate studies (a
master degree) in electrical engineering
Propagation of E

0.5

(computer and control systems) in King


0
Saud University.
-0.5

-1
Conductivity(sigma)=0.02
Epsilon=1 Epsilon=3.8
-1.5

-2
50 100 150 200 250 300 350 400
FDTD

Fig. 3. 1-D FDTD sinusoidal wave start propagating from cell 10 in a


lossy dielectric material, output at T=300.

You might also like