Professional Documents
Culture Documents
CPNM Lecture 12 Solutions To Non Linear Equations
CPNM Lecture 12 Solutions To Non Linear Equations
Jadavpur University
2023
Mridul Sankar Barik (Jadavpur University) CPNM Lecture 12 - Solutions to Non-Linear Equations 2023 1 / 18
Nonlinear Systems
Mridul Sankar Barik (Jadavpur University) CPNM Lecture 12 - Solutions to Non-Linear Equations 2023 2 / 18
Outline
Mridul Sankar Barik (Jadavpur University) CPNM Lecture 12 - Solutions to Non-Linear Equations 2023 3 / 18
Differentiability and Continuity
Mridul Sankar Barik (Jadavpur University) CPNM Lecture 12 - Solutions to Non-Linear Equations 2023 4 / 18
Bracketing vs. Open Methods
Bracketing methods
Requires two initial guesses of
the root, that must bracket or
be on either side of the root
Open methods
Start with either a single value
or two values that do not
necessarily bracket the root
When converging, they do so
more quickly than bracketing
methods Figure 1: (a) Bracketing, (b) Open
Diverging, (c) Open Converging
Mridul Sankar Barik (Jadavpur University) CPNM Lecture 12 - Solutions to Non-Linear Equations 2023 5 / 18
Number of Roots
The key idea in approximating the isolated real roots consists of two
steps:
1 Initial guess: Establishing the smallest possible intervals [a, b]
containing one and only one root. Take one point x0 ∈ [a, b] as an
approximation to the root.
2 Improving the value of the root: If this initial guess x0 is not in
desired accuracy, then devise a method to improve the accuracy.
This process of improving the value of the root is called the iterative
process and such methods are called iterative methods
Mridul Sankar Barik (Jadavpur University) CPNM Lecture 12 - Solutions to Non-Linear Equations 2023 7 / 18
Bisection Method
Mridul Sankar Barik (Jadavpur University) CPNM Lecture 12 - Solutions to Non-Linear Equations 2023 8 / 18
Bisection Method - Algorithm
1: Read x0 , x1 , e, n
2: y0 = f (x0 )
3: y1 = f (x1 )
4: for i = 1 to n in steps of 1 do
5: x2 = (x0 + x1 )/2
6: y2 = f (x2 )
7: if | y2 |≤ e then
8: Write “Convergent solution”, x2 , y2
9: Stop
10: end if
11: if (y0 ∗ y2 ) > 0 then
12: x0 = x2
13: y0 = y2
14: else
15: x1 = x2
16: y1 = y2
17: end if
18: end for
19: Write “Solution does not converge in n iterations”
20: Write x2 , y2
Mridul Sankar Barik (Jadavpur University) CPNM Lecture 12 - Solutions to Non-Linear Equations 2023 9 / 18
Bisection Method
Mridul Sankar Barik (Jadavpur University) CPNM Lecture 12 - Solutions to Non-Linear Equations 2023 10 / 18
False Position Method I
Replace the curve between [x0 , f (x0 )] and [x1 , f (x1 )] by the chord
joining the two points;
Take the point of intersection of the chord with x-axis as an
approximation of the root
x0 f (x1 ) − x1 f (x0 )
x=
f (x1 ) − f (x0 )
Mridul Sankar Barik (Jadavpur University) CPNM Lecture 12 - Solutions to Non-Linear Equations 2023 11 / 18
False Position Method II
Mridul Sankar Barik (Jadavpur University) CPNM Lecture 12 - Solutions to Non-Linear Equations 2023 12 / 18
False Position Method - Algorithm
1: Read x0 , x1 , e, n
2: y0 = f (x0 )
3: y1 = f (x1 )
4: for i = 1 to n in steps of 1 do
5: x2 = (x0 ∗ y1 − x1 ∗ y0 )/(y1 − y0 )
6: y2 = f (x2 )
7: if | y2 |≤ e then
8: Write “Convergent solution”, x2 , y2
9: Stop
10: end if
11: if y0 ∗ y2 < 0 then
12: x1 = x2
13: y1 = y2
14: else
15: x0 = x2
16: y0 = y2
17: end if
18: end for
19: Write “Solution does not converge in n iterations”
20: Write x2 , y2
Mridul Sankar Barik (Jadavpur University) CPNM Lecture 12 - Solutions to Non-Linear Equations 2023 13 / 18
Newton-Raphson Method I
Let’s call the point where the tangent at x0 crosses the x-axis (x1 , 0)
Plug this point into the tangent line and solve for x1 as follows,
We can find the new approximation provided the derivative isn’t zero
at the original approximation
If xn is an approximation a solution of f (x) = 0 and if f ′ (x) ̸= 0 the
next approximation is given by,
f (xn )
xn+1 = xn −
f ′ (xn )
We repeat the whole process to find an even better approximation
Mridul Sankar Barik (Jadavpur University) CPNM Lecture 12 - Solutions to Non-Linear Equations 2023 15 / 18
Newton-Raphson Method III
Mridul Sankar Barik (Jadavpur University) CPNM Lecture 12 - Solutions to Non-Linear Equations 2023 16 / 18
Newton Raphson Method - Algorithm
Mridul Sankar Barik (Jadavpur University) CPNM Lecture 12 - Solutions to Non-Linear Equations 2023 17 / 18
Examples of Poor Convergence of Newton Raphson
Method
Mridul Sankar Barik (Jadavpur University) CPNM Lecture 12 - Solutions to Non-Linear Equations 2023 18 / 18