1 / 16

Root-Finding Algorithm

Root-Finding Algorithm. Bisection method Suppose we want to solve the equation f(x) = 0.

Télécharger la présentation

Root-Finding Algorithm

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Root-Finding Algorithm Bisection method Suppose we want to solve the equation f(x) = 0. Given two points a and b such that f(a) and f(b) have opposite signs, we know by the intermediate value theorem that f must have at least one root in the interval [a, b] as long as f is continuous

  2. Root-Finding Algorithm The bisection method divides the interval in two by computing c = (a+b) / 2. There are now two possibilities: either f(a) and f(c) have opposite signs, or f(c) and f(b) have opposite signs. The bisection algorithm is then applied to the sub-interval where the sign change occurs, meaning that the bisection algorithm is inherently recursive.

  3. Root-Finding Algorithm The bisection method is less efficient than Newton's method but it is much less prone to odd behavior.

  4. Root-Finding Algorithm 'Bisection Method ‘ Start loop Do While (abs(xR - xL)) > epsilon xM = (xR + xL) / 2 'Calculate midpoint of domain 'Find f(xM) If ((f(xL) * f(xM)) > 0) Then 'Throw away left half xL = xM Else 'Throw away right half xR = xM End If Loop

  5. Root-Finding Algorithm 假設函數 f 在 [a,b] 之間連續,且 f(a) 與 f(b) 異號時,二分法可依指定的精確度求 f(x) = 0 的一個近似解。

  6. Root-Finding Algorithm 由於 (a+b)/2 有可能造成所得結果落在 [a,b] 區間外(見以下範例),故應採用a + (b-a)/2 較佳。 以 3-digit chopping 為例: a = 0.982 b = 0.987 (a+b)/2 = (0.982+0.987) / 2          = 1.96 / 2          = 0.980 a+(b-a)/2 = 0.982 + 0.00500/2          = 0.982 + 0.00250          = 0.984

  7. Root-Finding Algorithm Newton's method Suppose f : [a, b] → R is a differentiable function defined on the interval [a, b] with values in the real numbers R.

  8. Root-Finding Algorithm

  9. Root-Finding Algorithm Secant method The secant method is defined by the recurrence relation As can be seen from the recurrence relation, the secant method requires two initial values, x0 and x1, which should ideally be chosen to lie close to the root.

  10. Root-Finding Algorithm

  11. Root-Finding Algorithm The secant method does not require that the root remain bracketed like the bisection method does, and hence it does not always converge. The false position method uses the same formula as the secant method. However, it does not apply the formula on xn−1 and xn, like the secant method, but on xn and on the last iterate xk such that f(xk) and f(xn) have a different sign. This means that the false position method always converges.

  12. Root-Finding Algorithm False position method Like the bisection method, the false position method starts two points a0 and b0 such that f(a0) and f(b0) are of opposite signs, which implies by the intermediate value theorem that the function f has a root in the interval [a0, b0]. The method proceeds by producing a sequence of shrinking intervals [ak, bk] that all contain a root of f.

  13. Root-Finding Algorithm At iteration number k, the number is computed. As explained below, ck is the root of the secant line through (ak, f(ak)) and (bk, f(bk)).

  14. Root-Finding Algorithm If f(ak) and f(ck) have the same sign, then we set ak+1 = ck and bk+1 = bk, otherwise we set ak+1 = ak and bk+1 = ck. This process is repeated until the root is approximated sufficiently well.

  15. Root-Finding Algorithm

  16. Root-Finding Algorithm

More Related