Vous êtes sur la page 1sur 6

Virtual Laboratory for Teaching Electromagnetism

using MATLAB
Bachir ELMAGROUD and Abdelhak ZIYYAT
Laboratoire dElectronique et Systmes
Facult des Sciences, Universit Mohammed Premier (UMP)
60000 Oujda, Morocco
bachirelmagroud@yahoo.fr, abdelhak_ziyyat@hotmail.com
Abstract In this work we present a virtual laboratory for
studying the wave propagation proprieties. This virtual lab is
used to study the propagation of electromagnetic waves in most
environments, in readable and progressive manner. It allows
students to apply many equations views in the course. The
software uses the finite-difference time-domain (FDTD) that has
been successfully applied in many engineering fields. In addition,
an easy-to-use MATLAB GUI handles all the parameters of the
FDTD simulation and computes theoretical values of
characteristics parameters of the wave propagation in different
mediums. The software allows understanding the phenomena of
electromagnetic wave propagation step by step; starting with the
case of one dimension to three dimensions, and finally, it allows
approaching particular cases like the metamaterials and plasma.
Java programming language is used for programming numerical
calculations, creating visualization suitable for simulations and
offers the possibility to run simulation remotely.
Keywords-component; propagation, virtual laboratory; FDTD;
animation.
I. INTRODUCTION
The didactic research in physics focuses on learning the
physical sciences themselves [1]. This requires a good mastery
of discipline taught by the teacher and a great mental effort and
imagination on the part of the learner especially in abstract
discipline as electromagnetism. The electromagnetic course is a
difficult subject both to teach and to learn [2][3]. Indeed the
students have difficulties in perceiving the behavior of
electromagnetic waves, which is a difficult concept in physics,
mainly when using traditional teaching tools. On the other
hand, the laboratory instruments to make practical experiences
are very expensive and, in many cases, are not correctly
handled. In a course such as electromagnetic, the student
interest must be stimulated so that adequate learning can take
place and the use of virtual experiments showing animations is
one way of doing this.
In this paper we compare two solutions for achieving a
virtual laboratory to teaching the propagation of
electromagnetic waves. The first solution uses the
programming language MATLAB [4] to realize a virtual
laboratory executable locally and the second solution uses Java
to create a remote virtual laboratory.
Build a remote virtual laboratory is a task that needs a
thorough knowledge of programming. Usually the virtual
laboratory can be approached through the Internet from the
browsers interface. The simplest way is to program Java
applet that can be placed on the Web server. A remote client
downloads the applet and runs it within his/her browser. Java
offers good possibilities for programming numerical
calculations and creating visualization suitable for simulations.
In the other hand, we use Microsoft Bitmap (BMP),
PowerPoint and HTML-Java presentations, QuickTime for
video and audio streaming. This part is not presented in the
paper just the experiences are presented here. In this paper we
present two solutions: the first uses the MATLAB GUI's and
the second uses the java solution.
The software, presented in this paper, is based on the finite-
difference time-domain (FDTD) method, which is a direct
solution method of Maxwells time-dependent curl equations
[5][6], the electromagnetic fields are calculated at each step
time, letting us to create very useful animations describe
electromagnetic wave interaction with dielectric and/or
magnetic materials. Although many commercial software exist
and are used to solve high-level electromagnetic problems like
as microwave antenna or electromagnetic dosimetry, but it is
very difficult to use this software packages in the first years of
physics degrees. In our software only the parameters needed to
experience are left for the student, the others are automatically
calculated by the software. The MATLAB programming
language is chosen for its powerful graphical interface.
978-1-4673-4925-3/12/$31.00 2012 IEEE November 6-8, 2012, Amman, Jordan
2012 International Conference on Interactive Mobile and Computer Aided Learning (IMCL)
Page 80
II. BASICS OF THE FDTDMETHOD
The behavior of electromagnetic wave is defined by the
normalized Maxwells Law [7]:
oD

ot
=
1
e
0
p
0
(v H -oE

)
D

(o)
= e

