nonlinear equations
play

Nonlinear Equations = 40 / How can we solve these equations? - PowerPoint PPT Presentation

Nonlinear Equations = 40 / How can we solve these equations? Spring force: = ! = 0.5 / What is the displacement when = 2N? Drag force: = 0.5 ! " = !


  1. Nonlinear Equations

  2. ๐‘™ = 40 ๐‘‚/๐‘› How can we solve these equations? โ€ข Spring force: ๐บ = ๐‘™ ๐‘ฆ ๐œˆ ! = 0.5 ๐‘‚๐‘ก/๐‘› What is the displacement when ๐บ = 2N? โ€ข Drag force: ๐บ = 0.5 ๐ท ! ๐œ ๐ต ๐‘ค " = ๐œˆ ! ๐‘ค " What is the velocity when ๐บ = 20N ?

  3. โ€ข Spring force: ๐‘” ๐‘ฆ = ๐‘™ ๐‘ฆ โˆ’ ๐บ = 0 ๐œˆ ! = 0.5 ๐‘‚๐‘ก/๐‘› โ€ข Drag force: ๐‘” ๐‘ค = ๐œˆ ! ๐‘ค " โˆ’๐บ = 0 Find the root (zero) of the nonlinear equation ๐‘” ๐‘ค Nonlinear Equations in 1D Goal: Solve ๐‘” ๐‘ฆ = 0 for ๐‘”: โ„› โ†’ โ„› Often called Root Finding

  4. Bisection method Algorithm: 1.Take two points, ๐‘ and ๐‘ , on each side of the root such that ๐‘”(๐‘) and ๐‘”(๐‘) have opposite signs. 2.Calculate the midpoint ๐‘› = !"# $ 3. Evaluate ๐‘”(๐‘›) and use ๐‘› to replace either ๐‘ or ๐‘ , keeping the signs of the endpoints opposite.

  5. Convergence โ€ข The bisection method does not estimate ๐‘ฆ . , the approximation of the desired root ๐‘ฆ. It instead finds an interval smaller than a given tolerance that contains the root. โ€ข The length of the interval at iteration ๐‘™ is /01 " ! . We can define this interval as the error at iteration ๐‘™ ๐‘ โˆ’ ๐‘ |๐‘“ "%& | |๐‘“ "%& | 2 "%& lim |๐‘“ " | = lim |๐‘“ " | = lim = 0.5 ๐‘ โˆ’ ๐‘ "โ†’$ "โ†’$ "โ†’$ 2 " โ€ข Linear convergence

  6. Convergence An iterative method converges with rate ๐‘  if: ||๐‘“ .=> || lim ||๐‘“ . || ? = ๐ท, 0 < ๐ท < โˆž .โ†’< ๐‘  = 1: linear convergence ๐‘  > 1: superlinear convergence ๐‘  = 2: quadratic convergence Linear convergence gains a constant number of accurate digits each step (and ๐ท < 1 matters! Quadratic convergence doubles the number of accurate digits in each step (however it only starts making sense once ||๐‘“ . || is small (and ๐ท does not matter much)

  7. Example: Consider the nonlinear equation ๐‘” ๐‘ฆ = 0.5๐‘ฆ " โˆ’ 2 and solving f x = 0 using the Bisection Method. For each of the initial intervals below, how many iterations are required to ensure the root is accurate within 2 0@ ? A) [โˆ’10, โˆ’1.8] B) [โˆ’3, โˆ’2.1] C) [โˆ’4, 1.9]

  8. Bisection Method - summary q The function must be continuous with a root in the interval ๐‘, ๐‘ q Requires only one function evaluations for each iteration! o The first iteration requires two function evaluations. q Given the initial internal [๐‘, ๐‘] , the length of the interval after ๐‘™ iterations is /01 " ! q Has linear convergence

  9. Newtonโ€™s method โ€ข Recall we want to solve ๐‘” ๐‘ฆ = 0 for ๐‘”: โ„› โ†’ โ„› โ€ข The Taylor expansion: ๐‘” ๐‘ฆ . + โ„Ž โ‰ˆ ๐‘” ๐‘ฆ . + ๐‘”โ€ฒ ๐‘ฆ . โ„Ž gives a linear approximation for the nonlinear function ๐‘” near ๐‘ฆ . . ๐‘” ๐‘ฆ . + โ„Ž = 0 โ†’ โ„Ž = โˆ’๐‘” ๐‘ฆ . /๐‘”โ€ฒ ๐‘ฆ . โ€ข Algorithm: ๐‘ฆ A = ๐‘ก๐‘ข๐‘๐‘ ๐‘ข๐‘—๐‘œ๐‘• ๐‘•๐‘ฃ๐‘“๐‘ก๐‘ก ๐‘ฆ .=> = ๐‘ฆ . โˆ’ ๐‘” ๐‘ฆ . /๐‘”โ€ฒ ๐‘ฆ .

  10. Newtonโ€™s method Equation of the tangent line: ๐‘”โ€ฒ(๐‘ฆ . ) = ๐‘” ๐‘ฆ . โˆ’ 0 ๐‘ฆ . โˆ’ ๐‘ฆ .=> ๐‘ฆ "%& ๐‘ฆ "

  11. Iclicker question Consider solving the nonlinear equation 5 = 2.0 ๐‘“ C + ๐‘ฆ " What is the result of applying one iteration of Newtonโ€™s method for solving nonlinear equations with initial starting guess ๐‘ฆ A = 0, i.e. what is ๐‘ฆ > ? A) โˆ’2 B) 0.75 C) โˆ’1.5 D) 1.5 E) 3.0

  12. Newtonโ€™s Method - summary q Must be started with initial guess close enough to root (convergence is only local). Otherwise it may not converge at all. q Requires function and first derivative evaluation at each iteration (think about two function evaluations) q What can we do when the derivative evaluation is too costly (or difficult to evaluate)? q Typically has quadratic convergence ||๐‘“ .=> || lim ||๐‘“ . || " = ๐ท, 0 < ๐ท < โˆž .โ†’<

  13. Secant method Also derived from Taylor expansion, but instead of using ๐‘”โ€ฒ ๐‘ฆ . , it approximates the tangent with the secant line: ๐‘ฆ .=> = ๐‘ฆ . โˆ’ ๐‘” ๐‘ฆ . /๐‘”โ€ฒ ๐‘ฆ . Secant line: ๐‘”โ€ฒ(๐‘ฆ . ) โ‰ˆ ๐‘” ๐‘ฆ . โˆ’ ๐‘” ๐‘ฆ .0> ๐‘ฆ . โˆ’ ๐‘ฆ .0> โ€ข Algorithm: ๐‘ฆ ! , ๐‘ฆ " = ๐‘ก๐‘ข๐‘๐‘ ๐‘ข๐‘—๐‘œ๐‘• ๐‘•๐‘ฃ๐‘“๐‘ก๐‘ก๐‘“๐‘ก ๐‘” # ๐‘ฆ $ = ๐‘” ๐‘ฆ $ โˆ’ ๐‘” ๐‘ฆ $%" ๐‘ฆ $ โˆ’ ๐‘ฆ $%" ๐‘ฆ $&" = ๐‘ฆ $ โˆ’ ๐‘” ๐‘ฆ $ /๐‘”โ€ฒ ๐‘ฆ $ ๐‘ฆ "%& ๐‘ฆ "'& ๐‘ฆ "

  14. Secant Method - summary q Still local convergence q Requires only one function evaluation per iteration (only the first iteration requires two function evaluations) q Needs two starting guesses q Has slower convergence than Newtonโ€™s Method โ€“ superlinear convergence ||๐‘“ .=> || lim ||๐‘“ . || ? = ๐ท, 1 < ๐‘  < 2 .โ†’<

  15. 1D methods for root finding: Method Update Convergence Cost Check signs of ๐‘” ๐‘ and Linear (๐‘  = 1 and c = 0.5) Bisection One function evaluation per ๐‘” ๐‘ iteration, no need to compute derivatives ๐‘ข ! = |๐‘ โˆ’ ๐‘| 2 ! Superlinear ๐‘  = 1.618 , Secant ๐‘ฆ !"# = ๐‘ฆ ! + โ„Ž One function evaluation per local convergence properties, iteration (two evaluations for โ„Ž = โˆ’๐‘” ๐‘ฆ ! /๐‘’๐‘”๐‘ convergence depends on the the initial guesses only), no initial guess need to compute derivatives ๐‘’๐‘”๐‘ = ๐‘” ๐‘ฆ ! โˆ’ ๐‘” ๐‘ฆ !$# ๐‘ฆ ! โˆ’ ๐‘ฆ !$# Quadratic ๐‘  = 2 , local ๐‘ฆ !"# = ๐‘ฆ ! + โ„Ž Newton Two function evaluations per convergence properties, iteration, requires first order โ„Ž = โˆ’๐‘” ๐‘ฆ ! /๐‘”โ€ฒ ๐‘ฆ ! convergence depends on the derivatives initial guess

  16. Nonlinear system of equations

  17. Robotic arms https://www.youtube.com/watch?v=NRgNDlVtmz0 (Robotic arm 1) https://www.youtube.com/watch?v=9DqRkLQ5Sv8 (Robotic arm 2) https://www.youtube.com/watch?v=DZ_ocmY8xEI (Blender)

  18. Nonlinear system of equations Goal: Solve ๐’ˆ ๐’š = ๐Ÿ for ๐’ˆ: โ„› D โ†’ โ„› D In other words, ๐’ˆ ๐’š is a vector-valued function ๐‘” > ๐’š ๐‘” > ๐‘ฆ > , ๐‘ฆ " , ๐‘ฆ E , โ€ฆ , ๐‘ฆ D ๐’ˆ ๐’š = โ‹ฎ = โ‹ฎ ๐‘” D ๐’š ๐‘” D ๐‘ฆ > , ๐‘ฆ " , ๐‘ฆ E , โ€ฆ , ๐‘ฆ D If looking for a solution to ๐’ˆ ๐’š = ๐’› , then instead solve ๐’ˆ ๐’š = ๐’ˆ ๐’š โˆ’ ๐’› = ๐Ÿ

  19. Newtonโ€™s method Approximate the nonlinear function ๐’ˆ ๐’š by a linear function using Taylor expansion: ๐’ˆ ๐’š + ๐’• โ‰ˆ ๐’ˆ ๐’š + ๐‘ฒ ๐’š ๐’• where ๐‘ฒ ๐’š is the Jacobian matrix of the function ๐’ˆ : FG " ๐’š FG " ๐’š โ€ฆ FC " FC # IJ = FG $ ๐’š ๐‘ฒ ๐’š = or ๐‘ฒ ๐’š โ‹ฎ โ‹ฑ โ‹ฎ FC % FG # ๐’š FG # ๐’š โ€ฆ FC " FC # Set ๐’ˆ ๐’š + ๐’• = ๐Ÿ โŸน ๐‘ฒ ๐’š ๐’• = โˆ’๐’ˆ ๐’š This is a linear system of equations (solve for ๐’• )!

  20. Newtonโ€™s method Algorithm: ๐’š A = ๐‘—๐‘œ๐‘—๐‘ข๐‘—๐‘๐‘š ๐‘•๐‘ฃ๐‘“๐‘ก๐‘ก Solve ๐‘ฒ ๐’š . ๐’• . = โˆ’๐’ˆ ๐’š . Update ๐’š .=> = ๐’š . + ๐’• . Convergence: โ€ข Typically has quadratic convergence โ€ข Drawback: Still only locally convergent Cost: โ€ข Main cost associated with computing the Jacobian matrix and solving the Newton step.

  21. Newtonโ€™s method - summary q Typically quadratic convergence (local convergence) q Computing the Jacobian matrix requires the equivalent of ๐‘œ " function evaluations for a dense problem (where every function of ๐’ˆ ๐’š depends on every component of ๐’š ). q Computation of the Jacobian may be cheaper if the matrix is sparse. q The cost of calculating the step ๐’• is ๐‘ƒ ๐‘œ E for a dense Jacobian matrix (Factorization + Solve) q If the same Jacobian matrix ๐‘ฒ ๐’š . is reused for several consecutive iterations, the convergence rate will suffer accordingly (trade-off between cost per iteration and number of iterations needed for convergence)

  22. Example Consider solving the nonlinear system of equations 2 = 2๐‘ง + ๐‘ฆ 4 = ๐‘ฆ " + 4๐‘ง " What is the result of applying one iteration of Newtonโ€™s method with the following initial guess? ๐’š A = 1 0

  23. Finite Difference Find an approximate for the Jacobian matrix: %& % ๐’š %& % ๐’š โ€ฆ %( % %( & )* = %& ' ๐’š ๐‘ฒ ๐’š = or ๐‘ฒ ๐’š โ‹ฎ โ‹ฑ โ‹ฎ %( ( %& & ๐’š %& & ๐’š โ€ฆ %( % %( & In 1D: ๐œ–๐‘” ๐‘ฆ โ‰ˆ ๐‘” ๐‘ฆ + โ„Ž โˆ’ ๐‘” ๐‘ฆ ๐œ–๐‘ฆ โ„Ž In ND: G $ ๐’š=K ๐œบ % 0G $ ๐’š IJ = FG $ ๐’š ๐‘ฒ ๐’š FC % โ‰ˆ K

Recommend


More recommend