Download as pdf or txt
Download as pdf or txt
You are on page 1of 13

Program: BE(Mechanical)

Class: TE
Course: Numerical Methods and
Optimization
Unit: Roots of Equation
Lecture 01: Types of Root
Topics 02

Introduction Types of Bisection


Numerical on
Numerical Method
Bisection
Method
Method

Flowchart of Problem for Closing


Bisection Homework
Method

SCHOOL OF ENGINEERING AND TECHNOLOGY


Title of the page 03

1. Prakash Madhukar Sutar


2. Years of Experience -09
3. M.E (CAD Cam & Automation)

SCHOOL OF ENGINEERING AND TECHNOLOGY www.sandipuniversity.edu.in


Steps in Newton Raphson Method 04

SCHOOL OF ENGINEERING AND TECHNOLOGY


Steps in Newton Raphson Method 04

Let the tangent has coordinate (𝑥1 , 𝑦1 ) on the curve and (𝑥2 , 0) on
the point where it intersect x axis

dy 𝑦2 −𝑦1
1. Slope = = = y’
dx 𝑥2 −𝑥1

0−𝑦1
2. Slope = 𝑦1 ′= f’ (x1 ) = 𝑥 = y’
2 −𝑥1

3. (𝑥2 −𝑥1 ). f’ (x1 ) = (−𝑦1 )

−𝑦1 +𝑥1 .f’ (x1 )


4. 𝑥2 = f’ (x1 )

f(𝑥 )
5. 𝑥2 = 𝑥1 − f ’(x1 )
1

SCHOOL OF ENGINEERING AND TECHNOLOGY


Steps in Newton Raphson Method 05

1.Let the curve be y = f(x)

2.Choose initial guess x1 and x2 such that


f(x1 ) X f’’(x1 )
2 <1
f’(x1 )

3.Estimate the root of 𝑿𝟐 by


f(x1 )
𝐗𝟐 = 𝐗𝟏 −
f’(x1 )

SCHOOL OF ENGINEERING AND TECHNOLOGY


Concept of Divergence 06

SCHOOL OF ENGINEERING AND TECHNOLOGY


Newton Raphson Method 07

Example 5: Using Newton Raphson method and initial guess as zero ,find root of 𝑥 3 −5𝑥 + 3 = 0. Do 3 iterations only.

Solution : Therefore initial guess is correct


f(𝑥) = 𝑥 3 −5𝑥 + 3 4. Iteration 1 𝒙𝟏 = 0
f’(𝑥) = 3𝑥 2 −5 f(𝑥1) 𝟑
5. 𝑋2 = 𝑋1 − = 0 − −𝟓 =0.6
f’′(𝑥) = 6𝑥 f’(𝑥1)

Let initial guess 𝒙𝟏 = 0 replace 𝒙𝟏 by 𝒙𝟐 .

f(𝒙𝟏 ) = 03 −5 ∗ 0 + 3
f(𝒙𝟏 ) = 3 4. Iteration 2 𝒙𝟏 = 0.6

f’ (𝒙𝟏 ) = 3 ∗ 02 −5 f(𝒙𝟏 ) = 0.63 −5 ∗ 0.6 + 3 = 0.216

f’(𝒙𝟏 ) = −5 f’ (𝒙𝟏 ) = 3 ∗ 0.62 −5 = −3.92

f’′(𝒙𝟏 ) = 6 ∗ 𝑥 = 0 f(𝑥1) 𝟎.𝟐𝟏𝟔


𝑋2 = 𝑋1 − = 0.6 − = 0.6551
f’(𝑥1) −𝟑.𝟗𝟐

f(𝑥1 ) X f’’(𝑥1) 𝟑∗𝟎 replace 𝒙𝟏 by 𝒙𝟐


3. Check 2 1= = 0 <1
f’(𝑥1) −𝟓𝟐

SCHOOL OF ENGINEERING AND TECHNOLOGY


Newton Raphson Method 08

Example 5: Using Bisection method and initial guess as zero ,find root of 𝑥 3 −5𝑥 + 3 = 0. Do 3 iterations only.

Solution :
5. Iteration 3 𝒙𝟏 = 0.6551
f(𝒙𝟏 ) = 0.65513 −5 ∗ 0.6551 + 3 = 0.0056
f’ (𝒙𝟏 ) = 3 ∗ 0.62 −5 = −3.7125

f(𝑥1) 𝟎.𝟎𝟎𝟓𝟔
𝑋2 = 𝑋1 − = 0.6551 − = 0.6566
f’(𝑥1) −𝟑.𝟕𝟏𝟐𝟓

Iteration No. 𝒙𝟏 f(𝒙𝟏 ) f’ (𝒙𝟏 ) 𝒙𝟐

