numerical methods solution of equation. root finding methods 1.bisection method 2.fixed point method...
TRANSCRIPT
![Page 1: Numerical Methods SOLUTION OF EQUATION. Root Finding Methods 1.Bisection Method 2.Fixed Point Method 3.Secant Method 4.Modified Secant 5.Successive approximation](https://reader034.vdocuments.us/reader034/viewer/2022050809/5697bfb91a28abf838c9f987/html5/thumbnails/1.jpg)
Numerical Methods
SOLUTION OF EQUATION
![Page 2: Numerical Methods SOLUTION OF EQUATION. Root Finding Methods 1.Bisection Method 2.Fixed Point Method 3.Secant Method 4.Modified Secant 5.Successive approximation](https://reader034.vdocuments.us/reader034/viewer/2022050809/5697bfb91a28abf838c9f987/html5/thumbnails/2.jpg)
Root Finding Methods
1. Bisection Method
2. Fixed Point Method
3. Secant Method
4. Modified Secant
5. Successive approximation
6. Newton Raphson method
7. Berge Vieta
![Page 3: Numerical Methods SOLUTION OF EQUATION. Root Finding Methods 1.Bisection Method 2.Fixed Point Method 3.Secant Method 4.Modified Secant 5.Successive approximation](https://reader034.vdocuments.us/reader034/viewer/2022050809/5697bfb91a28abf838c9f987/html5/thumbnails/3.jpg)
Motivation Many problems can be re-written into a form such as:◦ f(x,y,z,…) = 0◦ f(x,y,z,…) = g(s,q,…)
![Page 4: Numerical Methods SOLUTION OF EQUATION. Root Finding Methods 1.Bisection Method 2.Fixed Point Method 3.Secant Method 4.Modified Secant 5.Successive approximation](https://reader034.vdocuments.us/reader034/viewer/2022050809/5697bfb91a28abf838c9f987/html5/thumbnails/4.jpg)
Motivation
A root, r, of function f occurs when f(r) = 0. For example:
◦ f(x) = x2 – 2x – 3has two roots at r = -1 and r = 3.
◦ f(-1) = 1 + 2 – 3 = 0◦ f(3) = 9 – 6 – 3 = 0
◦We can also look at f in its factored form.f(x) = x2 – 2x – 3 = (x + 1)(x – 3)
![Page 5: Numerical Methods SOLUTION OF EQUATION. Root Finding Methods 1.Bisection Method 2.Fixed Point Method 3.Secant Method 4.Modified Secant 5.Successive approximation](https://reader034.vdocuments.us/reader034/viewer/2022050809/5697bfb91a28abf838c9f987/html5/thumbnails/5.jpg)
Finding roots / solving equations
General solution exists for equations such asax2 + bx + c = 0
The quadratic formula provides a quick answer to all quadratic equations. However, no exact general solution (formula) exists for equations with exponents greater than 4.Transcendental equations: involving geometric functions (sin, cos), log, exp. These equations cannot be reduced to solution of a polynomial.
![Page 6: Numerical Methods SOLUTION OF EQUATION. Root Finding Methods 1.Bisection Method 2.Fixed Point Method 3.Secant Method 4.Modified Secant 5.Successive approximation](https://reader034.vdocuments.us/reader034/viewer/2022050809/5697bfb91a28abf838c9f987/html5/thumbnails/6.jpg)
Examples
![Page 7: Numerical Methods SOLUTION OF EQUATION. Root Finding Methods 1.Bisection Method 2.Fixed Point Method 3.Secant Method 4.Modified Secant 5.Successive approximation](https://reader034.vdocuments.us/reader034/viewer/2022050809/5697bfb91a28abf838c9f987/html5/thumbnails/7.jpg)
Problem-dependent decisions
Approximation: since we cannot have exactness, we specify our tolerance to error
Convergence: we also specify how long we are willing to wait for a solution
Method: we choose a method easy to implement and yet powerful enough and general
Put a human in the loop: since no general procedure can find roots of complex equations, we let a human specify a neighbourhood of a solution
![Page 8: Numerical Methods SOLUTION OF EQUATION. Root Finding Methods 1.Bisection Method 2.Fixed Point Method 3.Secant Method 4.Modified Secant 5.Successive approximation](https://reader034.vdocuments.us/reader034/viewer/2022050809/5697bfb91a28abf838c9f987/html5/thumbnails/8.jpg)
Bisection Method
Based on the fact that the function will change signs as it passes thru the root.Suppose we know a function has a root between a and b. (…and the function is continuous, … and there is only one root)
f(a)*f(b) < 0
Once we have a root bracketed, we simply evaluate the mid-point and halve the interval.
![Page 9: Numerical Methods SOLUTION OF EQUATION. Root Finding Methods 1.Bisection Method 2.Fixed Point Method 3.Secant Method 4.Modified Secant 5.Successive approximation](https://reader034.vdocuments.us/reader034/viewer/2022050809/5697bfb91a28abf838c9f987/html5/thumbnails/9.jpg)
Bisection Method f(a) . F(b) < 0
c=(a+b)/2
a bc
f(a)>0
f(b)<0
f(c)>0
![Page 10: Numerical Methods SOLUTION OF EQUATION. Root Finding Methods 1.Bisection Method 2.Fixed Point Method 3.Secant Method 4.Modified Secant 5.Successive approximation](https://reader034.vdocuments.us/reader034/viewer/2022050809/5697bfb91a28abf838c9f987/html5/thumbnails/10.jpg)
Bisection Method Guaranteed to converge to a root if one exists within the bracket.
c ba
a = cf(a)>0
f(b)<0f(c)<0
![Page 11: Numerical Methods SOLUTION OF EQUATION. Root Finding Methods 1.Bisection Method 2.Fixed Point Method 3.Secant Method 4.Modified Secant 5.Successive approximation](https://reader034.vdocuments.us/reader034/viewer/2022050809/5697bfb91a28abf838c9f987/html5/thumbnails/11.jpg)
Bisection method…
Check if solution lies between a and b… F(a)*F(b) < 0 ?
Try the midpoint m: compute F(m)
If |F(m)| < ϵ select m as your approximate solution
Otherwise, if F(m) is of opposite sign to F(a) that is ifF(a)*F(m) < 0, then b = m.
Else a = m.
![Page 12: Numerical Methods SOLUTION OF EQUATION. Root Finding Methods 1.Bisection Method 2.Fixed Point Method 3.Secant Method 4.Modified Secant 5.Successive approximation](https://reader034.vdocuments.us/reader034/viewer/2022050809/5697bfb91a28abf838c9f987/html5/thumbnails/12.jpg)
Stop Conditions 1. number of iterations 2. |f(x0)| ≤ ϵ 3. | x- x0| ≤ ϵ
![Page 13: Numerical Methods SOLUTION OF EQUATION. Root Finding Methods 1.Bisection Method 2.Fixed Point Method 3.Secant Method 4.Modified Secant 5.Successive approximation](https://reader034.vdocuments.us/reader034/viewer/2022050809/5697bfb91a28abf838c9f987/html5/thumbnails/13.jpg)
Bisection Method Simple algorithm:
Given: a and b, such that f(a)*f(b)<0Given: error tolerance, err
c=(a+b)/2.0; // Find the midpointWhile( |f(c)| > err ) {if( f(a)*f(c) < 0 ) // root in the left half
b = c;else // root in the right half
a = c;c=(a+b)/2.0; // Find the new midpoint
}return c;
![Page 14: Numerical Methods SOLUTION OF EQUATION. Root Finding Methods 1.Bisection Method 2.Fixed Point Method 3.Secant Method 4.Modified Secant 5.Successive approximation](https://reader034.vdocuments.us/reader034/viewer/2022050809/5697bfb91a28abf838c9f987/html5/thumbnails/14.jpg)
Square root program The (positive) square root function is continuous and has a single solution.
c = x2
F(x) = x2 - c
Example:F(x) = x2 - 4
-6
-4
-2
0
2
4
6
0 0.5 1 1.5 2 2.5 3
![Page 15: Numerical Methods SOLUTION OF EQUATION. Root Finding Methods 1.Bisection Method 2.Fixed Point Method 3.Secant Method 4.Modified Secant 5.Successive approximation](https://reader034.vdocuments.us/reader034/viewer/2022050809/5697bfb91a28abf838c9f987/html5/thumbnails/15.jpg)
Example: bisection iteration
![Page 16: Numerical Methods SOLUTION OF EQUATION. Root Finding Methods 1.Bisection Method 2.Fixed Point Method 3.Secant Method 4.Modified Secant 5.Successive approximation](https://reader034.vdocuments.us/reader034/viewer/2022050809/5697bfb91a28abf838c9f987/html5/thumbnails/16.jpg)
16
Remarks Convergence
◦ Guaranteed once a nontrivial interval is found
Convergence Rate◦ A quantitative measure of how fast the algorithm
is◦ An important characteristics for comparing
algorithms
![Page 17: Numerical Methods SOLUTION OF EQUATION. Root Finding Methods 1.Bisection Method 2.Fixed Point Method 3.Secant Method 4.Modified Secant 5.Successive approximation](https://reader034.vdocuments.us/reader034/viewer/2022050809/5697bfb91a28abf838c9f987/html5/thumbnails/17.jpg)
1. we could compute exactly how many iterations we would need for a given amount of error.
2. The error is usually measured by looking at the width of the current interval you are considering (i.e. the distance between a and b). The width of the interval at each iteration can be found by dividing the width of the starting interval by 2 for each iteration. This is because each iteration cuts the interval in half. If we let the error we want to achieve ϵ and n be the iterations we get the following:
abn
abab
ab
ab
ab
ab
abab
n
n
n
n
n
nn
nnnn
2
2
00
22
11
log
2
21
2
)(2
1
)(21(
2
1
)(2
1
![Page 18: Numerical Methods SOLUTION OF EQUATION. Root Finding Methods 1.Bisection Method 2.Fixed Point Method 3.Secant Method 4.Modified Secant 5.Successive approximation](https://reader034.vdocuments.us/reader034/viewer/2022050809/5697bfb91a28abf838c9f987/html5/thumbnails/18.jpg)
18
Convergence Rate of Bisection
Let: ◦ Length of initial interval L0
◦ After k iterations, length of interval is Lk
◦ Lk=L0/2k
◦ Algorithm stops when Lk ϵ
Plug in some values…
93.1910
1log
10
1Let
62
6
k
L
This is quite slow, compared to the other methods…
Meaning of eps
![Page 19: Numerical Methods SOLUTION OF EQUATION. Root Finding Methods 1.Bisection Method 2.Fixed Point Method 3.Secant Method 4.Modified Secant 5.Successive approximation](https://reader034.vdocuments.us/reader034/viewer/2022050809/5697bfb91a28abf838c9f987/html5/thumbnails/19.jpg)
How to get initial (nontrivial) interval [a,b] ?
Hint from the physical problem For polynomial equation, the following theorem is applicable:
roots (real and complex) of the polynomialf(x) = anxn + an-1xn-1 +…+ a1x + aο
satisfy the bound:
) , , , (1
1 10 nn
aaaMaxa
x ) , , , (1
1 10 nn
aaaMaxa
x
![Page 20: Numerical Methods SOLUTION OF EQUATION. Root Finding Methods 1.Bisection Method 2.Fixed Point Method 3.Secant Method 4.Modified Secant 5.Successive approximation](https://reader034.vdocuments.us/reader034/viewer/2022050809/5697bfb91a28abf838c9f987/html5/thumbnails/20.jpg)
20
Example Roots are bounded by
Hence, real roots are in [-10,10]
Roots are
–1.5251,
2.2626 ± 0.8844i
093 23 xxx109) 1, 3, ,1( max
1
11 x
complex
![Page 21: Numerical Methods SOLUTION OF EQUATION. Root Finding Methods 1.Bisection Method 2.Fixed Point Method 3.Secant Method 4.Modified Secant 5.Successive approximation](https://reader034.vdocuments.us/reader034/viewer/2022050809/5697bfb91a28abf838c9f987/html5/thumbnails/21.jpg)
Problem with Bisection
•Although it is guaranteed to converge under its assumptions,•Although we can predict in advance the number of iterations required for desired accuracy (b - a)/2n <n > log((b - a ) / )•Too slow! Computer Graphics uses square roots to compute distances, can’t spend 15-30 iterations on every one!•We want more like 1 or 2, equivalent to ordinary math operation.
![Page 22: Numerical Methods SOLUTION OF EQUATION. Root Finding Methods 1.Bisection Method 2.Fixed Point Method 3.Secant Method 4.Modified Secant 5.Successive approximation](https://reader034.vdocuments.us/reader034/viewer/2022050809/5697bfb91a28abf838c9f987/html5/thumbnails/22.jpg)
Examples1. Locate the first nontrivial root of sin x = x3 using
Bisection method with the initial interval from 0.5 to 1. perform computation until error 2%
2. Determine the real root of f(x)= 5x3-5x2+6x-2 using bisection method. Employ initial guesses of xl = 0 and xu = 1. iterate until the estimated error a falls below a level of s = 15%
![Page 23: Numerical Methods SOLUTION OF EQUATION. Root Finding Methods 1.Bisection Method 2.Fixed Point Method 3.Secant Method 4.Modified Secant 5.Successive approximation](https://reader034.vdocuments.us/reader034/viewer/2022050809/5697bfb91a28abf838c9f987/html5/thumbnails/23.jpg)
Homework