-
(o)
. E

(1)
oH
ot
= -
1
e
0
p
0
v E

Were e
0
, p
0
are respectively the electrical permittivity and
magnetic permeability of vacuum, e

-
is the mediums relative
complex permittivity, and o is the electric conductivity. H the
magnetic field, D the flux density and the electric field E
normalized, using:
E

= _
c
0

0
E (2)
In FDTD approach the space and time derivatives in
Maxwells curl equations are approximated by central
differences:
o
ox
_
x=x
0
=
[x
0
+
Ax
2
- [x
0
-
Ax
2

2 Ax
+ 0(Ax
2
)
(3)
and the computational space is divided into cells. The
electric and magnetic field are distributed in accordance with
the Yee cell Fig. 1. To simulate the open space the
computational domain was surrounded by perfectly matched
layer [8] (PMLs) absorbing boundary conditions, details for the
implementation of the FDTD can be seen here [5].
The stability condition in the three-dimensional case is
given by:
At <
1
c_
1
(Ax)
2
+
1
(Ay)
2
+
1
(Az)
2
(4)
As an example of discretization, we give one of the six
equations thus obtained:
E
x
n+
1
2
= E
x
n-1
-
At
p
0
Az
|E

n
(i, ], k) -E

n
(i, ], k -1)]
-
At
p
0
Az
|E
z
n
(i, ], k) - E
z
n
(i, ] - 1, k)]
Fig. 1. Yee cell
Fig. 2. Simulation of propagating sinusoidal wave impinging a lossy dielectric
material with a dielectric constant of 2 and conductivity of 0.03(S/m) in
MATLAB.
Fig. 3. Simulation of propagating sinusoidal wave impinging a lossy dielectric
material with a dielectric constant of 2 and conductivity of 0.03(S/m): Java
interface.
978-1-4673-4925-3/12/$31.00 2012 IEEE November 6-8, 2012, Amman, Jordan
2012 International Conference on Interactive Mobile and Computer Aided Learning (IMCL)
Page 81
(a)
(b)
(c)
(e)
Fig. 4. Simulation sequence. (a) t = 16uAt, (b) t = 24uAt, (c) t = SuuAt,
(d) t = 4uuAt
III. TOOL DESCRIPTION
Three cases were created in order to provide a progressive
learning.
A. One dimension case
This section presents many simulations in two dimensions.
The Fig. 2 for MATLAB solution and Fig 3 for Java solution
contain many buttons, the Source button allows setting the type
of source: Gaussian pulse or sinusoidal source, the frequency
and the origin of the source. The axis of simulation is divided
into two mediums, the first is the air, and the second is set by
the user: air, perfect conductor, dielectric medium, lossy
dielectric medium and dispersive medium (Debye, Lorentz).
The Material button allows setting the type of material and his
parameters. The Simulation Parameters button is disabled in
the student version, and the simulation parameters are
calculated automatically to ensure the stability of the FDTD
method and a low dispersion.
The case of lossy dielectric medium is given as an example
for this section. In Fig. 4, the simulation represents an
animation of the propagation of a sinusoidal wave initially in
the air and striking a lossy dielectric medium. This
visualization is quite useful to student because it permits to
show the interaction between the incident wave and the
reflected wave, the absorption of the wave in a lossy medium
and, using the data cursor, to note the change of the wavelength
in the dielectric medium with a simple calculation ( z
0
=
V
e

z).
The evaluation button is used to check if the basic notions
are assimilated. The questions may be questions of calculation
or questions of understanding. For example in Fig. 5 the
student must calculate the reflection coefficient I
(1-2)
using:
I
(1-2)
=
e
1
-
- e
2
-
e
1
-
+ e
2
-
(3)
and choose the correct answer.
The program calculates the result according to the settings
chosen by the student during the simulation, the position of the
result is arbitrarily chosen, as well as the other values in an
interval around the coefficient value. After clicking on the Next
button the correct result is displayed. The questions depend on
the type of medium chosen, for example, ten questions are
asked in the case of lossy dielectric medium. The test result is
saved in text file and allows a feedback to the teacher.
B. Two dimensions case
In addition to the sources previously used, we can simulate
the propagation of a plane wave and its interaction with a
dielectric cylinder or dielectric rectangle. The Material button
allows setting the type of material and his parameters (form:
cylinder or rectangle, dimensions). In Fig. 6, the simulation
represents the propagation of a plane wave pulse impinging on
dielectric cylinder with a dielectric constant of 25 and
conductivity of 0.1(S/m). The Fig. 7 represents the propagation
of a plane wave pulse impinging on dielectric rectangle.
0 200 400 600 800 1000 1200 1400 1600 1800 2000
-1.5
-1
-0.5
0
0.5
1
1.5
E
x
X(mm)
Air Lossy Dielectric
0 200 400 600 800 1000 1200 1400 1600 1800 2000
-1.5
-1
-0.5
0
0.5
1
1.5
E
x
X(mm)
Air Lossy Dielectric
0 200 400 600 800 1000 1200 1400 1600 1800 2000
-1.5
-1
-0.5
0
0.5
1
1.5
E
x
X(mm)
Air Lossy Dielectric
0 200 400 600 800 1000 1200 1400 1600 1800 2000
-1.5
-1
-0.5
0
0.5
1
1.5
E
x
X(mm)
Air Lossy Dielectric
978-1-4673-4925-3/12/$31.00 2012 IEEE November 6-8, 2012, Amman, Jordan
2012 International Conference on Interactive Mobile and Computer Aided Learning (IMCL)
Page 82
Fig. 5. Example of evaluation window
Fig. 6. Simulation of plane wave pulse impinging on dielectric cylinder in
MATLAB GUI.
Fig. 7. Simulation of plane wave pulse impinging on dielectric rectangle in
Java.
C. Three dimensions case
In addition to the sources used in case of two dimensions
namely: point source and plane wave source, here we can
simulate the propagation of a wave produced by a dipole
antenna Fig. 8 for the first solution using MATLAB. Here the
student can see the effect of Free-space path loss for example.
This section is being expansion, several modules will be
added like as the simulation of elementary antennas and the
trace of the Smith chart.
D. Others
In this section, we simulate the propagation in specific
medium, such as: the unmagnetized plasma and the
metamaterials.
In Fig. 9, we see the screen capture of the Others MATLAB
GUI, we can choose the medium and start simulation. All
parameters are defined in the program. Taking as an example
the Backward propagation in the metamaterials; and for the
sake of simplicity, we consider that [9]:
e

