]> gitweb.michael.orlitzky.com - octave.git/blob - optimization/test_functions/powell_gradient.m
Add powell_gradient(), powell_gradient1() and their tests.
[octave.git] / optimization / test_functions / powell_gradient.m
1 function g = powell_gradient(x1,x2,x3,x4)
2 ##
3 ## The gradient of the Powell function. See powell.m for more
4 ## information.
5 ##
6 f_x1 = 40*(x1 - x4)^3 + 2*x1 + 20*x2;
7 f_x2 = 4*(x2 - 2*x3)^3 + 20*x1 + 200*x2;
8 f_x3 = -8*(x2 - 2*x3)^3 + 10*x3 - 10*x4;
9 f_x4 = -40*(x1 - x4)^3 - 10*x3 + 10*x4;
10
11 g = [f_x1; f_x2; f_x3; f_x4];
12 end