Optimization: principles and algorithms, by Michel Bierlaire
run0508quadratic.m
Go to the documentation of this file.
1 %> \file
2 %> Runs example 5.8 with Newton's local with the quadratic model
3 %>
4 %> @ingroup Running
5 %> @ingroup chap10
6 %> @author <a href="http://people.epfl.ch/michel.bierlaire">Michel Bierlaire</a>
7 %> @date Fri Mar 20 16:15:37 2015
8 
9 %> @note Calls \ref newtonLocalQuadratic
10 
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".
12 
13 x0 = [-2 ; 1] ;
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)
18 
19 x0 = [1 ; 1] ;
20 [solution, gradient] = newtonLocalQuadratic('ex0508gradient',x0,1.0e-15,0)
21 %[solution, gradient] = newtonLocalQuadratic('ex0508gradient',x0,1.0e-15,1)
22 
23 
function ex0508gradient(in x)
Gradient of example 5.8 in .
Copyright 2015-2016 Michel Bierlaire