The fsolve function in MATLAB applies finite difference approximations of the Jacobian as a fallback if an analytical Jacobian is not provided.
Secant Method and Broden's Method (13:15 - 16:21)
The secant method in 1D employs a less accurate estimate for the derivative:
- The derivative at xáµ¢ is estimated as
(f(xáµ¢) - f(xáµ¢₋₁)) / (xáµ¢ - xáµ¢₋₁).
- This method cannot be straightforwardly extended to more than one dimension.
- The multi-dimensional counterpart of the secant equation is
J * (xáµ¢ - xáµ¢₋₁) = f(xáµ¢) - f(xáµ¢₋₁).
- This equation is underdetermined for the N² elements of the Jacobian with just the N-dimensional step vector and function difference vector.
- Broden's approach is a method for selecting a good approximation to the Jacobian from among the numerous solutions to this underdetermined problem.
- It updates the Jacobian approximation iteratively by a rank-one update formula.
- One of Broden's advantages is that the inverse of the new Jacobian Jáµ¢ can be obtained directly from the inverse of the old Jacobian Jáµ¢₋₁ by applying the Sherman-Morrison formula.
- This skips the costly operation of solving a linear system of equations at every iteration; rather, the Jacobian inverse matrix is iteratively updated.
- Precision is sacrificed, but computation time for each iteration is saved.
Damped Newton-Raphson Method (16:21 - 22:56)
The Newton-Raphson step in standard form sometimes lands on a new point where the function value is larger than at the current point:
- This is typical far from the root.
- The Newton-Raphson step gives a direction reducing the function value locally, but the overall step size may overshoot.
- The damped Newton-Raphson method adds a damping factor α (between 0 and 1) to adjust the step:
xáµ¢₊₁ = xáµ¢ - α * J⁻¹(xáµ¢) * f(xáµ¢).
- The intention is to select α so that the function norm at the new point
||f(xáµ¢₊₁)|| is minimized.
- There are practical approaches based on approximate methods to select α.
- One popular method is a line search, e.g., the Armijo line search.
- Armijo line search begins with α=1 (the entire Newton-Raphson step).
- It then tests whether the norm of the function at the new point
||f(xáµ¢₊₁)|| is suitably smaller than the norm at the current point ||f(xáµ¢)||.
- If the step is good (e.g.,
||f(xáµ¢₊₁)|| < ||f(xáµ¢)||), α=1 is accepted, and the step is executed.
- Otherwise, α is decreased (e.g., set to
α/2), and the test is tried again with the shorter step.
- This is repeated until a step size is identified which decreases the function norm, and this step is then taken.
- Since the Newton-Raphson direction ensures local reduction in function value if steps are small enough, there will always be a suitable α (unless a minimum/maximum has been reached).
- The Newton-Raphson method with damping is globally convergent, in the sense that it is guaranteed to converge eventually.
- But it is not globally convergent to a root; instead, it will converge to local minima or maxima of the function norm.
- Damping reduces the basins of attraction, reducing the convergence behavior to potentially being less fractal and more deterministic.
- Near a root, α=1 is generally accepted straight away, and the technique regains its fast convergence.
- The additional expense of the damping/line search phase per iteration is comparatively inexpensive relative to the computation or inversion of the Jacobian.
- MATLAB's
fsolve tends to employ damping or step sizing limitation automatically.
- One can use a matrix instead of the scalar α for damping to alter the direction or scale differently in varying dimensions.
- The cost of damping is a reduced rate of convergence but may enhance robustness and reliability.