force set gradient to be zero, check the function behavior of minFunc.