Nonlinear Equations How can we solve these equations? = 40 / - - PowerPoint PPT Presentation
Nonlinear Equations How can we solve these equations? = 40 / - - PowerPoint PPT Presentation
Nonlinear Equations How can we solve these equations? = 40 / Spring force: = What is the displacement when = 2N? How can we solve these equations? Drag force: ! = 0.5 / = 0.5
How can we solve these equations?
- Spring force:
πΊ = π π¦ What is the displacement when πΊ = 2N?
π = 40 π/π
How can we solve these equations?
- Drag force:
πΊ = 0.5 π·( π π΅ π€) = π( π€) What is the velocity when πΊ = 20N?
π! = 0.5 ππ‘/π
π π€ = π( π€) βπΊ = 0
π! = 0.5 ππ‘/π
Nonlinear Equations in 1D
Goal: Solve π π¦ = 0 for π: β β β Find the root (zero) of the nonlinear equation π π€ Often called Root Finding
Bisection method
Bisection method
Convergence
An iterative method converges with rate π if: lim
.β0 ||2!"#|| ||2!||$ = π·,
0 < π· < β π = 1: linear convergence Linear convergence gains a constant number of accurate digits each step (and π· < 1 matters!) For example: Power Iteration
Convergence
An iterative method converges with rate π if: lim
.β0
||π.34|| ||π.||5 = π·, 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)
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.
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 267? A) [β10, β1.8] B) [β3, β2.1] C) [β4, 1.9]
Bisection method
Algorithm: 1.Take two points, π and π, on each side of the root such that π(π) and π(π) have
- pposite signs.
2.Calculate the midpoint π = !"#
$
- 3. Evaluate π(π) and use π to replace either π or π, keeping the signs of the
endpoints opposite.
Bisection Method - summary
q The function must be continuous with a root in the interval π, π q Requires only one function evaluations for each iteration!
- The first iteration requires two function evaluations.
q Given the initial internal [π, π], the length of the interval after π iterations is 869
)!
q Has linear convergence
Newtonβs method
- Recall we want to solve π π¦ = 0 for π: β β β
- The Taylor expansion:
π π¦! + β β π π¦! + πβ² π¦! β gives a linear approximation for the nonlinear function π near π¦!.
Newtonβs method
π¦"
Example
Consider solving the nonlinear equation 5 = 2.0 π" + π¦# What is the result of applying one iteration of Newtonβs method for solving nonlinear equations with initial starting guess π¦$ = 0, i.e. what is π¦%? A) β2 B) 0.75 C) β1.5 D) 1.5 E) 3.0
Newtonβs Method - summary
q Must be started with initial guess close enough to root (convergence is
- nly local). Otherwise it may not converge at all.
q Requires function and first derivative evaluation at each iteration (think about two function evaluations) q Typically has quadratic convergence lim
.β0
||π.34|| ||π.||) = π·, 0 < π· < β q What can we do when the derivative evaluation is too costly (or difficult to evaluate)?
Secant method
Also derived from Taylor expansion, but instead of using πβ² π¦. , it approximates the tangent with the secant line: π¦.34 = π¦. β π π¦. /πβ² π¦.
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
.β0
||π.34|| ||π.||5 = π·, 1 < π < 2
1D methods for root finding:
Method Update Convergence Cost Bisection Check signs of π π and π π π’! = |π β π| 2! Linear (π = 1 and c = 0.5) One function evaluation per iteration, no need to compute derivatives Secant π¦!"# = π¦! + β β = βπ π¦! /πππ πππ = π π¦! β π π¦!$# π¦! β π¦!$# Superlinear π = 1.618 , local convergence properties, convergence depends on the initial guess One function evaluation per iteration (two evaluations for the initial guesses only), no need to compute derivatives Newton π¦!"# = π¦! + β β = βπ π¦! /πβ² π¦! Quadratic π = 2 , local convergence properties, convergence depends on the initial guess Two function evaluations per iteration, requires first order derivatives