() = p

() = 1 +

p
2
(ju)
2
+juu
c


were e

() and p

() are respectively the relative


permittivity and relative permeability of the metamaterial
follow Drude dispersion models, u
p
and u
c
are the plasma and
the collision frequencies. If u
c
= u, for frequencies u <
p
,
e

() and p

()will be negative and the wavefront travel in


opposite direction (backward propagation), it is difficult to
explain this phenomenon theoretically to students. In Fig. 10,
for the Java solution, we can see the web page representing the
backward propagation in the metamaterials.
In Fig. 11, the simulation represents an animation of the
normal incidence of a wave on a metamaterial slab. The
student can easily understand the backward propagation
phenomenon by visualizing this animation.
The unmagnetized plasma can be modeled by the
permittivity expression like this:
e
-
() = 1 +

p
2
(]v
c
-)
where
p
= 2n
p
,
p
is the plasma frequency, v
c
is the
electron collision frequency. For a frequency lower than
resonance frequency
p
the pulse was totally reflected (fig. 12).
For frequency higher the plasma frequency a small part of the
pulse was reflected and the major part passes through the
plasma medium (fig. 13).
This section can be enriched with several new features
related to research, as example the optical waveguide.
978-1-4673-4925-3/12/$31.00 2012 IEEE November 6-8, 2012, Amman, Jordan
2012 International Conference on Interactive Mobile and Computer Aided Learning (IMCL)
Page 83
Fig.8. Electrical filed E
z
radiation from a dipole antenna
Fig.9. Screenshot of the Others MATLAB GUI, that representing the Backward
propagation in metamaterial.
Fig.10. Screenshot of the Others case, that representing the Backward
propagation in metamaterial with Java.

