Assignment4 Numerical
Assignment4 Numerical
Newton Raphson
xi+1 = xi - f ( xi)
f (x i)
Question 1:
𝜀s = 0.005%
f(x)=x3 + cos(x) ==>f `(x)=3x2-sin(x)
X0=1
1-st iteration==>
f(x0) =1.54 f`(x0)=2.15853
=>x1= 0.28655
2-nd iteration==>
f(x1) =0.98275 f`(x1)=-0.0363
=>x2=27.36
3-rd iteration==>
f(x2) =20480.254 f`(x2)=2244.9166
=>x3=18.277
4-th iteration==>
f(x3) =6106.25 f`(x3)=1002.687
=>x4=12.187
5-th iteration==>
f(x4) =1811 f`(x4)=445.939
=>x5=8.1259
6-th iteration==>
f(x5) =536.2866 f`(x5)=197.12745
=>x6=5.4054
7-th iteration==>
f(x6) =158.5757 f`(x6)=88.42437
=>x7=3.61205
8-th iteration==>
f(x7) =46.2347 f`(x7)=39.6
=>x8=2.4445707
9-th iteration==>
f(x8) =13.8418 f`(x8)=17.2858
=>x9=1.68381
10-th iteration==>
f(x9) =4.6612 f`(x9)=7.512
=>x10=0.0722078
Question 2:
X0=1 es=0.0005
1-st iteration==>
f(x0) =-1.70111 f`(x0)=0.6887
=>x1= 3.47
2-nd iteration==>
f(x1) =24.33387 f`(x1)=32.71926
=>x2=2.72628
3-rd iteration==>
f(x2) =7.597 f`(x2)=14.36
=>x3=2.197
4-th iteration==> x4=1.9143
5-th iteration==> x5=1.8349
6-th iteration==>x6=1.82929
7-th iteration==>x7=1.8293
At final ea < es then x=1.8293
Question 3:
1
f(x)=sin(√ x ¿-x X0 =1 f `(x) = 2 √ x co s (√ x )-1
1-st iteration==> x1 = 0.7828
2-nd iteration==> x2 = 0.7687
3-rd iteration==> x3 = 0.76864
Then the root is x3
Question 4:
==>g`(x)= x <1
3 −3
Take x2 =2x+3==>g(x)=2+ x 2
X0=4
X1 =2.75 ==>X2 =3.0909 ==>
X3 =2.9705==>X4 =3.01==>X5 =2.996
==>X6 =3.001335==>X7 =2.99955
==>X8 =3.00015
ea= X 8 <0.05%
X 8−X 7
Then the root of the equation is
3.00015
Gauss-siedle
Question 1:
[ ][ ] [ ]
10− 12 0 x1 6
−1 12− 13 x 2 = 25
2 4 10− 1 x3 −11
𝜀𝑠 = 0.05%
0 − 31 − 8 x4 −15
X0=(0,0,0,0)
1-st iteration
Then X1 =0.6
We ‘ll substitude X1 to get X2
X2 =2.1333 X3=-2.07332
X4 =0.8158475
2-nd iteration
Then X1 =0.398666
X2 =2.09 X3=-1.934
X4 =0.8495
3-rd iteration
Then X1 =1.1958
X2 =1.80944 X3=-1.978
X4 =0.94921
4-th iteration
Then X1 =1.176544
X2 =1.77924 X3=-1.9520838
X4 =0.9637745
5-th iteration
Then X1 =1.16834
X2 =1.777077 X3=-1.94812
X4 =0.96508
Question 2:
The matrix should be diagonally
dominant so we’ll convert it to ==>
[ ][ ] [ ]
50 22 0 x1 190
3 51 21 x 2 = 80
224 333 x3 60
𝜀𝑠 = 0.01%
1− 32 −55 x4 60
X0=(0,0,0,0)
1-st iteration
Then X1 =3.8
X2 =1.3451 X3=1.215685
X4 =-1.051
Question 3:
es < 0.5%
[ ][ ] [ ]
4 − 1− 10 T 11 175
−1 4 0 − 1 T 1 2 = 125
−1 0 4 − 1 T 21 75
0 −1 −1 4 T 22 25
1-st iteration
Then T11 =43.75
T12 =42.1875 T21=29.6875
T22 =24.61