70 likes | 93 Views
Learn how to solve equations using the bisection method, Newton-Raphson method, and Secant method, along with checking the accuracy of the roots found.
E N D
Chapter five Example:use bisection method to solve:f(c) =667.38/C (1-e^ -0.146843c) -40solution: guess 2 values of c where f(c1) > 0 and f(c2) <0 let c1=12 and c2=16 (12+16)/2 =14initial estimate (Xr)=(12+16)/2 = 14Ɛt=5.3%True root of the =14.7802f(12) f(14) =6.067 (1.569)=4.517>0 no sign change occurs roots must be between 14 and 16 make 14 new lower bound Xr= 14+16/ 2 = 15 Ɛt= 1.5 % again f(14)f(15)=1.569(-0.425)= -0.666 root between
Make is upper bound (new iteration)Xr= 14+15/2 =14.5Ɛt=1.9 % (more % relative error , but the interval of root is halved) • *how to check if the root found is correct?By substituting the root estimate into the original equation and determining whether the result is close to zero. That should be incorporated into the computer program.
Chapter sixopen methods (not bracketing) • Simple fixed point iteration: • It employs a formula to predict the root the equation is rearranged so that x is on the left side of the equ. X=g(x) Xi+1 =g(Xi)for example x² -2x + 3=0 x=x²+3/2sin x = 0 x= sin x + x (add x) • approximate error Ɛ= | Xi+1 – Xi / Xi+1 | 100% we need initial guess for X
Newton-raphson method • f ` (xi) =ΔY/ ΔX =f(xi)-0/ xi-xi+1 (xi - xi+1) f ` (xi)= f(xi) • xi – xi+1 = f(xi)/ f ` (xi) xi+1 = xi – f(xi)/ f ` (xi) Newton-Raphson Formula
Secant method formula • It is similar to newton-raphson technique.however,uses a difference rather than a derivative to estimate slope: • Xi+1 = Xi – f(xi)(xi-1 - xi)/ f(xi-1) – f(xi)we need two initial estimate of x.