1. 0 3 -5 0.6

2. 0.6 0.216 -3.92 0.6551

3. 0.6551 0.0056 -3.7125 0.6566

SCHOOL OF ENGINEERING AND TECHNOLOGY


Newton Raphson Method 07

л
Example 6: Find the root of equation 𝑠𝑖𝑛𝑥 − 𝑥. 𝑐𝑜𝑠𝑥 using Newtons-Raphson method. Assume initial guess as 𝑥1 = 3 up
2
to accuracy of 0.00001
. • Check Accuracy: 𝒙𝟐 − 𝒙𝟏 < Accuracy
Solution :
f(𝑥) = 𝑠𝑖𝑛𝑥 − 𝑥. 𝑐𝑜𝑠𝑥 𝟒. 𝟓𝟎𝟎𝟎 − 𝟒. 𝟕𝟏𝟐𝟑 = 0.2124 > 0.00001

f’(𝑥) = 𝑐𝑜𝑠𝑥 − 𝑥 −𝑠𝑖𝑛𝑥 + 𝑐𝑜𝑠𝑥 = 𝑥. 𝑠𝑖𝑛𝑥


Iteration 1 4. Iteration 2 𝒙𝟏 = 4.5000
л f(𝒙𝟏 ) = sin(4.5000) − (4.5000)𝑐𝑜𝑠(4.5000)
Initial guess 𝒙𝟏 = 32 = 4.7123
f(𝒙𝟏 ) = −0.0289
f(𝒙𝟏 ) = sin(4.7123) − (4.7123). 𝑐𝑜𝑠(4.7123)
f’ (𝒙𝟏 ) = 𝑥. 𝑠𝑖𝑛𝑥
f(𝒙𝟏 ) = −0.9981
f’(𝒙𝟏 ) = (4.5000). 𝑠𝑖𝑛(4.5000) = −4.3988
f’ (𝒙𝟏 ) = 𝑥. 𝑠𝑖𝑛𝑥
f(𝑥 ) −𝟎.𝟗𝟗𝟖𝟏
f’(𝒙𝟏 ) = (4.7123). 𝑠𝑖𝑛(4.7123) = −4.7119 4. 𝑋2 = 𝑋1 − f’(𝑥1 ) = 4.5000 − −𝟒.𝟕𝟏𝟏𝟗
= 4.4934
1

f(𝑥1 ) −𝟎.𝟗𝟗𝟖𝟏 • Check Accuracy: 𝒙𝟐 − 𝒙𝟏 < Accuracy


𝑋2 = 𝑋1 − = 4.7123 − = 4.5000
f’(𝑥1) −𝟒.𝟕𝟏𝟏𝟗
𝟒. 𝟒𝟗𝟑𝟒 − 𝟒. 𝟓𝟎𝟎𝟎 = 0.0065 > 0.00001

SCHOOL OF ENGINEERING AND TECHNOLOGY


Newton Raphson Method 07

л
Example 6: Find the root of equation 𝑠𝑖𝑛𝑥 − 𝑥. 𝑐𝑜𝑠𝑥 using Newtons-Raphson method. Assume initial guess as 𝑥1 = 3 up
2
to accuracy of 0.00001
. Iteratio 𝒙𝟏 f(𝒙𝟏 ) f’ (𝒙𝟏 ) 𝒙𝟐 Accuracy
Solution :
n No.
f(𝑥) = 𝑠𝑖𝑛𝑥 − 𝑥. 𝑐𝑜𝑠𝑥
1. 4.7123 -0.9981 -4.7119 4.5000 0.2124
f’(𝑥) = 𝑐𝑜𝑠𝑥 − 𝑥 −𝑠𝑖𝑛𝑥 + 𝑐𝑜𝑠𝑥 = 𝑥. 𝑠𝑖𝑛𝑥
2. 4.5000 -0.0289 -4.3988 4.4934 0.0065
4. Iteration 3 𝒙𝟏 = 4.4934
3. 4.4934 0.000041 -4.3860 4.493409 0.000009
f(𝒙𝟏 ) = sin(4.4934) − (4.4934)𝑐𝑜𝑠(4.4934)
f(𝒙𝟏 ) = −0.000041
f’ (𝒙𝟏 ) = 𝑥. 𝑠𝑖𝑛𝑥
f’(𝒙𝟏 )= (4.4934). 𝑠𝑖𝑛(4.4934) = −4.3860

f(𝑥 ) −𝟎.𝟎𝟎𝟎𝟎𝟒𝟏
4. 𝑋2 = 𝑋1 − f’(𝑥1 ) = 4.4934 − −𝟒.𝟑𝟖𝟔𝟎
= 4.493409
1

