2 %> Runs example 5.8 with Newton
's local with the quadratic model 6 %> @author <a href="http://people.epfl.ch/michel.bierlaire">Michel Bierlaire</a> 7 %> @date Fri Mar 20 16:15:37 2015 9 %> @note Calls \ref newtonLocalQuadratic 11 %> @note The second run fails with the following error message: "chol: input matrix must be positive definite". Indeed, the hessian matrix is not positive definite at the starting point, and the quadratic problem is not bounded. If the conjugate gradient algorithm is used (last statement that is commented out), the error message is "error: The matrix must de positive definite". 14 printf("With direct method\n"); 15 [solution,gradient] = newtonLocalQuadratic('ex0508gradient',x0,1.0e-15,0) 16 printf("With conjugate gradient\n"); 17 [solution,gradient] = newtonLocalQuadratic('ex0508gradient',x0,1.0e-15,1) 20 [solution, gradient] = newtonLocalQuadratic('ex0508gradient',x0,1.0e-15,0) 21 %[solution, gradient] = newtonLocalQuadratic('ex0508gradient',x0,1.0e-15,1) function ex0508gradient(in x)
Gradient of example 5.8 in .