0% found this document useful (0 votes)
10 views12 pages

Assigment 4

The document outlines various numerical analysis methods, including the Newton-Raphson and Gauss-Seidel methods, to find roots of equations and solve systems of equations. It provides detailed solutions with iterations and convergence criteria for each method. The document includes multiple examples with initial guesses and accuracy specifications.

Uploaded by

hadiled1234
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views12 pages

Assigment 4

The document outlines various numerical analysis methods, including the Newton-Raphson and Gauss-Seidel methods, to find roots of equations and solve systems of equations. It provides detailed solutions with iterations and convergence criteria for each method. The document includes multiple examples with initial guesses and accuracy specifications.

Uploaded by

hadiled1234
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 12

Name

1. Nada Sayed Abdel Ghaffar


2. Tasneem Abdel Hadi
Subject
Numerical Analysis

Faculty of Education

Major
‫رياضيات عام‬

Code of subject
MATB365
1) Use the Newton- Raphson to find a root of
the equation x =−cosx use an initial guess of x =¿
3
0

1
With ε =0.005 % ? s

Solution:
f ( x )=x 3 +cosx
2
f ( x ) =3 x −sinx

f (x) 3
x + cosx
x i+1=x i− → x i+1=x i− 2
f (x ) 3 x −sinx

N
0 1
1 27.260
1
2 18.174
1
3 12.119
1
4 8.0813
5 5.3752
6 3.5926
7 2.4314
8 1.6344
9 1.0212
10 0.3237
11 263.48
40
12 176.65
62
2) Use the Newton- Raphson to find a root of
the equation
x −x
f ( x )=e + 2 +2 cosx =6 use an initial guess of x 0=1 with ε s=0.005 % ?

Solution: -
f ( x )=e x + 2−x +2 cosx−6=0
x −x
f ( x ) =e −2 −2 sinx=0

f (x) x −x
e +2 + 2 cosx−6
x i+1=x i− → x i+1=x i− x −x
f (x ) e −2 −2 sinx

N
0 1
1 3.4698
2 2.7261
3 2.1973
4 1.9143
ε a=|1.82948−1.8294
1.82948 |× 100 %=0.004< ε =0.005 %
s

5 1.8341
6 1.8294
7 1.8294
8
3) Solving using Newton- Raphson method
to locate the root of f ( x )=sin √ x−x use an initial
guess of x =4 with ε =0.01 % ?
0 s

Solution: -
f ( x )=sin √ x−x

cos √ x
f (x )= −1
2 √x

f (x) sin √ x−x


x i+1=x i− → x i+1=x i−
f (x ) cos √ x
−1
2√x

N ε a= |0.76865−0.7687
0.76865 |× 100 %=0.006 % <ε =0.01 %
s

0 1
1 0.7828
2 0.7687
3 0.7687
4 0.7686
5
4) Use the fixed-point iteration method to
estimate one of the roots of x =2 x+3 with an 2

accuracy of ε =0.05 % at x=4 ? s

Solution: -
x=√ 2 x+3
1
φ ( x )= √ 2 x+ 3φ ( x )=
√ 2 x+3

|φ ( x )|=|√ |1
8+3
=0.3015< 1 success

N φ(x)

0 3.3166
1 3.1037
2 3.0344
3 3.0114
ε a= |3.0004−3.0013
3.0004 |× 100 %=0.02 %< ε =0.05 %
s

4 3.0038
5 3.0013
6 3.0004

: use Gauss- seidel method to solve the


Q1

following system:
[ ][ ] [ ]
2 4 10 −1 x 1 −11
10 −1 2 0 x2 = 6
0 −3 1 −8 x 3 −15
−1 12 −1 3 x 25
4

Assume zero initial guesses and take ε s=0.05 % ?

Solution: - the matrix in question is not diagonally


dominant
Then we make it diagonally dominant by
Re- order it

[ ][ ] [ ]
10 −1 2 0 x1 6
−1 12 −1 3 x 2 = 25
2 4 10 −1 x 3 −11
0 −3 1 −8 x −15
4

Then the matrix is diagonally dominant


1
10 x 1−x 2+2 x 3=6 →
10
[ 6+ x 2−2 x 3 ]
1
−x 1+ 12 x 2−x 3 +3 x 4=25 →
12
[ 25+ x1 + x 3−3 x 4 ]
1
2 x1 + 4 x 2+ 10 x 3−x 4 =−11→
10
[−11−2 x 1−4 x2 + x 4 ]
1
−3 x 2+ x 3−8 x 4=−15 →
−8
[−15+3 x 2−x 3 ]

N x 1 x2 x3 x4

0 0.6 2.133 - 0.815


3 2.0733 8
1 1.2271 1.808 - 0.948
9 1.9874 2
2 1.1784 1.778 - 0.963
9 1.9524 9
3 1.1684 1.777 - 0.965
0 1.9480 1
4 1.1673 1.777 - 0.965
1.9478 2
5 1.1672 1.776 - 0.965
6 1 1.9474 5
6 1.1670 1.776 - 0.965
9 1.9476 2

|1.1670−1.16726
ε a=
1.1670 |×100 %=0.02 %
ε =| |×100 %=0.04 %
1.7769−1.7761
a
1.7769

ε =| |× 100 %=0.01 %
−1.9476+1.9474
a
−1.9476

ε =| |×100 %=0.03 %
0.9652−0.9655
a
0.9652

