Lecture 10
●
MEEN 357 Homework Solution
1
Lecture10HomeworkSolution2009.doc
RMB
1.
Problem 12.1(a) of the textbook.
Solution
:
You are asked to use the GaussSeidel method to solve
1
2
3
0.8
0.4
0
41
0.4
0.8
0.4
25
0
0.4
0.8
105
x
x
x
−
⎡
⎤⎡
⎤
⎡
⎤
⎢
⎥⎢
⎥
⎢
⎥
−
−
=
⎢
⎥⎢
⎥
⎢
⎥
−
⎢
⎥⎢
⎥
⎢
⎥
⎣
⎦⎣
⎦
⎣
⎦
(10.1)
You are instructed to continue the iteration until the percent relative error falls below
5%
s
ε
=
.
You can work this problem by hand or by use of the function mfile
GaussSeidel.m
introduced in class.
The solution here uses the function file.
The
MATLAB script
%Problem 12.1a of the textbook.
clc, clear
all
A=[0.8,0.4,0;0.4,0.8,0.4;0,0.4,0.8]
b=[41;25;105]
x0=[0;0;0]
x=GaussSeidel(A,b,x0,5)
yields the output
x =
167.8711
239.1211
250.8105
in 6 iterations.
The above solution starts the iteration at
x0=[0;0;0]
.
A different
starting point would produce the same answer in a different number of iterations.
2.
Problem 12.2 of the textbook.
Solution
:
The problem is essentially the same as the first one above except that the
system of equations is
1
2
3
10
2
1
27
3
6
2
61.5
1
1
5
21.5
x
x
x
−
⎡
⎤⎡
⎤
⎡
⎤
⎢
⎥⎢
⎥
⎢
⎥
−
−
=
−
⎢
⎥⎢
⎥
⎢
⎥
−
⎢
⎥⎢
⎥
⎢
⎥
⎣
⎦⎣
⎦
⎣
⎦
(10.2)
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Lecture 10
●
MEEN 357 Homework Solution
2
Lecture10HomeworkSolution2009.doc
RMB
As with the first problem above, you are instructed to continue the iteration until the
This is the end of the preview.
Sign up
to
access the rest of the document.
 Fall '07
 ANAMALAI
 Numerical Analysis, Newton Raphson, Tier One, Scaled Composites, Scaled Composites White Knight

Click to edit the document details