X-Git-Url: http://gitweb.michael.orlitzky.com/?p=octave.git;a=blobdiff_plain;f=optimization%2Ftest_functions%2Fwood_gradient.m;fp=optimization%2Ftest_functions%2Fwood_gradient.m;h=f4dde786039ed9e1250ed2589e3555891d877b6f;hp=0000000000000000000000000000000000000000;hb=87d434fa93b3e52e8a5a0a9d99ae43492c35e1be;hpb=be86b42e1f06a8dddb6dd50832307e7d776023df diff --git a/optimization/test_functions/wood_gradient.m b/optimization/test_functions/wood_gradient.m new file mode 100644 index 0000000..f4dde78 --- /dev/null +++ b/optimization/test_functions/wood_gradient.m @@ -0,0 +1,11 @@ +function g = wood_gradient(x1, x2, x3, x4) + ## + ## The gradient of the Wood function. See wood.m for more information. + ## + f_x1 = 400*(x1^2 - x2)*x1 + 2*x1 - 2; + f_x2 = -200*x1^2 + 220.2*x2 + 19.8*x4 - 40; + f_x3 = 360*(x3^2 - x4)*x3 + 2*x3 - 2; + f_x4 = -180*x3^2 + 19.8*x2 + 200.2*x4 - 40; + + g = [f_x1; f_x2; f_x3; f_x4]; +end