Escolar Documentos
Profissional Documentos
Cultura Documentos
Abstract-Four application problems are presented which have method. Such perceptions, whether justified or groundless,
been found to facilitate introductory instruction on numerical nevertheless affect student attitude and performance. The
methods for undergraduate electrical engineering students. The introductory approach reported here takes advantage of the
method of moments (MOM) is introduced at the level of first
principles, preparing students for subsequent advanced topics in fact that students at this level are more familiar with the
matrix methods and developments through Linear vector space relevant mathematics than with the electromagnetics. Problems
theory. The problems are such that the associated computer such as those presented in this paper stimulate interest and
programming assignments are straightforward, minimizing dis- provide valuable positive reinforcement to students through
traction from the mathematical concepts. Numerical solutions the exhilaration of success in a reasonable time frame.
may be obtained, or verified, with a pocket calculator in some
cases. Computer programs to obtain more sophisticated graphics The material in this paper, as indicated by the title, is
output and to expedite solution of equations with large matrices introductory in nature. It is intended that instructors will not
can be progressively added as supplementary student exercises. dwell at length on these problems, but will promptly proceed
to appropriate, and progressively more challenging, physical
1. INTRODUCTION problems.
so that the progression m = 1 , 2 , 3 . . . , N yields a set of As indicated in the previous section, the elements ,C, of the
equations which can be expressed in matrix form as matrix L are determined by integration, for n = 1 , 2 , . . .,N
N
and m = 1,2,...,N
L
N 1%) = 1974 (5)
vectors, explicitly
while elements in the column vector 19,) are determined by
N
f = nc
1
Note that to say that the basis functions are in the domain of the exact solution in this case. For other problems, where a
L requires that the functions satisfy both boundary conditions. finite sum for f fails to give an exact solution (see Examples
Also, application of Galerkin's method [8], [9] means that the 3 and 4), we expect to obtain approximate solutions which
basis functions f n and testing functions w, are chosen to be converge to exact results as N increases. A representative
the same. The Galerkin method is illustrated in Examples 1 MAT LAB^^ 1101 program for the computational aspects of
and 3. this problem is the following:
clear;
A. Example I N = input('VuZue of N...')
Obtain a MOM numerical solution of the basic problem as for m = 1:N ;
stated in (8) , using Galerkin's method with the choices of + +
gm(m)= ( m* ( m l ) ) / ( ( m 2 ) * ( m 3)); +
fn -- x - Zn+l = ~ (-1x,) and g = 62 - 2 = 2 ( 3 - ~ 1). for n = 1 : N ;
Solution: The solution sought is f, which is related to the L ( m , n ) = ( m * n ) / ( m n I);+ +
basis functions f n through the series expression for f end; end;
gm = gm';
N
Linv = inv(L);
(9) alphan = Linv * gm;
n=l
z = 0 : .U1 : I ; z = 2'; f = zeros(length(x),I ) ;
as discussed in connection with (2) above. The number of exact = (x."2). * ( 1 . - x);
basis functions combined into the composite solution function for n s = 1 : N ; f = f + ( a l p h a n ( n s ) . * ( z . * ( l . - z . A n s ) ) ) ;
f is N, and the a, are coefficients to be determined by the end;
numerical solution procedure. To apply Galerkin's method, it
is required that Plotting statements are not included in the program above;
for MATLAB, plotting by means of keyboard command entry
w, wn(x) = f,(x) = x(1 - 2 " ) . (10) is both flexible and convenient. Plots for the solutions N = 1
~
and, associated with the match points, the Dirac delta function
0.14- N=2 and
20, = S(x - 2,) (18)
0.12-
is selected for the testingweighting function. Solution of this
/ problem allows students to see that the use of S functions as the
0.1 - /
N=l / method of testing causes the LHS (using the numerical method
/
series solution for f ) and RHS of the problem equation, (16)
in this case, to be precisely equal at the specific spatial match
points where the S functions reside.
/ Evaluation of the elements lmnand g, again requires two
0.04
integrations, which are expedited by the sifting property of
the S function
0.021,/ /
I/ /
"
0 0.1 0.2 0.3 0.4 0.5
X
0.6 0.7 0.8 01.9 1 @(x - x,)]dx = (n)(n + l)(g)n-l
Fig. 1 Numerical and exact solutions for Example 1
and
1
gm = ( 9 ,w,) = J [4 - 12x2][S(z- x m ) ] d x
and N = 2 = exact are given in Fig. 1. If one escalates to 0 (20)
2
higher values for N , a1 = -1 and a2 = +1 in all cases, but = 4 - (12)(G) .
the higher coefficient values turn out to be zero. For example, Case results for three values of N follow. For N = 1
a3 = a4 = 0 for the specific case N = 4.
Cl1 = 2.0, 91 = -8.0, CY^ = -4.0,
A student learning exercise is to explore the fact that raising and f = a1z(1 - x') = 4x(x - 1). (21)
N to a sufficiently large value causes the matrix to become
nearly singular or badly scaled, and to compare solutions by Using (17), x1 = 1. The LHS of (16) is = -8, and the -$
Gauss elimination against the direct matrix inversion algo- RHS (namely 4 - 1 2 ~ ' )is also 4 - 12 = -8 at x1 = 1.
rithm. The Gauss elimination procedure can be invoked in The case N = 2 results in
MATLAB by changing the two lines
Linu = inu(L)
alphan = Linu * gm
in the program listing above to the single statement
and the corresponding series solution is
alphan = L\gm 2
f= a n [ x ( l - P ) ]= 5x(l - x) - 3x(1 - x2)
using the left division operator which is provided in MATLAB n=l (23)
in addition to the customary right division operator. For this = x(2 - 52 + 3x2).
particular problem, N greater than approximately 11begins to
cause reliability warnings for the standard inversion procedure, Eq. (16) for the f of (23) has LHS=RHS=l for x1 = and
while the corresponding number using Gauss elimination is -8 for 5 2 = 1.
about N = 83. Finally, for N = 3
r2.00 2.00 1.331 r 2.667 1
B. Example 2
For different source g(x) = -12x2 + 4 = 4(1 - 3x2), find
the solution f for
1%) =L-' 19,) =
d 2f = 4(1 - 3x2),
N
-~ f ( 0 ) = f(1) = 0 (16)
dx2 which allows computation of the three-term expression for f
by the use of point-matching. The choice of basis functions 3
f , = x(1 - 2") is continued from Example 1 .
Solution: While point-matching [ 1 11, [ 121 may appear to be
f = can[4
n=l
- xnll = Q l f l + a2f2 + a s f 3 (25)
a different method to students, it can be shown readily [13]
= x ( l - 2x + x3).
that point-matching is encompassed by MOM. To arrive at a We note that - 2
= 4 - 12x2 now, so that (16) is satisfied
point-matching solution, N equispaced points on the interval
0 5 x 5 1 are selected
for all x, as well as at x1 = ;,x2 = 5,
and 2 3 = 1 . Fig. 2
has plots of the three cases against the exact solution, which is
m f = x( 1- 2x+z3), so that the numerical solution for N 2 3 is
x, = - N' m = 1 , 2 , . . . ,N (17)
seen to provide exact results for this problem. Larger N values
388 IEEE TRANSACTIONS ON EDUCATION, VOL. 38, NO. 4, NOVEMBER 1995
I
1 0.151
I _ . . - . - . _N=2
_ I
\
4L51 \\\
\ N=l
\ /
\ /
\ /
\ /
\ /
-1
0 0.1 0.2 0.3
\
\
0.4
> - ,
0.5
- I
,
I
/ -
Fig. 2 Numerical and exact solutions for Example 2. Fig. 3. N = 1 , 2 , 3 , 4 and exact solutions for Example 3.
will again drive the matrix L toward becoming singular, with N = 2 produces
N L= r . 1 3 3 0.2331
concem in this case arising when N is approximately 19 or 0.067
larger for direct matrix inversion, or approximately 99 when 0.233 0.419 Igm) = [ I o . ~ ~ z(31)
]
Gauss elimination is used. 5.3338
Ian) =L-' N
1%) =
zmlda: =
n
+
(mn)(7m 3mn 7n 15) + + combination of the basis functions alfl a2 f 2 +
a s f 3 . . ., +
.[X2(1-
+
3(m 3)(n 3)(m n 3) + + + the numerical solution remains an approximation for finite
N . Using Gauss elimination, the upper size limit for N is
approximately 68, compared to about 10 using direct matrix
inversion.
1
gm = (g,w,) = J 4 ( 1 - 3z2)x2(1- xm)& (29) D. Example 4
0
- - (8m)(2m+l) Solve the boundary-value problem from (8) with g ( x ) =
15(m+3)(m+5).
4( 1 - 3x2) using triangle functions as the expansion functions
Convergence of the solution as N is increased is readily and pulse testing functions, as defined below. The triangle
demonstrated. Starting with the case N = 1 functions, fn = A(z - xn), are
ell = 0.133 91 = -0.067 (yl = -0.500
(34)
and f = a1z2(1 - E ' ) .
WHELESS AND WURTZ: INTRODUCING UNDERGRADUATES TO THE MOMENT METHOD 389
0.151 where S is the Dirac delta function and L has the general
- 2 -1 0 ". 0 0 0
-1 2 -1 ... 0 0 0
0 -1 2 ... 0 0 0
.. ..
L=(N+1)2
N
; . . . (39)
0 0 0 ... 2 -1 0
0 0 0 ... -1 2 -1
- 0 0 0 ..' 0 -1 2
1
gm = (g,w,) = J4(1 - 3 z 2 ) ( N + l)II(x - xm)dx
0
",+&
-0.1'
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 = 4(N + 1) J
1
(1 - 322)dz.
X
x m - g o
Fig. 4 Ar = 10 and exact solutions for Example 3. (40)
The upper and lower limits are modified from the original
A
values of 0 and 1,respectively, as required in order to conform
with the defined extent of the pulse function in z (see Fig. 5).
In view of ( 3 3 , it can be shown that
gm=4-
12m2 +1
(N + 1)2 '
--" -
Fio 5 Trianole ( A ) and nnlw (IT) functions
__\..,____
REFERENCES
V. CONCLUSION W. Perm Wheless. Jr. (M85-SM88) received both the Bachelors deeree
I - ~