(a)
(b)
(c)
(d)
Fig. 11. Simulation sequence for Backward propagation (a) t = 42uAt,
(b) t = 44uAt, (c) t = 46uAt, (d) t = 48uAt
800 1000 1200 1400 1600 1800
-1
-0.5
0
0.5
1
E
x
X(mm)
Air Air
Metamaterial
800 1000 1200 1400 1600 1800
-1
-0.5
0
0.5
1
E
x
X(mm)
Air Air
Metamaterial
800 1000 1200 1400 1600 1800
-1
-0.5
0
0.5
1
E
x
X(mm)
Air Air
Metamaterial
800 1000 1200 1400 1600 1800
-1
-0.5
0
0.5
1
E
x
X(mm)
Air Air
Metamaterial
978-1-4673-4925-3/12/$31.00 2012 IEEE November 6-8, 2012, Amman, Jordan
2012 International Conference on Interactive Mobile and Computer Aided Learning (IMCL)
Page 84
Fig. 12. Simulation of a wave propagating in free space and striking a
plasma for f<fp.
Fig. 13. Simulation of a wave propagating in free space and striking a plasma
for f>fp.
CONCLUSION
In this paper, the developments of virtual laboratory for
wave propagation phenomena in multiple mediums, and its use
in the classroom with the first solution using MATLAB or
remotely with the second solution using Java, have been
described. Different phenomena can be checked and analyzed
like as the reflection and transmission of an electromagnetic
wave, the interaction of an electromagnetic wave with different
materials and the dispersion phenomena. Some parameters can
be determined like as the wavelength, the reflection coefficient,
transmission coefficient and others.
The java solution presents many advantages compared with
the MATLAB GUIs solution: the presentation is better; the
addition of another utility is very simple thing, the remote
teaching and the transportability of the solution.
REFERENCES
[1] L.C. McDermott. Physics education research : "The key to student
learning and teacher preparation". Physics World, January 2004.
[2] B. Beker, D.W. Bailey, and G. J. Cokkinides, An application-enhanced
approach to introductory electromagnetics, IEEE Trans. Educ., vol. 41,
no. 1, pp. 3136, Feb. 1998.
[3] F. T. Ulaby and B. L. Hauck, Undergraduate electromagnetic
laboratory: An invaluable part of the learning process, in Proc. IEEE,
vol. 88, Jan. 2000.
[4] B. Elmagroud, A. Ziyyat, "Educational software for propagation
phenomena using MATLAB GUIs and FDTD," IEEE Global
Engeneering Education Conference (EDUCON), 2012.
[5] A. Taflove, S. Hagness, Computational electrodynamics: the finite-
difference time-domain method, Artech House, Inc, 2005.
[6] D. M. Sullivan, Electromagnetic Simulation Using the FDTD Method.
Piscataway, NJ: IEEE Press, 2000.
[7] J. P. Berenger, "A perfectly matched layer for the absorption of
electromagnetic waves," J. Comput. Phys., vol. 114, pp. 185200, 1994.
[8] Yang Hao, Raj Mittra, FDTD Modeling of Metamaterials: Theory and
Applications. Artech House Publisher, November 2008..
[9] Grande, A., Gonzlez, O., Pereda, J.A., Vegas, A., "Educational
computer simulations for visualizing and understanding the interaction
of electromagnetic waves with metamaterials," Education Engineering
(EDUCON), 2010 IEEE, On page(s): 543 - 547, Volume: Issue: , 14-16
April 2010.
978-1-4673-4925-3/12/$31.00 2012 IEEE November 6-8, 2012, Amman, Jordan
2012 International Conference on Interactive Mobile and Computer Aided Learning (IMCL)
Page 85

Vous aimerez peut-être aussi