X-Git-Url: http://gitweb.michael.orlitzky.com/?p=octave.git;a=blobdiff_plain;f=optimization%2Ftest_functions%2Fpowell_gradient.m;fp=optimization%2Ftest_functions%2Fpowell_gradient.m;h=7cea917937e5e8f2cb176c63e5161c5ed33e85f2;hp=0000000000000000000000000000000000000000;hb=54c2041babd3d3b67c9d26162f44da66f66b12db;hpb=3bd10526e0024458a17ce7588a954e4a470b2bbd diff --git a/optimization/test_functions/powell_gradient.m b/optimization/test_functions/powell_gradient.m new file mode 100644 index 0000000..7cea917 --- /dev/null +++ b/optimization/test_functions/powell_gradient.m @@ -0,0 +1,12 @@ +function g = powell_gradient(x1,x2,x3,x4) + ## + ## The gradient of the Powell function. See powell.m for more + ## information. + ## + f_x1 = 40*(x1 - x4)^3 + 2*x1 + 20*x2; + f_x2 = 4*(x2 - 2*x3)^3 + 20*x1 + 200*x2; + f_x3 = -8*(x2 - 2*x3)^3 + 10*x3 - 10*x4; + f_x4 = -40*(x1 - x4)^3 - 10*x3 + 10*x4; + + g = [f_x1; f_x2; f_x3; f_x4]; +end