2, MAY 1989 85
Abstract-This paper is a tutorial introduction for an absolute be- like asking students to use SPICE in an introductory
ginner in finite element numerical analysis. The finite element method course in networks. Although most commercial finite ele-
is applied to Laplacian electrostatic field problems. Suggestions are
offered on how the basic concepts developed can be extended to finite
ment packages are easy to use, yet pitfalls, not widely
element analysis of problem involving Poisson’s or wave equation. A appreciated, exist. While, it is unreasonable to expect that
step-by-step procedure for coding the numerical method is presented; students armed with only an introductory knowledge of
a useful, working Fortran program is also included. finite element method write commercial codes, a basic un-
derstanding of the method and its limitations is vital.
This paper presents a tutorial introduction to the finite
I. INTRODUCTION
element method without requiring the reader to be famil-
T HE finite element method has its origin in the field of
structural analysis. Although the earlier mathematical
treatment of the method was provided by Courant [ l ] in
iar with variational calculus. This not only helps the cu-
rious user of an existing finite element program under-
stand the mathematical basis of the method, it gives him
1943, the method was not applied to electromagnetic (EM) the ability to modify the program if necessary or develop
problems until 1968. With the increasing application of his own code. It is hoped that the paper will help the reader
the method in the numerical solution of continuum prob- who is first being introduced to the finite element analy-
lems (of which EM problems are an integral part), an ef- sis.
fort to apply the method in both undergraduate and grad- Most EM problems involve either partial differential
uate EM courses has gained momentum [2]-[4]. equations or integral equations. While partial differential
So far, little attempt has been made to present finite equations are usually solved using the finite difference
element method in simple terms which undergraduate stu- method or finite element method, integral equations are
dents in electrical engineering can understand. It is dis- solved conveniently using moment method [5]. In con-
appointing to note that while a large amount of research trast to other methods, the finite element method accounts
papers and textbooks on the subject have been published for nonhomogeneity of the solution region. The system-
by civil and mechanical engineers, it is hard for an elec- atic generality of the method makes it a versatile tool for
trical engineering student or a practicing electrical engi- a wide range of problems. As a result, flexible general-
neer, who is an absolute beginner in using finite element purpose computer programs can be constructed.
method, to get a simple, brief introductory material. Civil The finite element analysis of any problem involves ba-
or mechanical engineering materials on finite element sically four steps: 1) discretizing the solution region into
method are not easy for electrical engineers to under- finite number of subregions or elements, 2) deriving gov-
stand. This is due to the fact that the terminology and erning equations for a typical element, 3) assembling of
notation used in those materials are usually inconsistent all elements in the solution region, 4)and solving the sys-
and unfamiliar to electrical engineers. It has been the gen- tem of equations obtained. Each of these steps will be
eral belief among electrical engineers that the method is discussed briefly in the subsequent sections.
not so easy for undergraduates to grasp. The students are
merely asked to use an existing finite element program to 11. FINITEELEMENT DISCRETIZATION
generate solutions to specific problems assigned [3], [4]. We divide the solution region into a number of -finite
This is justified on the ground that numerical methods elements as illustrated in Fig. 1 where the region is sub-
constitute a fragment of an EM course and that the finite divided into four nonoverlapping elements (two triangular
element method involves calculus of variation which the and two quadrilateral) and seven nodes. We seek an ap-
students may not be familiar with at the undergraduate proximation for the potential Ve within an element e and
level. Asking students to perform finite element analysis then interrelate the potential distributions in various ele-
with either packaged commercial codes or faculty-devel- ments such that the potential is continuous across inter-
oped programs can be dangerous if care is not taken. It is element boundaries. The approximate solution for the
whole region is
Manuscript received January 18, 1989.
N
The author is with the Department of Electrical Engineering, Temple
University, Philadelphia, PA 19122.
IEEE Log Number 8927100.
V(x, Y ) = 2
e= I
V,(& Y ) (1)
yf
i node no.
1
@ element no
I
I
Actual boundary
I t X
Approximate boundary Fig. 2 . Typical triangular element; the local node numbering 1-2-3 must
6 proceed counterclockwise as indicated by the arrow.
Fig. 1 . A typical finite element subdivision of an irregular domain.
or
where N is the number of triangular elements into which
the solution region is divided. (7)
The most common form of approximation for V within
an element is polynomial approximation, namely where
V,(x, y) = a + bx + cy (2)
for triangular element and
V,(x, y) = a + bx + cy + dxy (3)
for quadrilateral element. The potential V, in general is
nonzero within element e but zero outside e . In view of
the fact that quadrilateral elements are in general noncon-
forming elements (see Fig. l ) , we prefer to use triangular
elements throughout our analysis in this paper. Notice that
our assumption of linear variation of potential within the
triangular element as in (2) is the same as assuming that
the electric field is uniform within the element, i.e.,
+
E , = -VV, = -(b.',, + c.',). (4)
111. ELEMENT GOVERNING EQUATIONS
Consider a typical triangular element shown in Fig. 2 .
The potential Vel, Ve2, and V,, at nodes 1, 2 , and 3 , re-
spectively, are obtained using ( 2 ) , i.e.,
or
A = L[(
2 x2 - X I ) (Y3 - Y l ) - (x3 - X I ) (YZ - Yl)].
3
c
i= 1
ffi(X, y) = 1
Similarly,
1
il
1
2
(a) (b)
Fig. 3 . Shape functions a , and a2 for a triangular element.
VV, = c V,,Va,.
I = I
(12)
and
(16)a
where
[VI = [ I5
[ c“’]= [
c\1;) cy’
cl“’
CC)
C‘l’l
22
C\;’
Cb;.]
cy;’ c:;)
(16)b
n is the number of nodes, N is the number of elements,
and [ C ] is called the over-all or global coeficient matrix
which is the assemblage of individual element coefficient
matrices.
The matrix [ C ‘ ” ] is usually called the element coeficienf The process by which individual element coefficient
matrix (or “stiffness matrix” in structural analysis). The matrices are assembled to obtain the global coefficient
matrix element Cf’ of the coefficient matrix may be re- matrix is best illustrated with an example. Consider the
garded as the coupling between nodes i a n d j ; its value is finite element mesh consisting of three finite elements as
obtained from (8) and (14). For example, shown in Fig. 4. Observe the numberings of the mesh.
C\;’ = 1 V a l . Vcu,dS
The numbering of nodes as 1, 2, 3, 4, and 5 is called
global numbering. The numbering i-j-k is called local
numbering and it corresponds with 1-2-3 of the element
1 in Fig. 2. For example, for element 3 in Fig. 4, the local
-
- 2 [(Y? - 4’3) ( Y 3 - Y I ) numbering 3-5-4 corresponds with 1-2-3 of the element
in Fig. 2. Note that the local numbering must be in coun-
terclockwise sequence starting from any node of the ele-
ment. For element 3, we could choose 4-3-5 instead of
1
= - [ ( Y z - 4’3) 0 ‘ 3 - YI) 3-5-4 to be correspond with 1-2-3 of the element in Fig.
4A 2. Thus, the numbering in Fig. 4 is not unique. Assuming
+ (x3 - (XI - X ? ) ] . (17)a the particular numbering in Fig. 4, the global coefficient
88 IEEE TRANSACTIONS ON EDUCATION, VOL. 32, NO. 2, MAY 1989
c, = cp + cp + c g (22)c
0 = VICII + V 2 C 1 2 + V‘3CI-j + I/,C14 + VSCl,. (25)
Nodes 1 and 4 belong simultaneously to elements 1 and In general, dW/aV, = 0 leads to
2; hence I1
Since there is no coupling (or direct link) between nodes where n is the number of nodes in the mesh. By writing
2 and 3, (26) for all nodes k = 1, 2, . . . . . , n , we obtain a set
= c2 = 0. of simultaneous equations from which the solution of
c23 3 (22)e
[ V ] T = [VI, v2, , VI,]can be found. This can be
Continuing in this manner, we obtain all the terms in the done in two ways similar to those used in solving finite
global coefficient matrix by inspection of Fig. 4 as
or VI. ILLUSTRATIVE
EXAMPLES
. m Implementation of the concepts discussed in the pre-
V, = --
I
CO, k = l
c
VkC,,. ceeding sections is illustrated with two examples. The first
example is a necessary preparation for the second where
Thus, if the potentials at nodes connected to 0 are known, the numerical process is developed into a Fortran pro-
we can determine V, using (27). The iteration process be- gram. The code developed is simple and self-explanatory
gins by setting the potentials at the free nodes (where the since it is intended for instructional purposes. The nota-
potential is unknown) equal to zero or to the average po- tions used in the programs are as close as possible to those
tential [9] used in previous sections; some are defined wherever nec-
essary.
Example 1: Consider the two-element mesh shown in
Fig. 6(a). Using finite element method, determine the po-
where V,,, and V,,, are the minimum and maximum val- tentials within the mesh.
ues of V at the$xed nodes (where the potential V is pre- Solution: The element coefficient matrices can be cal-
scribed or known). With these initial values, the poten- culated using (17) and (18). However, our calculations
tials at the free nodes are calculated using (27). At the will be easier if we define
end of the first iteration, when the new values have been
calculated for all the free nodes, they become the old val- PI = (Y2 - Y3>, p2 = (Y3 - Yl), p3 = (Yl - Y2)
ues for the second iteration. The procedure is repeated
until the change between subsequent iterations is neglible QI = ( ~ -
3 x2)3 Q2 = (XI - x3), Q3 = (x2 - xi>.
enough.
B) Band Matrix Method: If all free nodes are num- (32)
bered first and the fixed nodes last, (19) can be written With Pi and Qi ( i = 1, 2, 3 are the local node numbers),
such that each term in the element coefficient matrix is found as
1
C$') = 4~ [P;P, + QiQ,] (33)
where subscripts f and p , respectively, refer to nodes with
free and fixed (or prescribed) potentials. Since VP is con- where A = :(P2Q3 - P 3 Q 2 ) . It is evident that (33) is
stant (it consists of known, fixed values), we only differ- more convenient to use that (17) and (1 8). For element 1
entiate with respect to Vf so that applying (24) to (29) consisting of nodes 1-2-4 corresponding to the local num-
yields [7] bering 1-2-3 as in Fig. 6(b),
or
[VI = P I (31 ) b
[C"'] =
I -0.7786
-0.4571
0.6929
0.0857
0.0857 .
0.3714 I (34)
IEEE TRANSACTIONS ON EDUCATION, VOL. 32. NO. 2. MAY 1989
follows:
Node: (x,y) C22 = C$:’ + C\:’ = 0.6929 + 0.5571 = 1.25
Of
1 (0.8.1.8)
2 (1.4,1.4) C24 = C$\) + C::) = 0.0857 - 0.1 = -0.0143
v = lg
3
4
(2.1,Z.l)
(1.2J.7)
C4, = Cii) + Ci:) = 0.3714 + 0.4667 = 0.8381
lT
v - 0 2 C2l = C$l’ = -0.7786
(b)
Fig. 6. For example 1 : (a) two-element mesh, (b) local and global num-
bering of the elements. LO -0.0143 0 0.8381J
and the matrix [ B ] on the right-hand side of (37)a is ob-
Similarly, for element 2 consisting of nodes 2-3-4 corre- tained as
sponding to local numbering 1-2-3 as in Fig. 6(b),
PI
Q,
A
=
=
-0.6
-0.9
i(0.91
P2
Q2 =
+ 0.14)
= 1.3
0.2
=
P3 = -0.7,
Q, = 0.7,
0.525.
[B] = [1i::71].
3.667
(39)
TABLE I
'1. NODALCOORDINATES
OF T H E FINITE ELEMENT
MESHOF FIG. 7.
Node Y Y Node r Y
zlk
TABLE I1
ELEMEYT-NODE
IDEYTIFICATIO?I
Y
Local Node no. Local Node no.
Element 1 2 3 Element I 2 3
19 90
I 1 2 7 14 9 IO 14
23
2 2 8 7 15 IO 15 14
3 2 3 8 16 IO 11 15
4 3 9 8 17 12 13 16
5 3 4 9 18 13 17 16
6 4 IO 9 19 13 14 17
7 4 5 IO 20 14 18 17
8 5 II IO 21 14 15 18
9 5 6 I1 22 16 17 19
IO 7 8 12 23 17 20 19
11 8 13 12 24 17 18 20
12 8 9 13 25 19 20 21
13 9 14 13
TABLE I11
(b) PRESCRIBED POTENTIALS AT FIXEDNODES
Fig. 7. For example 2: (a) two-dimensional electrostatic problem, (b) so-
lution region divided into 25 triangular elements. Prescribed Prescribed
Node Potential Node Potential
basically involves four steps indicated in the program and 1 0.0 18 100.0
2 0.0 20 100.0
explained as follows. 3 0.0 21 50.0
Step 1: This involves inputting the necessary data de- 4 0.0 19 0.0
fining the problem. This is the only step that depends on 5 0.0 16 0.0
6 50.0 12 0.0
the geometry of the problem at hand. Through a data file, I1 100.0 7 0.0
we input the number of elements, the number of nodes, 15 100.0
the number of fixed nodes, the prescribed values of the
potentials at the fixed nodes, the x and y coordinates of
all nodes, and a list identifying the nodes belonging to Step 3: The global matrix obtained in the previous step
each element in the order of the local numbering 1-2-3. is inverted by calling subroutine INVERSE. The values
For the problem in Fig. 7, the three sets of data for co- of the potentials at all nodes are obtained by matrix mul-
ordinates, element-node relationship, and prescribed po- tiplication as in (31)b. Instead of inverting the global ma-
tentials at fixed nodes are shown in Tables I, 11, and 111, trix, it is also possible to solve for the potentials at the
respectively. The data are inputted according to the cor- nodes using Gaussian elimination technique.
responding format in the program in the Appendix. Step 4: This involves outputting the result of the com-
Step 2: This step entails finding the element coefficient putation. The output data for the problem in Fig. 7 are
matrix [ C'"] for each element and the global matrix [ C 1. presented in Table IV.
The procedure explained in the previous example is ap- The validity of the result in Table IV is checked using
plied. The matrix [ B ] on the right-hand side of (37) is finite difference method. From the finite difference anal-
also obtained at this stage. ysis, the potentials at the free nodes are obtained as
92 IEEE TRANSACTIONS ON EDUCATION, VOL. 32, NO. 2, MAY 1989
X L f J ) = X(K1
CONCLUSIONS YLIJ) = YIK)
60 CONTINUE
Pf1) = YLl2) - YL(31
The finite element method was originally expounded for P(2) = YL(3) - YLl1)
Pl3) = YLi1) - YLf2) ~~
civil engineering applications but has recently seen in- Q l l ) = XLf3) - XLIZI
Ql2) = XLl1) - XL(31
creasing applications in EM. A brief, tutorial introduction Ql3) = XLf2) - XLf1)
AREA = 0.5*ABSl P(2)*Ql3) - Ql2)*Pl3) )
to the method has been presented. The method is applied C DETERMINE COEFFICIENT MATRIX FOR EL=
DO 70 M=1,3
I
120 CONTINUE
C(IR,IRI = 1.0 REFERENCES
B(IR1 = VAL(K1
130 CONTINE R. Courant, “Variational methods for the solution of Problems of
140 CONTINUE
C .............................................. Equilibrium and vibrations,” Bull. Am. Math. Soc.. vol. 49, 1943.
C THIRD STEP - SOLVE THE RESULTING SYSTEM OF J. F . Hoburg and J . L. Davis, “A student-oriented finite element pro-
C SIMULTANEOUS EQUATIONS
C ............................................. gram for electrostatic potential problems,” IEEE Trans. Educ.. vol.
NMRX=100 E-26, pp. 138-142, NOV. 1983.
CALL INVERSE(C.ND.NMRX1
DO 150 I=l,NO -, “Enhanced capabilities for a student-oriented finite element
V(I1 = 0.0 electrostatic potential program,” IEEE Trans. E d u c . , vol. E-28, pp.
00 150 J=l,ND 25-28, Feb. 1985.
VI11 = VI11 + ClI,J)*B(Jl
150 CONTINUE S . R. H. Hoole and P. R. P. Hoole, “Finite element programs for
C ............................................. teaching electromagnetics,” IEEE Trans. Educ., vol. E-29, Feb.
C FOURTH STEP - OUTPUT THE RESULTS, THE POTENTIAL
C V ( I 1 AT NODE I, I = 1.2.. ... ND 1986.
C ............................................... R. F. Harrington, Field Computation by Moment Methods. Malabar:
WRITE(6.1601 ND,NE,NP
160 FORMAT(2X,’NO. OF NODES = ’,13,2X,’NO.OF ELDlENT.5 = ’ Kriger, 1968.
1 13,2X,’NO. OF FIXED NODES = ‘.13,Il W . H. Hayt, Engineering Elecrromagnerics. New York: McGraw-
WRITE(6.1701 Hill, 1981, pp. 121, 184-192.
170 FORMAT(ZX,’NODE’,SX,’X Y’.7X.‘POT€VTIAL’,/l
wRITE(6,1801 (I, X(I1, Y(I1. V(I1, I-1.ND I P. P. Silvester and R. L. Ferrari, Finite Elements f o r electrical En-
180 F0RMAT12X,13.2X,F6.2,2X,F6.2,2X,F10.4,/1 xineers. Cambridge: Cambridge Univ. Press, 1983, pp. 1-32.
STOP
EN0 [8] C. R. Paul and S . A. Nasar, Introduction t o Electromagneric Fields.
New York: McGraw-Hill, 1982, pp. 465-472.
[9] 0. W . Andersen, “Laplacian electrostatic field calculations by finite
elements with automatic grid generation,’’ IEEE Trans. Power Ap-
C SUBROUTINE INVERSE paratus S y s t . , vol. PAS-92, no. 5 , Sept./Oct., pp. 1485-1492, 1973
C SX IS THE MATRIX TO BE INVERTED; IT IS DESTROYED [IO] D. R. J . Owen and E. Hinton, A Simple Guide t o Finite Elements
C IN THE COMPUTATION AND REPLACED BY THE INVERSE Swansea: Pineridge Press, 1980, pp. 47-79.
C N IS THE ORDER OF SX
C IDM IS THE DIMENSION OF SX 1111 E. Hinton and D. R. J . Owen, An Introduction to Finite Elemenr
SUBROUTINE INVERSlSX,N,IDMl Computations. Swansea: Pineridge Press, 1985, pp. 328-326.
DIMENSION SXlIOM,IDMl [I21 W . R. Buell and B. A. Bush, “Mesh generation-A survey,” Trans
ESP=l.OE-5 ASME, J . Engng. Ind., pp. 332-338, Feb. 1973.
00 50 K.1.N
DO 30 J.1.N
IF(J.EQ.Kl CO TO 30
IF1 ABSlSX(K,Kll I 20,10,20
10 SXlK.Kl=ESP
20 SX(K 1J I =SX(K,J I /SXlK ,Kl
30 CONTINUE
SX(K ,KI = ? . 0E X ( K, Kl
DO 40 I.1.N
IF(1.EQ.K) GO TO 40
DO 40 J=l,N
IF(J.EQ.K) GO TO 4 0
SX(I,Jl=SX!I.Jl- SX(K.JI*SX(I,KI
40 C0 NTINUE
D O 50 I=l,N
1FII.EQ.K) GO TO 50 Matthew N. 0. Sadiku graduated from Ahmadu
S : < ! I . K l = - CX(I,Kl+SX(K.Kl Bello University, Zaria (Nigeria) and received the
50 CONTiNUE
RFIURN M.S. and Ph.D. degrees from Tennessee Tech.
END University, Cookeville.
He is currently an Assistant Professor of Elec-
ACKNOWLEDGMENT trical Engineering at Temple University, Phila-
delphia. PA. He was formerly at Florida Atlantic
The author would like to express his appreciation to Y. University, Boca Raton. He is the author of Ele-
Kim and L. Agba for their review and helpful comments ments of Electromagnetics (HRW, 1989). His
current research interests are in numerical tech-
on the manuscripts. The corrections and comments of the niques in electromagnetics, local area computer
reviewers are also appreciated. networks, and superccnductivity.