I'm working on a control theoretical problem and trying to implement the solution in Matlab. Part of the solution requires minimizing a function f(x), for which my predecessor has opted to use a conjugate gradient method. He wrote his own conjugate gradient method, but it's not converging. I've replaced his method with a canned algorithm, but it is still not converging. This suggests to me that the problem is ill-suited to gradient methods. Can anybody suggest to me why this might be the case? Is it likely because the surface lacks a sufficient degree of differentiability? Also, can anybody suggest another minimization algorithm that I could attempt to use instead of gradient descent?