Numerically solve for maximum root

106 Views Asked by At

I am looking for an efficient algorithm that can numerically solve a piecewise function for its maximum zero root. The piecewise function will normally take the form of the plots below where by below the maximum zero root it evaluates to zero and above the maximum root it evaluates to a negative. The function above the maximum root will always have a negative first derivative (downwards sloping) but could have a positive or negative second derivative as illustrated by the plots below.

I need to make sure that the maximum zero root is found and not a sub optimal root below the maximum one.

Ideally the algorithm would have faster convergence than the bisection method, and similar convergence to newton raphson but with better robustness in finding the maximum root.