Add the Himmelblau function, as defined in Applied Nonlinear Programming.
[octave.git] / optimization / test_functions / himmelblau_gradient.m
1 function g = himmelblau_gradient(x1,x2)
2 ##
3 ## The gradient of the Himmelblau function. See himmelblau.m for
4 ## more information.
5 ##
6 f_x1 = 4*(x1^2 + x2 - 11)*x1 + 2*x2^2 + 2*x1 - 14;
7 f_x2 = 4*(x2^2 + x1 - 7)*x2 + 2*x1^2 + 2*x2 - 22;
8 g = [f_x1; f_x2];
9 end