Section 2 Solutions of Equations in One Variable (Root-Finding) - - PowerPoint PPT Presentation

section 2 solutions of equations in one variable root
SMART_READER_LITE
LIVE PREVIEW

Section 2 Solutions of Equations in One Variable (Root-Finding) - - PowerPoint PPT Presentation

Section 2 Solutions of Equations in One Variable (Root-Finding) Numerical Analysis I Xiaojing Ye, Math & Stat, Georgia State University 21 Root-finding Definition Let f : R R (univariate), then x is called a root , or zero , of f


slide-1
SLIDE 1

Section 2 Solutions of Equations in One Variable (Root-Finding)

Numerical Analysis I – Xiaojing Ye, Math & Stat, Georgia State University 21

slide-2
SLIDE 2

Root-finding

Definition

Let f : R → R (univariate), then x is called a root, or zero, of f if f (x) = 0.

Example (Roots of a function)

Find the root(s) of f (x) defined by (a) (x − 1)(x + 1); (b) (x − 1)2; (c) x2 + 1; (d) ax2 + bx + c; (e) cos(x). Question: Given a general function f , how can we find its root/roots?

Numerical Analysis I – Xiaojing Ye, Math & Stat, Georgia State University 22

slide-3
SLIDE 3

Bisection method

Suppose f is continuous on [a, b], and f (a)f (b) < 0 (WLOG f (a) < 0, f (b) > 0). Then f has at least one root in (a, b) by IVT.

x y f(a) f(p2) f(p1) f(b) y f(x) a a1 b b1 p p1 p2 p3 a1 b1 p1 p2 a2 b2 p3 a3 b3

Numerical Analysis I – Xiaojing Ye, Math & Stat, Georgia State University 23

slide-4
SLIDE 4

Bisection method

Suppose f is continuous on [a, b], and f (a)f (b) < 0 (WLOG f (a) < 0, f (b) > 0). Then f has at least one root in (a, b) by IVT. Bisection method ◮ Input. Endpoints a, b. Tolerance ǫtol. Maximum number of iterations Nmax. Set iteration counter N = 1. ◮ While N ≤ Nmax, do

  • 1. Set p = a+b

2 , compute f (p). If f (p) = 0 or b − a < ǫtol, break.

  • 2. If f (p) > 0, set b = p. If f (p) < 0, set a = p.
  • 3. N ← N + 1.

◮ Output. If i = Nmax, print(“Maximum iteration reached.”). Return p.

Numerical Analysis I – Xiaojing Ye, Math & Stat, Georgia State University 24

slide-5
SLIDE 5

Termination condition

Bisection method can run forever if we do not set termination condition (e.g., ǫtol, Nmax). Common choices of termination condition: ◮ Fixed number of iterations Nmax. ◮ |pN − pN−1| < ǫtol ◮ |f (pN)| < ǫtol ◮

|pN−pN−1| |pN|

< ǫtol

Numerical Analysis I – Xiaojing Ye, Math & Stat, Georgia State University 25

slide-6
SLIDE 6

Example

Example (Bisection method)

f (x) = x3 + 4x2 − 10. Find a root in [1, 2] using the bisection method.

  • Solution. First check if f (1)f (2) < 0 (if not, bisection method

may not apply).

Numerical Analysis I – Xiaojing Ye, Math & Stat, Georgia State University 26

slide-7
SLIDE 7

Bisection method

Theorem

Suppose f ∈ C[a, b] and f (a)f (b) < 0, then pn generated by the bisection method converges to p, a root of f , with |pn − p| < b−a

2n

Drawbacks of the bisection method: ◮ inefficient ◮ may discard some roots

Numerical Analysis I – Xiaojing Ye, Math & Stat, Georgia State University 27