Nonlinear Equations and ODEs
Solve nonlinear equations and initial value problems for ordinary differential equations. From classical bisection to modern Runge-Kutta methods.
- Implement bisection and fixed-point iteration
- Apply Newton's method and understand its convergence
- Use secant and hybrid methods when derivatives are unavailable
- Implement Euler's method for ODE initial value problems
- Apply Runge-Kutta methods for higher accuracy
- Understand stability and stiffness in ODEs
1. Bisection Method
The simplest root-finding method: repeatedly halve an interval containing a root.
Algorithm Bisection Method
Input: , interval with , tolerance
- While :
- Compute midpoint
- If , return
- If , set
- Else set
- Return
Theorem 9.1: Bisection Convergence
After iterations, the error satisfies:
Convergence is linear with rate .
Remark:
Bisection is slow but reliable. It's often used to get a good initial guess for faster methods like Newton's method.
2. Fixed-Point Iteration
Definition 9.1: Fixed-Point Problem
Rewrite as . A fixed point of is a value such that .
Iterate:
Theorem 9.2: Convergence Criterion
If on an interval containing and , then fixed-point iteration converges locally with rate .
If , the iteration diverges from .
Example: Choosing g(x)
To solve :
- → (diverges)
- → (converges)
3. Newton's Method
Definition 9.2: Newton's Iteration
Geometric interpretation: Follow the tangent line at to the x-axis.
Theorem 9.3: Quadratic Convergence
If near simple root and is close enough to :
where , near .
Example: Newton's Method
Find by solving :
| Error | ||
|---|---|---|
| 0 | 1.0 | 0.414 |
| 1 | 1.5 | 0.086 |
| 2 | 1.41667 | 0.0025 |
| 3 | 1.41421 |
Definition 9.3: Secant Method
Replace with finite difference approximation:
Convergence order: (golden ratio).
4. Euler Method for ODEs
Consider the initial value problem: , .
Definition 9.4: Forward Euler Method
where is the step size and .
Theorem 9.4: Euler Error
Local truncation error:
Global error: (Euler is a first-order method)
Definition 9.5: Backward Euler (Implicit)
Requires solving for at each step. More stable for stiff problems.
Example: Euler Method
Solve , with :
At : (exact: )
5. Runge-Kutta Methods
Runge-Kutta methods achieve higher accuracy by evaluating at multiple points within each step.
Definition 9.6: Second-Order Runge-Kutta (Midpoint)
This is a second-order method with local error .
Definition 9.7: Classical Fourth-Order Runge-Kutta (RK4)
Theorem 9.5: RK4 Error
RK4 is a fourth-order method: local error , global error .
Multistep Methods
Adams-Bashforth (explicit) and Adams-Moulton (implicit) use previous solution values:
Stiff Equations
Stiff ODEs have widely varying time scales. Explicit methods require tiny steps. Use implicit methods (backward Euler, BDF, implicit RK) which are A-stable.
Remark:
Modern ODE solvers use adaptive step size control, comparing solutions at different orders to estimate error and adjust automatically.
Practice Quiz
Frequently Asked Questions
When should I use Newton's method vs. bisection?
Newton's method: When you have a good initial guess and can compute derivatives. Fast convergence (quadratic) but may diverge with poor starting point.
Bisection: When you need guaranteed convergence or don't have derivatives. Slower (linear) but always works if initial bracket is valid.
How do I choose step size for ODE solvers?
Use adaptive step size control: estimate local error by comparing solutions at different orders, then adjust to keep error within tolerance. Libraries like MATLAB's ode45 or SciPy's solve_ivp do this automatically.
What is a stiff ODE and how do I recognize one?
A stiff ODE has solution components with vastly different time scales. Signs include:
- Explicit methods require extremely small step sizes
- Jacobian has eigenvalues with very different magnitudes
- The solution appears smooth but explicit methods still struggle
Solution: Use implicit methods like backward Euler or BDF.
How do I solve systems of nonlinear equations?
Generalize Newton's method: for :
where is the Jacobian matrix. In practice, solve for the update.
Why is RK4 so popular?
RK4 offers an excellent balance: fourth-order accuracy with only 4 function evaluations per step. It's accurate enough for most non-stiff problems, easy to implement, and has good stability properties. For more demanding problems, use adaptive RK methods like Dormand-Prince (ode45).