1 / 10

Systems of Nonlinear Equations

Systems of Nonlinear Equations. Paul Heckbert Computer Science Department Carnegie Mellon University. Nonlinear Systems. One dimensional: f : R  R e.g. f(x) = ax-b = 0 (linear) or f(x) = sin(2 x )- x = 0 (nonlinear) Multidimensional f : R n  R n

dianelewis
Télécharger la présentation

Systems of Nonlinear Equations

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. Systems of Nonlinear Equations Paul Heckbert Computer Science Department Carnegie Mellon University 15-859B - Introduction to Scientific Computing

  2. Nonlinear Systems One dimensional: f : R  R e.g. f(x) = ax-b = 0 (linear) or f(x) = sin(2x)-x = 0 (nonlinear) Multidimensional f : Rn Rn e.g. f(x) = Ax-b = 0 (linear system) or {x2+y2+xy-1=0, x2+y2-xy-1=0} (nonlinear: two ellipses) also known as root finding 15-859B - Introduction to Scientific Computing

  3. Four 1-D Root-Finding Methods • Bisection Method • Newton’s Method • Secant Method • Linear Fractional Interpolation 15-859B - Introduction to Scientific Computing

  4. Bisection Method (Binary Search) Given f(), tol, and [a,b] such that sign(f(a))  sign(f(b)): while b-a>tol m = (a+b)/2 midpoint if sign(f(a)) = sign(f(m)): then a = m recurse on right half else b = m recurse on left half Guaranteed convergence! (if you can find initial a,b) but only at a linear rate: |errork+1| c|errork|, c<1 15-859B - Introduction to Scientific Computing

  5. Newton’s Method Given f(),f’(), tol, and initial guess x0 k = 0 do xk+1 = xk - f(xk)/f’(xk) k++ while xk - xk-1 > tol Can diverge (especially if f’ 0). If it converges, does so at quadratic rate: |ek+1|  c|ek|2. Requires derivative computation. 15-859B - Introduction to Scientific Computing

  6. Secant Method Like Newton, but approximates slope using point pairs Given f(), tol, and initial guesses x0, x1 k = 1 do xk+1 = xk - f(xk)(xk - xk-1)/(f(xk)-f(xk-1)) k++ while xk - xk-1 < tol Can diverge. If it converges, does so at rate 1.618: |ek+1|  c|ek|1.618. 15-859B - Introduction to Scientific Computing

  7. Linear Fractional Interpolation Instead of linear approximation, fit with fractional linear approximation: f(x)(x-u)/(vx-w) for some u,v,w Given f(), tol, and initial guesses a, b, c, fa=f(a), fb=f(b) do h = (a-c)(b-c)(fa-fb)fc / [(a-c)(fc-fb)fa-(b-c)(fc-fa)fb] a = b; fa = fb b = c; fb = fc c += h; fc = f(c) while h > tol If it converges, does so at rate 1.839: |ek+1|  c|ek|1.839. 15-859B - Introduction to Scientific Computing

  8. 1-D Root-Finding Summary • Bisection: safe: never diverges, but slow. • Newton’s method: risky but fast! • Secant method & linear fractional interpolation : less risky, mid-speed. • Hybrids: use a safe method where function poorly behaved, Newton’s method where it’s well-behaved. 15-859B - Introduction to Scientific Computing

  9. Multidimensional Newton’s Method f and x are n-vectors First order Taylor series approx.: f(x+h)  f(x)+f’(x)h f(x+h)=0 implies h=-J-1f (don’t compute J-1, but solve Jh=f ) so iteration should be xk+1 = xk - J-1(xk)f(xk) Method requires calculation of Jacobian – can be expensive 15-859B - Introduction to Scientific Computing

  10. Example: Intersection of Ellipses 2 equations in 2 unknowns: x2+y2+xy-1=0 x2+y2-xy-1=0 15-859B - Introduction to Scientific Computing

More Related