0% found this document useful (0 votes)
34 views4 pages

MTH603 Assignment 1 by KK

This document contains the solutions to two questions for MTH603 Assignment 1. Question 1 asks to use the Newton Raphson method to find the root of the function f(x)=x^3 - 2x + 2, starting from x0 = 0.2, performing 3 iterations. The solution shows the calculations for each iteration, arriving at a root of approximately 1.6789. Question 2 asks to solve a system of 3 equations with 3 unknowns (x, y, z) using the Jacobi iterative method, starting from (0,0,0) and performing 2 iterations. The solution sets up the coefficient matrix and constant vector, then shows the calculations for the first two iterations,

Uploaded by

KHAWAR KHAN
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)
34 views4 pages

MTH603 Assignment 1 by KK

This document contains the solutions to two questions for MTH603 Assignment 1. Question 1 asks to use the Newton Raphson method to find the root of the function f(x)=x^3 - 2x + 2, starting from x0 = 0.2, performing 3 iterations. The solution shows the calculations for each iteration, arriving at a root of approximately 1.6789. Question 2 asks to solve a system of 3 equations with 3 unknowns (x, y, z) using the Jacobi iterative method, starting from (0,0,0) and performing 2 iterations. The solution sets up the coefficient matrix and constant vector, then shows the calculations for the first two iterations,

Uploaded by

KHAWAR KHAN
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/ 4

MTH603 Assignment 1 Fall 2023

Student ID: BC20020317


Section In charge Zulfiqar Ahmad Noor

Question 1 10 Marks
Use Newton Raphson method to find the root of f ( x )=x −2 x +2
3

with x 0=0.2 (Perform only three iterations)

Solution:1
Derivative: f ¿ ( x )=3 x 2−2

Starting point: x o=0.2

Iteration:1
f ( x0)
x 1=x o−
f ¿ ( x0)

( 0.2 )3−2 ( 0.2 )+2


x 1=0.2− 2
3 ( 0.2 ) −2

0.008−0.4+ 2
x 1=0.2−
0.12−2

1.592
x 1=0.2−
−1.88
x 1 ≈ 0.9851
Iteration 2:
f ( x1)
x 2=x 1−
f ¿ ( x1)

( 0.9851 )3 −2 ( 0.9851 )+2


x 2=0.9851− 2
3 ( 0.9851 ) −2

0.9154
x 2=0.9851−
−1.7393
x 2 ≈ 1.5312

Iteration:3
f ( x2)
x 3=x 2−
f ¿ ( x2)

( 1.5312 )3−2 ( 1.5312 ) +2


x 3=1.5312− 2
3 ( 1.5312 ) −2

x 3 ≈ 1.6789

So the root of the function is

3
f ( x )=x −2 x +2 ≈ 1.6789

Question.2

Solve the system of equation by Jacobi method starting with (0,0,0)


10 x+ y+ z=24

−x +20 y + z=21

−x−2 y=100 z=300


Performing only two iteration

Solution:2
10 x+ y+ z=24 ≫ ≫ x 1=1/10(24− y −z)

−x +20 y + z=21 ≫≫ x 2=20 y+ z −21

−x−2 y=100 z=300 ≫ ≫ x 3=2 y +100 z−300

The coefficient matrix A, constant vector b, and initial guess x 0 are .

[ ] [ ] []
10 1 1 24 0
0
−1 20 1 , b= 21 ,∧x = 0
−1 −2 100 300 0

Now, lets perform two iteration of the Jacobi method.

Iteration.1
1 1
x 1= ( 24−( 1.0+1.0 ) )=2.4
10

1 1
x 2= ( 21−(−1.0+1.0 ) ) =1.05
20

1 1
x 3= ( 300−(−1.0+2.0 )) =3
100

So, after the first iteration vector is x 1=[ 2.4 , 1.05 , 3 ]

Iteration.2
2 1
x 1= ( 24−( 1 ∙2. 4+1 ∙1.05 )) ≈ 1.69
10

2 1
x 2= ( 21−(−1∙ 2 . 4+1 ∙ 3 ) ) ≈1. 2
20

2 1
x 3= ( 300−(−1 ∙1.05+2 ∙ 3 ) ) ≈ 2.98
100
So, after the first iteration vector is x 2 ≈ [ 1.69 , 1.2, 2.98 ]

You might also like