]> gitweb.michael.orlitzky.com - octave.git/blobdiff - optimization/test_functions/wood.m
Add the Wood() test function and some tests.
[octave.git] / optimization / test_functions / wood.m
diff --git a/optimization/test_functions/wood.m b/optimization/test_functions/wood.m
new file mode 100644 (file)
index 0000000..3e11a40
--- /dev/null
@@ -0,0 +1,11 @@
+function f = wood(x1, x2, x3, x4)
+  ##
+  ## The Wood function. See Dennis & Schnabel, Appendix B, problem #5.
+  ## This function has a global minimum at x=(1,1,1,1) with f(x) == 0.
+  ## The suggested starting point is x0=(-3, -1, -3, -1).
+  ##
+  f = 100*(x1^2 - x2)^2 + (x1 - 1)^2 + (x3 - 1)^2;
+  f = f + 90*(x3^2 - x4)^2;
+  f = f + 10.1*((x2 - 1)^2 + (x4 - 1)^2);
+  f = f + 19.8*(x2 - 1)*(x4 - 1);
+end