Академический Документы
Профессиональный Документы
Культура Документы
Keywords: linear systems; conjugated gradients methods; symbolic and numeric computa-
tion tools; MAPLE; MATLAB
algoriths. However, the generation of such computa- rithm and software development, problem-solving,
tional tools as MAPLE, DERIVE, MATHEMATICA, statistical analysis, verifying correctness, and analysis
MATLAB, MATHCAD, to mention some, has moti- of accuracy and reliability. We also highlight in
vated a deep revision of the traditional teaching ways Table 4 of Ref. [5] (indicates selected associations
in engineering, allowing the students to concentrate between areas of mathematics and applications en-
more on the design, and less on routine calculation countered in the site visits) the Numerical Analysis
procedures. turned out to be essential in all the applications.
In this article, an integral approach is presented to It clearly establishes the relevance of evaluating
strengthen the teaching and learning processes in the the use of computational resources in the environment
environment of the undergraduate course on NA for of the teaching and of the learning of the NA, speci-
engineering, examining the advantages of combining fically, the iterative solution of LS.
the symbolic and numeric paradigms [1]. In the first
section, we review the importance of the NA in the
making of an engineer. In the second section, we ITERATIVE METHODS FOR SOLVING
present the iterative methods: Gauss–Seidel (GS) and LINEAR SYSTEMS
Conjugated Gradient (CG), for the numeric solution
of Linear Systems (LS). Methods of the type CG, are In recent years, much research have focused on the
not usually incorporated in undergraduate courses, efficient solution of large sparse or structures linear
however, we show that the merged use of MAPLE and systems using iterative methods [6–8].
MATLAB allow the intutive understanding of their Small matrices, say with dimension 3 or 30, may
theoretical foundations and their practical use in the arise directly with more or less arbitrary entries in
solution of LS [2]. In the third section, we presented scientific problems as representations of the rela-
a teaching model and learning that it incorporates tions between three forces in a structure, perhaps, or
varied learning experiences for the students based between 30 species in a chemical reaction. Large
on the use of MAPLE and MATLAB. The excellent matrices, by contrast, usually arise indirectly in
thing is that the use of such tools as MAPLE and the discretization of differential or integral equations.
MATLAB turn out not to be useful alone just to The most obvious structure of a large matrix is spar-
strengthen the teaching of the discipline but also as sity, i.e., preponderance of zero entries. For example,
learning instruments. a finite difference discretization of a partial dif-
ferential equation may lead to a matrix of dimension
n ¼ 100,000 with only 10 non-zero entries per row.
NUMERICAL ANALYSIS This kind of structure is readily exploited by the
AND ENGINEERING iterative methods. The methods described are most
often useful for very large sparse or structured ma-
Accrediation Board for Engineering and Technology, trices, for which direct methods are too costly in terms
U.S. (ABET) developed Engineering Criteria 2000 [3]. of computer time and/or storage.
The criteria state that engineering programs must The relative chapter to the iteratives methods to
demonstrate that their graduates have, among others, solve LS in a standard course of NA considers the
an ability to apply knowledge of mathematics, science methods of Jacobi, Gauss–Seidel, SOR, and possibly
and engineering, an ability to design and conduct ex- SSOR [9,10]. On the other side, the numeric solution
periments as well as to analyze and interpret data, and of partial differential equations requires the use of
an ability to design a system, component, or process. modern iterative methods, such as, Preconditioned
The importance of an appropriate mathematical for- Conjugate Gradients Method (PCG), BiConjugate
mation is clearly established [4]. Gradients Method (BICG), BiConjugate Gradients
The Siam Report [5] shows that in non-academic Stabilized Method (BICGSTAB), Conjugate Gradi-
organizations, the mathematics is present in such ents Squared Method (CGS), Generalized Minimum
activities as: research and development of mathema- Residual Method (GMRES), Minimum Residual
tical tools and algorithms, creation and support of Method (MINRES), Quasi-Minimal Residual Method
mathematical and computational techniques asso- (QMR), and Symmetric LQ Method (SYMMQL),
ciated with a specific product or service, and consult- (see directory sparfun in MATLAB), that are not
ing or modeling for internal or external customers. treated in the undergraduate course of NA. We post-
The mathematical functions of greatest value were ulate the incorporation of the method CG, to the
characterized by managers as modeling and simula- standard course of NA, like an extrance door to the
tion, mathematical formulation of problems, algo- modern iterative methods.
TEACHING AND LEARNING ITERATIVE METHODS 53
Iterative Method of Gauss–Seidel putation shows that for all scalar t: qðx þ t v Þ ¼
qðx Þ þ 2thv ; Ax bi þ t2 hv ; Av i, because A ~ is ~sym-
The problem is to solve the LS: Ax ¼ b,where A is an ~ ~ ~ ~ ~ ~
metrical. On the other hand, the t value that gives us
n n non-singular matrix and b ~is a ~given n-vector.
the minimum point is; evaluating qðx þ ^t vÞ in ^t,
If A ¼ L þ D þ U, where, L ~is the strict inferior
q ðx þ ^t vÞ ¼ qðxÞ hv ; b Ax i2 =hv ; Av~i. The ~ calcu-
triangular matrix of A, D is the diagonal matrix of ~ ~ ~ ~ ~ ~ ~ ~
lation previous sample that when happening of x
A and U is the strict upper triangular matrix of A,
to x þ ^t v there is always a reduction in the value of~
the LS: Ax ¼ b is equivalent to (L þ D þ U) x ¼ b , ~ unless~
~ ¼ ~ Ux þ b , i.e., x ¼ (L þ D)1 ~ Ux~þ q(x), v be orthogonal to the residual, i.e.,
i.e., (L þ D)b
1 ~ ~ ~ ~ ~ hv ; b Ax i ¼ 0, starting from that which the equi-
(L þ D) b . Starting from this last equality is defined ~ ~ ~presented in the Fundamental Lemma is
~ valence
the iterative succession of GS:
deduced easily.
The previous proof suggests the following
x ðlþkÞ ¼ ðL þ DÞ1 Ux ðkÞ þ ðL þ DÞ1 b ; k iterative method to solve Ax ¼ b : x ðlþkÞ ¼ x ðkÞ þ
~ ~ ~ ~ i=hv~ ðkÞ
~ ; Av ðkÞ i:~
tk v ðkÞ , where, tk ¼ hv ðkÞ ; b AxðkÞ
¼ 0; 1; 2 . . . ~ A natural election ~ ~of search
~ ~ ~ v ðkÞ is
direction
ðkÞ
minus gradient of qðx Þ evaluate in x , which points ~ in
which is convergent if A is symmetric and definite ~ ðkÞ ~
the direction of the residual r ¼ b Ax . There- ðkÞ
a) Let be fuð1Þ ; uð2Þ ; . . . ; uðnÞ g an A-orthonormal the learning process. They are determinant to define
system. ~ ~ ~ the evaluation approaches. The Learning Activities
ðiÞ ði1Þ
Define x ¼ x þ hb AxðilÞ ; uðiÞ iuðiÞ ; 1 are actions and processes that the students have to live
~
i n, where, x is an~ arbitrary
~ ð0Þ ~ ~point
~ of <n . to achievement of the Prospective Learnings. In this
ðnÞ
Then Ax ¼ b. ~ sense such tools as MAPLE and MATLAB are
b) Let be ~fv ð1Þ ; v~ð2Þ ; . . . ; vðnÞ g an A-orthognal set of powerful resources for the design and implementation
vectors ~not null.
~ ~
h bAxði1Þ ; vðiÞ i of Activities of Learning.
ðiÞ ði1Þ
Define x ¼ x þ ~ hvðiÞ~; AvðiÞ~i vðiÞ ; 1 i n;
~ ð0Þ ~
where, x is an arbitrary ~ ~point ~ of <n . Then
ðnÞ ~
Ax ¼ b. Contents
~ ~
Another distinctive property of the CG method The considered topics are the GS and CG methods
is that the residuals form a system orthogonal in in the numeric solution of system of lineal equation
the ordinary sense, that is to say, h rðiÞ ; rðjÞ i ¼ 0; context. Previously, the students have to know Linear
i 6¼ j. ~ ~ Algebra.
In the Table 1, Algorithm 1, [10], is a formal
version of the CG method that incorporates the
Prospective Learnings
previously established characteristics. On the other
hand, the Algorithm 2, [10], is a modification of the We propose the following prospective learnings:
Algorithm 1 that allows an implementation more
efficient computational, while the third column, titled 1) They distinguish conceptually between direct
Program 2, [2], is a m-file of MATLAB starting from and iterative methods to solve LS.
the Algorithm 2. 2) They know the definition and properties of the
following iterative methods: Jacobi, Gauss–
Seidel, SOR, SSOR and CG. However, in this
MODEL OF TEACHING AND LEARNING article we will only make mention to GS and
CG methods.
The Model of Teaching and Learning consists of the 3) They understand the conceptual foundations of
definition (to-priori) of Prospective Learnings and the family of methods of the type Conjugated
the design of Activities of Learning. The Prospective Gradient.
Learning express the capabilities and competitions 4) They outline problems that involve the iterative
that is desired that the students achieve. They guide solution of LS.
the pedagogic process and they give a direction to 5) They apply iterative procedures to solve LS.
Naturally, these prospective learnings can be modified following LS of forces can be developed defining the
and/or adapted. interrelations among the springs:
2 32 32 3
Learning Activities k1 k2 k2 0 0 x10
6 k2 k2 k3 k3 0 7 6 x2 7 6 0 7
7 6 7 6
Each Learning Activities suggested can be imple- 6 7
6 76 76 7:
mented, adapted to a special reality, or substituted by 4 0 k3 k3 k4 k4 5 4 x3 5 4 0 5
others that are considered more pertinent. 0 0 k4 k4 x4 F
1. Given the system Ax ¼ b; n ¼ 2; 3; . . . the
student should verify: if A is ~symmetirc
~ and positive
definite. It should also build explicitly the form The following Worksheets 2 of MAPLE allow to solve
quadratic qðxÞ ¼ hx;Axi 2hx; bi, to obtain the point the system in exact form:
~
which possesses ~ ~ minimum
their ~ ~ value, and finally
to compare this point with the exact solution of the Worksheets 2
sytem Ax ¼ b; n ¼ 2; 3; . . . > eq[1]: ¼ k[2]*(x[2]x[1]) ¼ k[1]*x[1];
Example: ~ The~ exact solution of LS: ½2 1½x1 ¼ ½1 is > eq[2]: ¼ k[3]*(x[3]x[2]) ¼ k[2]*(x[2]x[1]);
1 3 x2 3
given by x1 ¼ 6=5; x2 ¼ 7=5, the following instruc- > eq[3]: ¼ k[4]*(x[4]x[3]) ¼ k[3]*(x[3]x[2]);
tions in MAPLE (Worksheets 1) they allow to > eq[4]: ¼ F ¼ k[4]*(x[4]x[3]);
generate the quadratic form qðxÞ ¼ hx; Axi 2hx; bi > solve({eq[1], eq[2], eq[3], eq[4]}, {x[1], x[2],
and to obtain its minimum value. ~ ~ ~ ~ ~ x[3], x[4]});
Worksheets 1 Table 2 shows the exact solution obtained with
> with (linalg): MAPLE.
> A: ¼ matrix (2, 2, [2, 1, 1, 3]); Notice that one of the advantages of having the
> b: ¼ matrix (2, 1, [x1, x2]); exact solution resides in the possibility of varying the
> x: ¼ matrix (2, 1, [x1, x2]); constants of the springs freely together with the value
> q(x): ¼ simplify(evalm(transpose(x) & A & of the force F. Together with the above-mentioned
*x2* transpose(x) & *b)); specific values can be assigned to the constants and to
> readlib(extrema): solve the LS using a direct method, GS and/or CG.
> extrema(q(x),{}, {u,v},‘s’); 3. Build a program in MATLAB for the iterative
> with (plots): methods: GS and CG.
> plot3d(q(x),x1 ¼ 5..5, x2 =0..5); Example: See Programs 1 and 2 of this article, for
> minimize(q(x)); the GS and CG methods, respectively. Notice the
didactic value that possesses the correspondence
Another system on which you could apply a among the Program 2 and the Algorithm 2, which
similar worksheets to the Worksheets 1 is formed for arises as consequence of using MATLAB. This
2 3 2 3 correspondence allows a soft transition among the
2 0 1 1 mathematical foundations (Algorithm 1) and the
6 7 6 7 computational implementation (Program 2).
A ¼ 4 2 10 0 5; b ¼ 4 12 5
~ 4. Test the Programs 1 and 2 in LS generated by
1 1 4 2
the numeric solution of Partial Differential Equations.
Example: Consider the problem that consist of finding
Notice that the exact solution is given for x1 ¼ x2 ¼
a function uðx; yÞ, such that
x3 ¼ 1, while the application of the Worksheets 1 to
this system hurtle as a result that the minimum value
of qðxÞ, it is reached in x1 ¼ 3=2; x2 ¼ 1; x3 ¼ 1. @ 2 uðx; yÞ @ 2 uðx; yÞ
þ ¼ x þ y; for all ðx; yÞ 2 D
However, notice that the main matrix, A, is not @x2 @y2
symmetrical and it is not positive definite, in fact, ¼ fðx; yÞ 2 <2 : 0 < x < 2
it possesses a negative eigenvalue. This activity for and 1 < y < 2:5g;
the learning allows the student to value the importance
of the hypotheses in the mathematical theorems.
Table 2 Exact Solution
2. The systems idealized mass-spring as having
numerous applications in the whole engineering. 1 2 3 4
One has an arrangement of 4 springs in series that F Fðk1 þk2 Þ Fðk1 k2 þk2 k3 þk1 k3 Þ Fðk1 k2 k3 þk1 k2 k4 þk2 k3 k4 þk1 k3 k4 Þ
are compressed with a force F. In the balance, the k1 k1 k2 k1 k2 k3 k1 k2 k3 k4
56 CARIAGA AND NUALART
and uðx; yÞ ¼ xy, for all ðx; yÞ, in the boundary of D. Similarly, if h ¼ 1=10, GS needs 301 iterations while
It is possible to obtain a discrete version of CG needs 95, where the order of LS is n ¼ 266.
5. Make an empiric comparison among the
@ 2 uðx;yÞ 2
@x2 þ@
uðx;yÞ
@y2 ¼ x þ y, if the approximation for- methods GS and CG if the LS is not well conditioned.
1
mulas @ @x
2
uðx;yÞ
ffi uðxþh;yÞ2uðx;yÞþuðxh;yÞ
2
; and @ @y
uðx;yÞ
ffi Example: Solve the LS: Ax ¼ b, where aij ¼ iþjþ1 ;
~
2 h2 2 1 n ~ ~
bi ¼ 3 j¼1 aij ; 1 i; j n, using the GS and CG
uðx;yþhÞ2uðx;yÞþuðx;yhÞ
h2 ; are used. methods. The exact solution is xi ¼ 1=3; i ¼1; . . . ; n:
The evaluation of this discreet outline, with h ¼ 1=2, The Program 3 (m-file of MATLAB), generates the
it generates the LS, Ax ¼ b; n ¼ 6, where, matrix A and the vector b, for all n.
~ ~ ~
Programa 3
2 3
4 1 0 1 0 0 function [A,b] ¼ hilbert(n)
6 1 4 1 0 1 07 for i ¼ 1: n;
6 7
6 7 for j ¼ 1: n;
6 0 1 4 0 0 1 7
A¼66 1
7and A (i,j) ¼ 1/(iþjþ1);
6 0 0 4 1 077 end
6 7
4 0 1 0 1 4 1 5 end
0 0 1 0 1 4 for i ¼ 1: n;
2 3 b(i) ¼ (1/3)*sum(A(i,:));
1:875
6 3:25 7 end
6 7 b ¼ b’;
6 7
6 8:625 7 The Sequence 1, implemented in the line of commands
b¼6 7
~ 66 1 7
7 of MATLAB, solves the LS for n ¼ 20, using GS and
6 7 CG methods, and graph both solutions:
4 1:625 5
5:25 Sequence 1
> [A,b] ¼ hilbert(20);
A simple application of the command solve of > x0 ¼ zeros (20,1); M ¼ 500; eps ¼ 1e30; ¼ delta
MAPLE allows us to obtain, at least, 19 digits of ¼ 1e30;
> [x, k, r] ¼ cg (A, b, x0, M, eps, delta);
2 3 > y ¼ gs (A, b); t ¼ 1:20;
1321=966
> plot(t, x, ‘o’, t, y , ‘--’)
6 3233=1288 7
6 7
6 7
6 6667=1932 7 It is requested the student that interprets the obtained
6
the exact solution : x ¼ 6 7
~ 6 524=483 7 7
graph.
6 7 6. Consider the problem of electric engineering
4 635=322 5
that consists on determining the
2
electrostatic potential
5155=1932 @ 2 Vðx;yÞ
2 3 V ¼ Vðx; yÞ, such that, ð@ Vðx;yÞ
@x 2 þ @y 2 Þ rho
¼ epsilon,
1:3674948240165631470 2
on the annular region D ¼ fðx; yÞ 2 < : =x þ y < 2 2
6 2:510093167701863540 7 1 ^ x2 þ y2 > 1=3 g, y Vðx; yÞ ¼ gðx; yÞ, along the
6 7
6 7 interior and external boundary of D, where, epsilon
6 3:4508281573498964803 7
¼6 7
6 1:0848861283643892340 7: is the coefficient of dielectricity and rho is the space
6 7 charge density.
6 7
4 1:9720496894409937888 5 The command: spy(numgrid (‘A’, 50)), of
2:6682194616977225673 MATLAB, generates Figure 1, which shows the
annular region with the points in which will approach
the electrostatic potential
The application of the Program 1 (Gauss–Seidel) Suppose that rho,epsilon and g(x,y), are such that,
generates the integer and 15 decimals (format long of b ¼ ðbi Þ; bi ¼ 1; 8i ¼ 1 : 1252 for the LS Ax ¼ b
~
MATLAB) of the exact solution after 40 iteratons, where, A is the matrix of a five-point finite~ dif- ~
while the Program 2 (Conjugated Gradient) generates ference approximation of Laplace’s equation on the
the same thing in 6 iterations. Notice that the 6 annular region D. The command of MATLAB:
iterations required by the CG method illustrate A ¼ delsq(numgrid(‘A’,50)) it generates A. The
the result fundamental content in the Fundamental command spy(A) generates Figure 2, i.e., sparsity
Theorem. patron of A. The order of A is n ¼ 1252.
TEACHING AND LEARNING ITERATIVE METHODS 57
Activities of Evaluation
The evaluation is considered part of the learning
process. It should provide the student and the pro-
fessor of the necessary feedback as relating to con-
tinue, to correct, and to guide and future activities.
CONCLUSIONS
[7] A. Greenbaum, Iterative Methods for Solving Linear Applications, 3rd. edn., McGraw-Hill Companies,
Systems, SIAM, 1997. Inc. (1999), pp 235–349.
[8] Ll. N. Trefthen and D. Bau, Numerical Linear [10] D. Kincaid and W. Cheney, Numerical Analysis:
Algebra, SIAM, 1997, p 321. Mathematics of Scientific Computing, Ist edn.,
[9] S. C. Chapra and R. P. Canale, Numerical methods Brooks/Cole Publishing Company, Wadsworth Inc.,
for Engineer with Programming and Software Belmont, California (1991), pp 185–223.
BIOGRAPHIES
Emilio Cariaga is an assistant professor in M. C. Nualart is an assistant professor in the School of Informatics
the Department of Mathematical and Physical at the Catholic University of Temuco, Chile. She received BS degree
Sciences at the Catholic University of (1992) in Informatics Engineering from the University of Concep-
Temuco, Chile. He was born in Valdivia, ción, Chile. Her interests are in computer applications in engineering
Chile, 1967. He received BS (1992) and MS education and in software development.
(1996) degrees in mathematics from the
Universidad Técnica Federico Santa Maria,
Valparaı́so, Chile. His interests are in compu-
ter applications in engineering education and
interest in modeling of transport phenomena.