Boundary-Value Problems in Electromagnetics
Boundary-Value Problems in Electromagnetics
Boundary-Value Problems in Electromagnetics
Volume 4 | Issue 1
3-31-2010
Sastry P. Kuruganty
Universidad del Turabo, [email protected]
This Regular Article is brought to you by the Bond Business School at ePublications@bond. It has been accepted for inclusion in Spreadsheets in
Education (eJSiE) by an authorized administrator of ePublications@bond. For more information, please contact Bond University's Repository
Coordinator.
Article 1
Electromagnetics is arguably one of the most challenging courses in any electrical engineering curriculum. A
solid foundation in vector calculus and a good intuition based on physical grounds are the normal
requirements for a student to successfully complete this course. This paper presents a simple, yet powerful
approach to introducing boundary-value problems arising in electrostatics. The principles of electrostatics find
numerous applications such as electrostatic machines, lightning rods, gas purification, food purification, laser
printers, and crop spraying, to name a few.
This paper focuses on the use of spreadsheets for solving electrostatic boundary-value problems. Sample
problems that introduce the finite difference and the finite element methods are presented. The geometries
included in the problems are sufficiently nontrivial for hand calculation or analytical solution, but reasonably
manageable using spreadsheets. Although specialized software is available for this purpose, oftentimes such
sophistication tends to obscure the mathematical underpinnings of the solution methods. Spreadsheets offer a
transparent alternative perhaps proximate to hand calculation for students to better appreciate the
numerical methods for solving boundary-value problems.
Keywords
Finite difference method, finite element method, Laplaces equation, boundary-value problems, electrostatics.
Cover Page Footnote
The authors gratefully acknowledge support from the Universidad del Turabo.
1. Introduction
Many phenomena arising in science and engineering are modeled by
partial differential equations (PDEs). In such cases the quantity of interest
(e.g., temperature, potential, or displacement) is a function that depends
on more than one variable (typically, space variables x, y, z and the
temporal variable t). The heat equation, wave equation, and Laplaces
equation are among the most prominent PDEs that undergraduate
engineering students will encounter. The usual practice is to introduce the
student to the analytical solution of these equations via the method of
separation of variables. Under the assumption of linearity, the method
naturally leads to the formulation of solutions as Fourier series
expansions.
Treatment of PDEs and boundary-value problems (BVPs) may be
found in many standard books [2 4, 7]. Reference 2 provides a very
accessible presentation of the topic, while references 3, 4, and 7 provide a
more concise presentation geared toward compendium courses in
engineering mathematics. This paper will not expound the theories that
provide the mathematical underpinnings of PDEs; instead, the paper
emphasizes numerical solutions to PDEs and suggests implementations
through spreadsheets.
This paper focuses on certain numerical methods for solving PDEs; in
particular, the finite difference and the finite element methods are presented in
the context of problems arising in electrostatics. Much of the development
of these methods will follow those found in electromagnetics books [8].
The examples presented in this paper include geometries that are
sufficiently nontrivial for hand calculation or analytical solution, but
reasonably manageable by using spreadsheets. Although specialized
software is available for this purpose, oftentimes such sophistication tends
to obscure the inner workings of the numerical methods employed in the
solution of PDEs. Spreadsheets offer a transparent alternative perhaps
proximate to hand calculation for students to better appreciate the
numerical methods for solving PDEs and BVPs.
The use of spreadsheets in teaching finite element analysis has been
reported in the literature [9]. Reference 9 presents finite element analysis
http://epublications.bond.edu.au/ejsie/vol4/iss1/1
is given in this paper; for more detailed derivations the reader may
consult [8]. The finite difference method entails three basic steps:
(1) Divide the solution region into a grid of nodes. Grid points are
typically arranged in a rectangular array of nodes.
(2) Approximate the PDE and boundary conditions by a set of linear
algebraic equations (the finite difference equations) on grid points
within the solution region.
(3) Solve this set of linear algebraic equations.
The method is illustrated with an example arising in electrostatics.
Consider the charge-free region depicted in Figure 1. The region has
prescribed potentials along its boundaries. The region is divided into a
rectangular grid of nodes, with the numbering of free nodes as indicated
in the figure.
0.
(1)
,
,
,
, .
(2)
0
.
(3)
Similar equations are formulated for the remaining free nodes leading
to a system of linear algebraic equations. This system of equations may be
solved by a variety of methods. In this section the Gauss-Seidel method
is implemented in a spreadsheet to solve this system of equations. The
Gauss-Seidel method is a relatively simple iterative method for solving
systems such as those encountered in the finite difference formulation.
The steps to implementing the spreadsheet for FDM are given below:
(1) The first step in the spreadsheet implementation is to input the
prescribed potentials at the boundaries of the solution region. This
step is shown in Figure 2. The prescribed potentials occupy the cell
range C6:C8 and correspond to the potentials (0 V and 100 V) given
in Figure 1. The user may change the numerical values of these
potentials to accommodate different boundary conditions.
http://epublications.bond.edu.au/ejsie/vol4/iss1/1
(2) The next step is the implementation of the Gauss-Seidel method for
solving the finite difference equations. There are 6 potentials at
interior grid points that need to be determined (nodes 1 through 6
in Figure 1). These have been labeled V1 through V6 and occupy the
cell range B14:G14 in Figure 3. To start the iterations initial estimates
are given in B15:G15; in this case all initial estimates have been set to
zero.
http://epublications.bond.edu.au/ejsie/vol4/iss1/1
(4)
where the subscripts refer to the local node numbers 1, 2, and 3 of element
e. For example, in Figure 4, element 20 has global nodes 14, 18, and 17,
which correspond, respectively, to local nodes 1, 2, and 3. Local node
numbering is arbitrary; however, local node numbers must be assigned so
that global nodes associated with an element are traversed in a
counterclockwise sense. The coordinates (in meters) of nodes 14, 18, and
17 are (x1,y1) = (0.4, 0.4), (x2,y2) = (0.4, 0.6), and (x3,y3) = (0.2, 0.6),
respectively. These sets of coordinates yield P1 = 0.0, P2 = 0.2, P3 = 0.2, Q1 =
0.2, Q2 = 0.2, and Q3 = 0.0.
With Pi and Qi (i = 1, 2, 3) for element e thus computed, the entries of
the 3 x 3 element coefficient matrix are then given by
"
!
#
$
%
&, ' 1, 2, 3
(5)
where
+
, -.
(6)
(7.a)
(7.b)
(7.c)
and
http://epublications.bond.edu.au/ejsie/vol4/iss1/1
and one off-diagonal entries are shown. For example, node 18, which
corresponds to the !2,2 entry in the global coefficient matrix C, belongs to
elements 20, 21 and 24; since node 18 is assigned local node number 2 in
elements 20 and 24, and local number 3 in element 21 (as seen in the
middle table of Figure 5), the corresponding global coefficient is
.
!2,2 !,
!,
!, 1.0
0.5
0.5 2.0.
(8)
Figure 5: Input section of finite element analysis for electrostatic problem: (left) global
node x and y coordinates; (middle) triangular element global and local node
correspondence; (right) nodes in the finite element mesh having prescribed potentials.
For the off-diagonal entry !,2, global link 1418 corresponds to local
link 12 of element 20 and local link 13 of element 21 and hence
.
!,2 !,
!, 0.5 0.5 1.0.
(9)
(10)
http://epublications.bond.edu.au/ejsie/vol4/iss1/1
10
=VLOOKUP($O19,$A$19:$C$39,2)
=VLOOKUP($O19,$A$19:$C$39,3)
=VLOOKUP($O20,$A$19:$C$39,2)
=VLOOKUP($O20,$A$19:$C$39,3)
=VLOOKUP($O21,$A$19:$C$39,2)
=VLOOKUP($O21,$A$19:$C$39,3)
11
=Q21-Q19
=Q19-Q20
=P21-P20
=P19-P21
=P20-P19
d. Cells U20 and Y20 are optional. These cells simply compute P1 +
P2 + P3 and Q1 + Q2 + Q3, as both sums must equal zero.
e. Cell Z20 implements Equation (6):
=(S20*X20-T20*W20)/2
g. The formulas in cell range N19:AC21 are copied over the cell
range N22:AC93 to complete the computation of the remaining
element coefficient matrices.
(3) The assembly of the global coefficient matrix is shown in Figure 7.
The numbers in AF18:AZ18 and AE19:AE39 refer to global node
numbers. The coefficients of the global matrix occupy cell range
AF19:AZ39, which contain formulas similar to those in Equations (8)
and (9). For example, the coefficient !2,2 in cell AW36 contains the
formula
=AB77+AC81+AB89,
=AB76+AC79.
http://epublications.bond.edu.au/ejsie/vol4/iss1/1
12
(4) The matrices !55 and !56 are formed by extracting the appropriate
rows and columns from the global coefficient matrix C. In this case,
nodes 8, 9, 10, 13, 14, and 17 are the free nodes, while 1, 2, 3, 4, 5, 6,
7, 11, 12, 15, 16, 18, 19, 20, and 21 are the nodes with prescribed
potentials. The result is shown in Figure 8.
(5) The final solution is obtained by using the matrix capabilities of
Microsoft Excel. Although the matrix capabilities of Excel are fairly
limited compared to those available in Matlab, Mathematica, or
Maple, the ones provided by Excel are quite sufficient for the FEM
implementation proposed in this paper. In particular, the
spreadsheet functions MINVERSE (matrix inverse) and MMULT
(matrix multiplication) are used in the implementation of Equation
(10). This step is shown in Figure 9.
13
Figure 8: Matrices !55 and !56 obtained from global coefficient matrix C.
http://epublications.bond.edu.au/ejsie/vol4/iss1/1
14
Finite difference
Node
Potential (V)
1
18.180
2
36.363
3
59.091
4
36.363
5
68.181
6
59.091
Finite element
Node
Potential (V)
8
18.182
9
36.364
10
59.091
13
36.364
14
68.182
17
59.091
15
http://epublications.bond.edu.au/ejsie/vol4/iss1/1
16
17
The interested reader may obtain a copy of the Microsoft Excel file that
implements the FDM and FEM solutions by sending an e-mail to
[email protected].
References
[1]
[2]
Asmar, N. Partial differential equations with Fourier series and boundary value
problems, 2nd edition, Prentice Hall, 2004.
[3]
Greenberg, M.
1998.
[4]
Kreyszig, E. Advanced engineering mathematics, 9th edition, John Wiley & Sons,
2006.
[5]
[6]
[7]
[8]
[9]
http://epublications.bond.edu.au/ejsie/vol4/iss1/1
18