1 function g = wood_gradient(x1, x2, x3, x4)
3 % The gradient of the Wood function. See wood.m for more
6 f_x1 = 400*(x1^2 - x2)*x1 + 2*x1 - 2;
7 f_x2 = -200*x1^2 + 220.2*x2 + 19.8*x4 - 40;
8 f_x3 = 360*(x3^2 - x4)*x3 + 2*x3 - 2;
9 f_x4 = -180*x3^2 + 19.8*x2 + 200.2*x4 - 40;
11 g = [f_x1; f_x2; f_x3; f_x4];