MATH 417 Lecture 3

From Notes
Jump to navigation Jump to search

« previous | Tuesday, January 21, 2014 | next »


Fixed Point Algorithm

To solve for f(x)=0 for x[a,b], we first write x=g(x) and evaluate pn+1=g(pn) for n=1,2,, where p0 is an initial guess.

Conditions

  1. If x[a,b], then g(x)[a,b] (for all x[a,b])
  2. max|g(x)|k<1 for x[a,b].

If both conditions are met, then |pnp|knmax(p0a,bp0)


Example 1

x32x5=02x=5x3x=5/2+1/2*x3

Doesn't satisfy first condition: g[32,11]

Or the second condition: g(x)6 (the distance between p and pn is always 6 times larger than pn1)

x3=2x+5x=2x+53

First condition holds: g[93,113]

Satisfies second condition: g(x)23(2x+5)23=2373

For p0=52 (midpoint), then we can get 3 digits of precision in 4 steps.

x(x22)=5x22=5xx=2+5x

Nasty, but it works...

Example 2

f(x)=ex3x2

f(0)=1 and f(1)=e3<0

So find a root on x[0,1]

x=13ex2

  1. g(x)[13,e3][0,1]
  2. |g(x)|=123ex212e3


Section 2.3: Newton's Method

One of the best methods used to date

Can we do better than bisection or fixed point?

Only works if f(x) is continuous, monotone, and concave up/down...


Given p0 on one side of p and f(pn), Compute ft(x), the line tangent to f at x:

y=f(pn)+f(pn)(xpn)x=pnf(pn)f(pn)

Use the second equation to find where ft(x) intersects the x-axis and use that number as the next value in the iteration: pn+1=pnf(pn)f(pn).

However, if f(pn)0, then our estimate will not get us very close to the root.


Convergence

Theorem. Assume fC2[a,b], f(x)=0 for some x[a,b], and f(x)0 for all x[a,b]. Then there exists a δ>0 such that if p0(pδ,p+δ), then pnp as n.

Proof. Newton's method is a fixed point method with g(x)=xf(x)f(x). Hence g(x)=f(x)f(x)(f(x))2. When x=p, we get g(p)=f(p)f(p)(f(p))2=0 because f(p)=0. We have g(x) continuous and equal to 0 at a point, therefore, there exists a δ>0 such that for any ϵ>0, there exists a δ>0 (depending only on ϵ) such that |g(x)g(p)|=|g(x)|<ϵ when x(pδ,p+δ)

quod erat demonstrandum
Note: We can choose any precision we want. The closer we get to p, the faster Newton's method converges. However, we have to choose the right starting value p0

Variations/Improvements on Newton's Method

Secant Method

Instead of using a tangent line, we use a secant line between two consecutive approximations.

This requires only one function evaluation at each step.

(need p1, generally start out with (p1,p0)=(a,b).

pn+1=pnf(pn)pnpn1f(pn)f(pn1)

Observe that the fractional part of the second term approximates the derivative of f at pn With the slope of the line between pn and pn+1. Hence the name secant method.

False Position Method

Uses same approximation as a Secant method, but tests the new point before accepting it to ensure that the root is always surrounded between endpoints.

  1. start with pL and pR (assumed to be on either side of the root).
  2. use secant method to generate a candidate point pn.
  3. If f(pL)f(pn)<0, then pL and pn are on either side of the root, so we accept pR:=pn as our new right endpoint.
  4. Otherwise, if f(pL)f(pn)>0, then they are both on the same side of the root, but pn is a better left approximation than pL, so we accept pL:=pn as our new left endpoint.

Always converges for concave-up or concave-down function.