: Use Gauss- seidel method to solve the


Q2

following system of equations:


50 x 1+2 x 2−31 x3 +6 x 4 =190
x 1−3 x 2+2 x 3−55 x 4=60

3 x 1+51 x 2+ 2 x 3 + x 4=80

2 x1 +24 x 2 +33 x 3+ 3 x 4=60

Assume zero initial guesses and take ε s=0.01 % ?

Solution: - this equation is not diagonally


dominant
Then we make it diagonally dominant by
Re- order these equations:
1
50 x 1+2 x 2−31 x3 +6 x 4 =19 0 →
50
[ 190−2 x 2 +31 x3 −6 x 4 ]

1
3 x 1+51 x 2+ 2 x 3 + x 4=8 0→
51
[ 80−3 x 1−2 x 3−x 4 ]
1
2 x1 +24 x 2 +33 x 3+ 3 x 4=6 0 →
33
[ 60−2 x 1−24 x 2−3 x 4 ]

1
x 1−3 x 2+2 x 3−55 x 4=6 0 →
55
[ 60−x 1+3 x 2−2 x 3 ]

x1 x2 x3 x4
N
0 3.8 1.3451 0.6096 -1.0730
1 4.2529 1.3156 1.5782 -1.0271
2 4.8491 1.2416 0.7147 -1.0445
3 4.3188 1.3070 0.7008 -1.0582
4 4.3092 1.3084 0.7017 -1.0584
5 4.3097 1.3083 0.7016 -1.05831
5 8
6 4.3097 1.3083 0.7016 -1.05840
0 5 7
7 4.3097 1.3083 0.7016 -
09 52 77 1.058391

|4.309709−4.30970
ε a=
4.309709 |×100 %=0.0002 %
ε =
a [ 1.308352−1.30835
1.308352 ] ×100 %=0.0001 %
ε =| |×100 %=0.0009 %
0.701677−0.70167
a
0.701677

ε =| |× 100 %=0.0008 %
−1.058391+1.05840
a
−1.058391

Solution for question 3: -


The matrix is diagonally dominant
Then;
1
4 T 11 −T 12−T 21=175 →
4
[ 175+T 12+ T 21 ]
1
−T 11 +4 T 12−T 22=125 →
4
[ 125+T 11 +T 22]
1
−T 11 +4 T 21−T 22=75 →
4
[ 75+T 11 +T 22]
1
−T 12−T 21 +4 T 22=25 →
4
[25+ T 12 +T 21 ]

N T 11 T 12 T 21 T 22

0 43.75 42.187 29.687 24.218


5 5 8
1 61.718 52.734 40.234 29.492
8 4 4 2
2 66.992 55.371 42.871 30.810
2 1 1 5
3 68.310 56.030 43.530 31.222
5 3 3 5
4 68.640 56.195 43.695 31.222
1 1 1 53
5 68.722 56.236 43.736 31.243
5 3 3 1
6 68.743 56.246 43.746 31.248
1 6 6 3
7 68.748 56.249 43.749 31.249
3 1 1 6
8 68.749 56.249 43.749 31.249
6 8 8 9
9 68.749 56.249 43.749 31.249
9 9 9 1

|68.7499−68.7496
ε a=
68.7499 |× 100 %=0.0004 %
ε =| |×100 %=0.0001 %
56.2499−56.2498
a
56.2499
|
ε a=
43.7499−43.7498
43.7499 |×100 %=0.0002 %

ε =
a [ 31.2491−31.2499
31.2491 ] ×100 %=0.002 %

Try solve
1) Solving using Newton- Raphson method to
locate the root of f ( x )=sin √ x−x use an initial
guess of x =0.5 withε =0.01 % ?
0 s

Solution : -
f ( x )=sin √ x−x

cos √ x
f (x )= −1
2 √x

f (x) sin √ x−x


x i+1=x i− → x i+1=x i−
f (x ) cos √ x
−1
2√x
N

0 0.5
ε a=|0.768949−0.76865
0.768949 |× 100 %=0.0001 %
1 0.8236

2 0.7697

3 0.76865

4 0.768949

2) Use Gauss- seidel method to solve the


following system of equations:
−3 x 1+ x 2 +12 x3 =50
6 x 1−x 2−x 3=3
6 x 1+ 9 x2 + x 3=40

Assume zero initial guesses and take ε s=0.5 % ?

Solution: - these equations aren’t diagonally


dominant
Then we make it diagonally dominant by
Re- order these equations:
1
6 x 1−x 2−x 3=3 →
6
[ 3+ x 2+ x 3 ]
1
6 x 1+ 9 x2 + x 3=40 →
9
[ 40−6 x 1−x 3 ]
1
−3 x 1+ x 2 +12 x3 =50→ [ 50+3 x 1−x 2 ]
12
x1 x2 x3
N
0 0.5 4.111 3.949
1 1
1 1.843 2.754 4.264
4 3 1
2 1.669 2.867 4.284 ε a=
[ 1.6905 ]
1.6905−1.6919
×100 %=0.08 %
7 1 1
3 1.691 2.857 4.287
9 1 1
4 1.690 2.857 4.287
5 1 1
|2.8571−2.8671
ε a=
2.8571 |×100 %=0.4 %
ε =| |×100 %=0.07 %
4.2871−4.2841
a
4.2871

You might also like