• Check Accuracy: 𝒙𝟐 − 𝒙𝟏 < Accuracy


𝟒. 𝟒𝟗𝟑𝟒𝟎𝟗 − 𝟒. 𝟒𝟗𝟑𝟒 = 0.0065 < 0.000009

SCHOOL OF ENGINEERING AND TECHNOLOGY


Newton Raphson Method 07

Example 7: Find the root of equation 𝑥 3 − 𝑐𝑜𝑠 2 𝑥 using Newtons-Raphson method. up to accuracy of 0.02.Explain
Convergence criteria for this method.

Solution :
f(𝑥1 ) X f’’(𝑥1) −𝟎.𝟕𝟎𝟖𝟎∗𝟓.𝟏𝟔𝟕𝟕
f(𝑥) = 𝑥3 − 𝑐𝑜𝑠 2 𝑥 3. Check 2 1= = 0.2394 <1
f’(𝑥1) 𝟎.𝟑.𝟗𝟎𝟗𝟐𝟗𝟐
f’(𝑥) = 3𝑥 2 − 2. 𝑐𝑜𝑠𝑥 −𝑠𝑖𝑛𝑥 = 3𝑥 2 +𝑠𝑖𝑛2𝑥
4. Iteration 1 𝒙𝟏 = 1
f’′(𝑥) = 6𝑥 + 2. 𝑐𝑜𝑠2𝑥
f(𝒙𝟏 ) = 03 − 𝑐𝑜𝑠 2 0
Let initial guess 𝒙𝟏 = 1
f(𝒙𝟏 ) = 𝟎. 𝟕𝟎𝟖𝟎𝟕
f(𝒙𝟏 ) = 𝑥 3 − 𝑐𝑜𝑠 2 𝑥 = 13 − 𝑐𝑜𝑠 2 1 = 0 − 1
f’ (𝒙𝟏 ) = 3.02 + 𝑠𝑖𝑛2.0
f(𝒙𝟏 ) = 0.70807
f’(𝒙𝟏 ) = 3.90929
f’ (𝒙𝟏 ) = 3𝑥 2 + 𝑠𝑖𝑛2𝑥 = 3 ∗ 12 + sin 2 ∗ 1=0
f(𝑥 ) 𝟎.𝟕𝟎𝟖𝟎𝟕
f’(𝒙𝟏 ) =3.90929 4. 𝑋2 = 𝑋1 − f’(𝑥1 ) = 0 − 𝟑.𝟗𝟎𝟗𝟐𝟗
= 𝟎. 𝟖𝟏𝟖𝟖
1

f’′(𝒙𝟏 ) = 6𝑥 + 2. 𝑐𝑜𝑠2𝑥 = 6 ∗ 1 + 2. 𝑐𝑜𝑠2 ∗ 𝟏 =5.1677 5. replace 𝒙𝟏 by 𝒙𝟐


• Check Accuracy: 𝒙𝟐 − 𝒙𝟏 < Accuracy
𝟎. 𝟖𝟏𝟖𝟖 − 𝟏 =0.1812 > 0.02
SCHOOL OF ENGINEERING AND TECHNOLOGY
Newton Raphson Method 07

Example 7: Find the root of equation 𝑥 3 − 𝑐𝑜𝑠 2 𝑥 using Newtons-Raphson method. up to accuracy of 0.02.Explain
Convergence criteria for this method.

Solution : Iteratio 𝒙𝟏 f(𝒙𝟏 ) f’ (𝒙𝟏 ) 𝒙𝟐 Accuracy


n No.
4. Iteration 2 𝒙𝟏 = 0.8188
3. 0.7914 0.0016 2.8788 0.7908 0.0006
f(𝒙𝟏 ) = 0.81883 − 𝑐𝑜𝑠 2 0.8188
4.
f(𝒙𝟏 ) = 𝟎. 𝟎𝟖𝟐𝟑
5.
f’ (𝒙𝟏 ) = 3 ∗ 0.81882 + 𝑠𝑖𝑛2 ∗ 0.8188
f’(𝒙𝟏 ) = 3.009

f(𝑥 ) 𝟎.𝟎𝟖𝟐𝟑
4. 𝑋2 = 𝑋1 − f’(𝑥1 ) = 0.8188 − 𝟑.𝟎𝟎𝟗
= 0.7914
1

5. replace 𝒙𝟏 by 𝒙𝟐
• Check Accuracy: 𝒙𝟐 − 𝒙𝟏 < Accuracy
𝟎. 𝟕𝟗𝟏𝟒 − 𝟎. 𝟖𝟏𝟐𝟐 =0.0273 > 0.02

SCHOOL OF ENGINEERING AND TECHNOLOGY

You might also like