Renamed mtlb_fminsearch into fminsearch. Added demos.
Michaƫl Baudin [Mon, 31 Aug 2009 12:41:10 +0000 (14:41 +0200)]
39 files changed:
scilab/modules/optimization/demos/neldermead/han1-history-simplex.png [new file with mode: 0644]
scilab/modules/optimization/demos/neldermead/han2-history-simplex.png [new file with mode: 0644]
scilab/modules/optimization/demos/neldermead/mckinnon.history.fbar.png [new file with mode: 0644]
scilab/modules/optimization/demos/neldermead/mckinnon.history.fopt.png [new file with mode: 0644]
scilab/modules/optimization/demos/neldermead/mckinnon.history.fopt.restart.png [new file with mode: 0644]
scilab/modules/optimization/demos/neldermead/mckinnon.history.restart.fbar.png [new file with mode: 0644]
scilab/modules/optimization/demos/neldermead/mckinnon.history.restart.fopt.png [new file with mode: 0644]
scilab/modules/optimization/demos/neldermead/mckinnon.history.restart.sigma.png [new file with mode: 0644]
scilab/modules/optimization/demos/neldermead/mckinnon.history.restart.simplex.png [new file with mode: 0644]
scilab/modules/optimization/demos/neldermead/mckinnon.history.sigma.png [new file with mode: 0644]
scilab/modules/optimization/demos/neldermead/mckinnon.history.sigma.restart.png [new file with mode: 0644]
scilab/modules/optimization/demos/neldermead/mckinnon.history.simplex.png [new file with mode: 0644]
scilab/modules/optimization/demos/neldermead/mckinnon.sci [new file with mode: 0644]
scilab/modules/optimization/demos/neldermead/neldermead_rosenbrock.sce [new file with mode: 0644]
scilab/modules/optimization/demos/neldermead/nmplot_boxproblemA.sce [new file with mode: 0644]
scilab/modules/optimization/demos/neldermead/nmplot_han1.sce [new file with mode: 0644]
scilab/modules/optimization/demos/neldermead/nmplot_han2.sce [new file with mode: 0644]
scilab/modules/optimization/demos/neldermead/nmplot_mckinnon.sce [new file with mode: 0644]
scilab/modules/optimization/demos/neldermead/nmplot_mckinnon2.sce [new file with mode: 0644]
scilab/modules/optimization/demos/neldermead/nmplot_rosenbrock.fixed.sce [new file with mode: 0644]
scilab/modules/optimization/demos/neldermead/nmplot_rosenbrock.sce [new file with mode: 0644]
scilab/modules/optimization/demos/neldermead/rosenbrock.fixed.history.fbar.png [new file with mode: 0644]
scilab/modules/optimization/demos/neldermead/rosenbrock.fixed.history.fopt.png [new file with mode: 0644]
scilab/modules/optimization/demos/neldermead/rosenbrock.fixed.history.sigma.png [new file with mode: 0644]
scilab/modules/optimization/demos/neldermead/rosenbrock.fixed.history.simplex.png [new file with mode: 0644]
scilab/modules/optimization/demos/neldermead/rosenbrock.history.fbar.png [new file with mode: 0644]
scilab/modules/optimization/demos/neldermead/rosenbrock.history.fbar.txt [new file with mode: 0644]
scilab/modules/optimization/demos/neldermead/rosenbrock.history.fopt.png [new file with mode: 0644]
scilab/modules/optimization/demos/neldermead/rosenbrock.history.fopt.txt [new file with mode: 0644]
scilab/modules/optimization/demos/neldermead/rosenbrock.history.sigma.png [new file with mode: 0644]
scilab/modules/optimization/demos/neldermead/rosenbrock.history.sigma.txt [new file with mode: 0644]
scilab/modules/optimization/demos/neldermead/rosenbrock.history.simplex.png [new file with mode: 0644]
scilab/modules/optimization/demos/neldermead/rosenbrock.history.simplex.txt [new file with mode: 0644]
scilab/modules/optimization/macros/neldermead/fminsearch.sci [moved from scilab/modules/optimization/macros/neldermead/mtlb_fminsearch.sci with 100% similarity]
scilab/modules/optimization/macros/neldermead/optimset.sci [moved from scilab/modules/optimization/macros/neldermead/mtlb_optimset.sci with 100% similarity]
scilab/modules/optimization/tests/unit_tests/neldermead/fminsearch.dia.ref [moved from scilab/modules/optimization/tests/unit_tests/neldermead/mtlb_fminsearch.dia.ref with 100% similarity]
scilab/modules/optimization/tests/unit_tests/neldermead/fminsearch.tst [moved from scilab/modules/optimization/tests/unit_tests/neldermead/mtlb_fminsearch.tst with 100% similarity]
scilab/modules/optimization/tests/unit_tests/neldermead/optimset.dia.ref [moved from scilab/modules/optimization/tests/unit_tests/neldermead/mtlb_optimset.dia.ref with 100% similarity]
scilab/modules/optimization/tests/unit_tests/neldermead/optimset.tst [moved from scilab/modules/optimization/tests/unit_tests/neldermead/mtlb_optimset.tst with 100% similarity]

diff --git a/scilab/modules/optimization/demos/neldermead/han1-history-simplex.png b/scilab/modules/optimization/demos/neldermead/han1-history-simplex.png
new file mode 100644 (file)
index 0000000..8cb57aa
Binary files /dev/null and b/scilab/modules/optimization/demos/neldermead/han1-history-simplex.png differ
diff --git a/scilab/modules/optimization/demos/neldermead/han2-history-simplex.png b/scilab/modules/optimization/demos/neldermead/han2-history-simplex.png
new file mode 100644 (file)
index 0000000..8273f9a
Binary files /dev/null and b/scilab/modules/optimization/demos/neldermead/han2-history-simplex.png differ
diff --git a/scilab/modules/optimization/demos/neldermead/mckinnon.history.fbar.png b/scilab/modules/optimization/demos/neldermead/mckinnon.history.fbar.png
new file mode 100644 (file)
index 0000000..628f3cd
Binary files /dev/null and b/scilab/modules/optimization/demos/neldermead/mckinnon.history.fbar.png differ
diff --git a/scilab/modules/optimization/demos/neldermead/mckinnon.history.fopt.png b/scilab/modules/optimization/demos/neldermead/mckinnon.history.fopt.png
new file mode 100644 (file)
index 0000000..9c7985b
Binary files /dev/null and b/scilab/modules/optimization/demos/neldermead/mckinnon.history.fopt.png differ
diff --git a/scilab/modules/optimization/demos/neldermead/mckinnon.history.fopt.restart.png b/scilab/modules/optimization/demos/neldermead/mckinnon.history.fopt.restart.png
new file mode 100644 (file)
index 0000000..10f0875
Binary files /dev/null and b/scilab/modules/optimization/demos/neldermead/mckinnon.history.fopt.restart.png differ
diff --git a/scilab/modules/optimization/demos/neldermead/mckinnon.history.restart.fbar.png b/scilab/modules/optimization/demos/neldermead/mckinnon.history.restart.fbar.png
new file mode 100644 (file)
index 0000000..4e06517
Binary files /dev/null and b/scilab/modules/optimization/demos/neldermead/mckinnon.history.restart.fbar.png differ
diff --git a/scilab/modules/optimization/demos/neldermead/mckinnon.history.restart.fopt.png b/scilab/modules/optimization/demos/neldermead/mckinnon.history.restart.fopt.png
new file mode 100644 (file)
index 0000000..2f5c04c
Binary files /dev/null and b/scilab/modules/optimization/demos/neldermead/mckinnon.history.restart.fopt.png differ
diff --git a/scilab/modules/optimization/demos/neldermead/mckinnon.history.restart.sigma.png b/scilab/modules/optimization/demos/neldermead/mckinnon.history.restart.sigma.png
new file mode 100644 (file)
index 0000000..4d9bef4
Binary files /dev/null and b/scilab/modules/optimization/demos/neldermead/mckinnon.history.restart.sigma.png differ
diff --git a/scilab/modules/optimization/demos/neldermead/mckinnon.history.restart.simplex.png b/scilab/modules/optimization/demos/neldermead/mckinnon.history.restart.simplex.png
new file mode 100644 (file)
index 0000000..bf38f11
Binary files /dev/null and b/scilab/modules/optimization/demos/neldermead/mckinnon.history.restart.simplex.png differ
diff --git a/scilab/modules/optimization/demos/neldermead/mckinnon.history.sigma.png b/scilab/modules/optimization/demos/neldermead/mckinnon.history.sigma.png
new file mode 100644 (file)
index 0000000..ac0c058
Binary files /dev/null and b/scilab/modules/optimization/demos/neldermead/mckinnon.history.sigma.png differ
diff --git a/scilab/modules/optimization/demos/neldermead/mckinnon.history.sigma.restart.png b/scilab/modules/optimization/demos/neldermead/mckinnon.history.sigma.restart.png
new file mode 100644 (file)
index 0000000..09d9c41
Binary files /dev/null and b/scilab/modules/optimization/demos/neldermead/mckinnon.history.sigma.restart.png differ
diff --git a/scilab/modules/optimization/demos/neldermead/mckinnon.history.simplex.png b/scilab/modules/optimization/demos/neldermead/mckinnon.history.simplex.png
new file mode 100644 (file)
index 0000000..2aa80a4
Binary files /dev/null and b/scilab/modules/optimization/demos/neldermead/mckinnon.history.simplex.png differ
diff --git a/scilab/modules/optimization/demos/neldermead/mckinnon.sci b/scilab/modules/optimization/demos/neldermead/mckinnon.sci
new file mode 100644 (file)
index 0000000..082cbc2
--- /dev/null
@@ -0,0 +1,112 @@
+//% MCKINNON computes the McKinnon function.
+//
+//  Discussion:
+//
+//    This function has a global minimizer:
+//
+//      X* = ( 0.0, -0.5 ), F(X*) = -0.25
+//
+//    There are three parameters, TAU, THETA and PHI.
+//
+//    1 < TAU, then F is strictly convex.
+//             and F has continuous first derivatives.
+//    2 < TAU, then F has continuous second derivatives.
+//    3 < TAU, then F has continuous third derivatives.
+//
+//    However, this function can cause the Nelder-Mead optimization
+//    algorithm to "converge" to a point which is not the minimizer
+//    of the function F.
+//
+//    Sample parameter values which cause problems for Nelder-Mead 
+//    include:
+//
+//      TAU = 1, THETA = 15, PHI =  10;
+//      TAU = 2, THETA =  6, PHI =  60;
+//      TAU = 3, THETA =  6, PHI = 400;
+//
+//    To get the bad behavior, we also assume the initial simplex has the form
+//
+//      X1 = (0,0),
+//      X2 = (1,1),
+//      X3 = (A,B), 
+//
+//    where 
+//
+//      A = (1+sqrt(33))/8 =  0.84307...
+//      B = (1-sqrt(33))/8 = -0.59307...
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    09 February 2008
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Reference:
+//
+//    Ken McKinnon,
+//    Convergence of the Nelder-Mead simplex method to a nonstationary point,
+//    SIAM Journal on Optimization,
+//    Volume 9, Number 1, 1998, pages 148-158.
+//
+//  Parameters:
+//
+//    Input, real X(2), the argument of the function.
+//
+//    Output, real F, the value of the function at X.
+//
+// Copyright (C) 2009 - INRIA - Michael Baudin, Scilab port
+function f = mckinnon1 ( x )
+
+  if ( length ( x ) ~= 2 )
+    error ( 'Error: function expects a two dimensional input\n' );
+  end
+
+  tau = 1.0;
+  theta = 15.0;
+  phi = 10.0;
+
+  if ( x(1) <= 0.0 )
+    f = theta * phi * abs ( x(1) ).^tau + x(2) * ( 1.0 + x(2) );
+  else
+    f = theta       *       x(1).^tau   + x(2) * ( 1.0 + x(2) );
+  end
+endfunction
+function f = mckinnon2 ( x )
+
+  if ( length ( x ) ~= 2 )
+    error ( 'Error: function expects a two dimensional input\n' );
+  end
+
+  tau = 2.0;
+  theta = 6.0;
+  phi = 60.0;
+
+  if ( x(1) <= 0.0 )
+    f = theta * phi * abs ( x(1) ).^tau + x(2) * ( 1.0 + x(2) );
+  else
+    f = theta       *       x(1).^tau   + x(2) * ( 1.0 + x(2) );
+  end
+endfunction
+function f = mckinnon3 ( x )
+
+  if ( length ( x ) ~= 2 )
+    error ( 'Error: function expects a two dimensional input\n' );
+  end
+
+  tau = 3.0;
+  theta = 6.0;
+  phi = 400.0;
+
+  if ( x(1) <= 0.0 )
+    f = theta * phi * abs ( x(1) ).^tau + x(2) * ( 1.0 + x(2) );
+  else
+    f = theta       *       x(1).^tau   + x(2) * ( 1.0 + x(2) );
+  end
+endfunction
+
diff --git a/scilab/modules/optimization/demos/neldermead/neldermead_rosenbrock.sce b/scilab/modules/optimization/demos/neldermead/neldermead_rosenbrock.sce
new file mode 100644 (file)
index 0000000..b418eb9
--- /dev/null
@@ -0,0 +1,37 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2008-2009 - INRIA - Michael Baudin
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution.  The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+
+function y = rosenbrock (x)
+y = 100*(x(2)-x(1)^2)^2+(1-x(1))^2;
+endfunction
+
+nm = neldermead_new ();
+nm = neldermead_configure(nm,"-numberofvariables",2);
+nm = neldermead_configure(nm,"-function",rosenbrock);
+nm = neldermead_configure(nm,"-x0",[-1.2 1.0]');
+nm = neldermead_configure(nm,"-maxiter",200);
+nm = neldermead_configure(nm,"-maxfunevals",300);
+nm = neldermead_configure(nm,"-tolfunrelative",10*%eps);
+nm = neldermead_configure(nm,"-tolxrelative",10*%eps);
+nm = neldermead_configure(nm,"-simplex0method","axes");
+nm = neldermead_configure(nm,"-simplex0length",1.0);
+nm = neldermead_configure(nm,"-method","variable");
+nm = neldermead_configure(nm,"-verbose",0);
+nm = neldermead_configure(nm,"-verbosetermination",0);
+nm = neldermead_search(nm);
+
+[nm , xdata , ydata , zdata ] = neldermead_contour ( nm , xmin = -2.0 , xmax = 2.0 , ymin = -2.0 , ymax = 2.0 , nx = 100 , ny = 100 );
+contour ( xdata , ydata , zdata , 20 )
+
+
+
+nm = neldermead_destroy(nm);
+clear nm;
+
+
diff --git a/scilab/modules/optimization/demos/neldermead/nmplot_boxproblemA.sce b/scilab/modules/optimization/demos/neldermead/nmplot_boxproblemA.sce
new file mode 100644 (file)
index 0000000..d711959
--- /dev/null
@@ -0,0 +1,158 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2008-2009 - INRIA - Michael Baudin
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution.  The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+
+//
+// nmplot_boxproblemA.sce --
+//   Show that the Box algorithm is able to reproduce the 
+//   numerical experiment presented in Box's paper.
+//
+
+//
+// boxproblemA --
+//   Computes the Box problem A cost function and 
+//   inequality constraints.
+//
+// Arguments
+//   x: the point where to compute the function
+//   index : the stuff to compute
+//   data : the parameters of Box cost function
+// Note
+//  The following protocol is used
+//  * if index=1, or no index, returns the value of the cost 
+//    function (default case)
+//  * if index=2, returns the value of the nonlinear inequality 
+//    constraints, as a row array
+//  * if index=3, returns an array which contains
+//    at index #0, the value of the cost function  
+//    at index #1 to the end is the list of the values of the nonlinear 
+//    constraints
+//  The inequality constraints are expected to be positive.
+//
+function f = boxproblemA ( x , index , data )
+  if (~isdef('index','local')) then
+    index = 1
+  end
+  b = x(2) + 0.01 * x(3)
+  x6 = (data.k1 + data.k2 * x(2) ...
+            + data.k3 * x(3) + data.k4 * x(4) + data.k5 * x(5)) * x(1)
+  y1 = data.k6 + data.k7 * x(2) + data.k8 * x(3) ...
+            + data.k9 * x(4) + data.k10 * x(5)
+  y2 = data.k11 + data.k12 * x(2) + data.k13 * x(3) ...
+            + data.k14 * x(4) + data.k15 * x(5)
+  y3 = data.k16 + data.k17 * x(2) + data.k18 * x(3) ...
+            + data.k19 * x(4) + data.k20 * x(5)
+  y4 = data.k21 + data.k22 * x(2) + data.k23 * x(3) ...
+            + data.k24 * x(4) + data.k25 * x(5)
+  x7 = ( y1 + y2 + y3 ) * x(1)
+  x8 = (data.k26 + data.k27 * x(2) + data.k28 * x(3) ...
+            + data.k29 * x(4) ...
+            + data.k30 * x(5) ) * x(1) + x6 + x7
+  if ( index==1 | index==3 ) then
+    f = (data.a2 * y1 + data.a3 * y2 + data.a4 * y3 + data.a5 * y4 ...
+             + 7840 * data.a6 - 100000 * data.a0 ...
+             - 50800 * $b * data.a7 + data.k31 + data.k32 * x(2) + data.k33 * x(3) ...
+             + data.k34 * x(4) + data.k35 * x(5)) * x(1) ...
+             - 24345 + data.a1 * x6
+    f = -f
+  end
+  if ( index==2 | index==3 ) then
+      c1 = x6
+      c2 = 294000 - x6
+      c3 = x7
+      c4 = 294000 - x7
+      c5 = x8
+      c6 = 277200 - x8
+  end
+  select index
+  case 1 then
+    result = f
+  case 2 then
+    result = [c1 c2 c3 c4 c5 c6]
+  case 3 then
+    result = [f c1 c2 c3 c4 c5 c6]
+  else
+    errmsg = sprintf("Unexpected index %d" , index);
+    error(errmsg);
+  end
+endfunction
+
+boxparams = struct()
+boxparams.a0 = 9
+boxparams.a1 = 15
+boxparams.a2 = 50
+boxparams.a3 = 9.583
+boxparams.a4 = 20
+boxparams.a5 = 15
+boxparams.a6 = 6
+boxparams.a7 = 0.75
+boxparams.k1 = -145421.402
+boxparams.k2 = 2931.1506
+boxparams.k3 = -40.427932
+boxparams.k4 = 5106.192
+boxparams.k5 = 15711.36
+boxparams.k6 = -161622.577
+boxparams.k7 = 4176.15328
+boxparams.k8 = 2.8260078
+boxparams.k9 = 9200.476
+boxparams.k10 = 13160.295
+boxparams.k11 = -21686.9194
+boxparams.k12 = 123.56928
+boxparams.k13 = -21.1188894
+boxparams.k14 = 706.834
+boxparams.k15 = 2898.573
+boxparams.k16 = 28298.388
+boxparams.k17 = 60.81096
+boxparams.k18 = 31.242116
+boxparams.k19 = 329.574
+boxparams.k20 = -2882.082
+boxparams.k21 = 74095.3845
+boxparams.k22 = -306.262544
+boxparams.k23 = 16.243649
+boxparams.k24 = -3094.252
+boxparams.k25 = -5566.2628
+boxparams.k26 = -26237.0
+boxparams.k27 = 99.0
+boxparams.k28 = -0.42
+boxparams.k29 = 1300.0
+boxparams.k30 = 2100.0
+boxparams.k31 = 925548.252
+boxparams.k32 = -61968.8432
+boxparams.k33 = 23.3088196
+boxparams.k34 = -27097.648
+boxparams.k35 = -50843.766
+
+
+
+
+nm = nmplot_new ();
+nm = nmplot_configure(nm,"-numberofvariables",2);
+nm = nmplot_configure(nm,"-function",boxproblemA);
+nm = nmplot_configure(nm,"-costfargument",boxparams);
+nm = nmplot_configure(nm,"-x0",[1.0 1.0]');
+nm = nmplot_configure(nm,"-maxiter",200);
+nm = nmplot_configure(nm,"-maxfunevals",300);
+nm = nmplot_configure(nm,"-simplex0method","given");
+nm = nmplot_configure(nm,"-tolsimplexizerelative",1.e-3);
+nm = nmplot_configure(nm,"-coords0",coords0);
+nm = nmplot_configure(nm,"-simplex0length",1.0);
+nm = nmplot_configure(nm,"-method","box");
+nm = nmplot_configure(nm,"-verbose",1);
+nm = nmplot_configure(nm,"-verbosetermination",1);
+// Configure like Box
+nm = neldermead_configure(nm,"-boundsmin",[0.0 1.2 20.0 9.0 6.0]);
+nm = neldermead_configure(nm,"-boundsmax",[5.0 2.5 60.0 9.3 7.0]);
+nm = neldermead_configure(nm,"-simplex0method","randbounds");
+nm = neldermead_configure(nm,"-nbineqconst",6);
+//
+// Perform optimization
+//
+nm = nmplot_search(nm);
+nm = nmplot_destroy(nm);
+
+
diff --git a/scilab/modules/optimization/demos/neldermead/nmplot_han1.sce b/scilab/modules/optimization/demos/neldermead/nmplot_han1.sce
new file mode 100644 (file)
index 0000000..8eaa274
--- /dev/null
@@ -0,0 +1,73 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2008-2009 - INRIA - Michael Baudin
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution.  The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+
+
+//
+// han1 --
+//   Compute the cost function from the Han Phd Thesis
+//   which exhibits a failure of the NM method.
+// Reference 
+//   Algorithms in Unconstrained Optimization
+//   Han, Lixing
+//   2000
+//   Ph.D., The University of Connecticut
+//
+function f = han1 ( x )
+  f = x(1)^2 + x(2) * (x(2) + 2.0) * (x(2) - 0.5) * (x(2) - 2.0);
+endfunction
+
+
+coords0 = [
+0.0 0.0 1.0
+-1.0 1.0 0.0
+]
+
+
+nm = nmplot_new ();
+nm = nmplot_configure(nm,"-numberofvariables",2);
+nm = nmplot_configure(nm,"-function",han1);
+nm = nmplot_configure(nm,"-x0",[1.0 1.0]');
+nm = nmplot_configure(nm,"-maxiter",50);
+nm = nmplot_configure(nm,"-maxfunevals",300);
+nm = nmplot_configure(nm,"-tolfunrelative",10*%eps);
+nm = nmplot_configure(nm,"-tolxrelative",10*%eps);
+nm = nmplot_configure(nm,"-simplex0method","given");
+nm = nmplot_configure(nm,"-coords0",coords0);
+nm = nmplot_configure(nm,"-simplex0length",1.0);
+nm = nmplot_configure(nm,"-method","variable");
+//nm = nmplot_configure(nm,"-verbose",1);
+nm = nmplot_configure(nm,"-verbosetermination",1);
+//
+// Setup output files
+//
+nm = nmplot_configure(nm,"-simplexfn","han1-history-simplex.txt");
+nm = nmplot_configure(nm,"-fbarfn","han1-history-fbar.txt");
+nm = nmplot_configure(nm,"-foptfn","han1-history-fopt.txt");
+nm = nmplot_configure(nm,"-sigmafn","han1-history-sigma.txt");
+//
+// Perform optimization
+//
+nm = nmplot_search(nm);
+//
+// Plot
+//
+[nm , xdata , ydata , zdata ] = nmplot_contour ( nm , xmin = -0.2 , xmax = 1.2 , ymin = -2.0 , ymax = 2.0 , nx = 50 , ny = 50 );
+//[nm , xdata , ydata , zdata ] = nmplot_contour ( nm , xmin = -0.2 , xmax = 1.2 , ymin = -1.2 , ymax = 1.2 , nx = 50 , ny = 50 );
+f = scf();
+xset("fpf"," ")
+contour ( xdata , ydata , zdata , 40 )
+nmplot_simplexhistory ( nm );
+xs2png(0,"han1-history-simplex.png");
+deletefile("han1-history-simplex.txt");
+deletefile("han1-history-fbar.txt");
+deletefile("han1-history-fopt.txt");
+deletefile("han1-history-sigma.txt");
+nm = nmplot_destroy(nm);
+
+
diff --git a/scilab/modules/optimization/demos/neldermead/nmplot_han2.sce b/scilab/modules/optimization/demos/neldermead/nmplot_han2.sce
new file mode 100644 (file)
index 0000000..e7fa80d
--- /dev/null
@@ -0,0 +1,73 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2008-2009 - INRIA - Michael Baudin
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution.  The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+
+
+//
+// han2 --
+//   Compute the cost function from the Han Phd Thesis
+//   which exhibits a failure of the NM method.
+// Reference 
+//   Algorithms in Unconstrained Optimization
+//   Han, Lixing
+//   2000
+//   Ph.D., The University of Connecticut
+//
+function f = han2 ( x )
+  if abs(x(2)) <= 1.0 then
+    rho = 0.0
+  elseif x(2) > 1.0 then
+    rho = x(2) - 1
+  else
+    rho = -x(2) - 1
+  end
+  f = x(1)^2 + rho;
+endfunction
+
+
+coords0 = [
+0.0 0.0 1.0
+0.5 -0.5 0.0
+]
+
+
+nm = nmplot_new ();
+nm = nmplot_configure(nm,"-numberofvariables",2);
+nm = nmplot_configure(nm,"-function",han2);
+nm = nmplot_configure(nm,"-x0",[1.0 1.0]');
+nm = nmplot_configure(nm,"-maxiter",50);
+nm = nmplot_configure(nm,"-maxfunevals",300);
+nm = nmplot_configure(nm,"-tolfunrelative",10*%eps);
+nm = nmplot_configure(nm,"-tolxrelative",10*%eps);
+nm = nmplot_configure(nm,"-simplex0method","given");
+nm = nmplot_configure(nm,"-coords0",coords0);
+nm = nmplot_configure(nm,"-simplex0length",1.0);
+nm = nmplot_configure(nm,"-method","variable");
+//nm = nmplot_configure(nm,"-verbose",1);
+nm = nmplot_configure(nm,"-verbosetermination",1);
+//
+// Setup output files
+//
+nm = nmplot_configure(nm,"-simplexfn","han2-history-simplex.txt");
+//
+// Perform optimization
+//
+nm = nmplot_search(nm);
+//
+// Plot
+//
+[nm , xdata , ydata , zdata ] = nmplot_contour ( nm , xmin = -0.2 , xmax = 1.2 , ymin = -1.5 , ymax = 1.5 , nx = 50 , ny = 50 );
+f = scf();
+xset("fpf"," ")
+contour ( xdata , ydata , zdata , 40 )
+nmplot_simplexhistory ( nm );
+xs2png(0,"han2-history-simplex.png");
+deletefile("han2-history-simplex.txt");
+nm = nmplot_destroy(nm);
+
+
diff --git a/scilab/modules/optimization/demos/neldermead/nmplot_mckinnon.sce b/scilab/modules/optimization/demos/neldermead/nmplot_mckinnon.sce
new file mode 100644 (file)
index 0000000..cdcfefa
--- /dev/null
@@ -0,0 +1,154 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2008-2009 - INRIA - Michael Baudin
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution.  The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+
+
+//dirname = get_absolute_file_path('nmplot_mckinnon.sce');
+//% MCKINNON computes the McKinnon function.
+//
+//  Discussion:
+//
+//    This function has a global minimizer:
+//
+//      X* = ( 0.0, -0.5 ), F(X*) = -0.25
+//
+//    There are three parameters, TAU, THETA and PHI.
+//
+//    1 < TAU, then F is strictly convex.
+//             and F has continuous first derivatives.
+//    2 < TAU, then F has continuous second derivatives.
+//    3 < TAU, then F has continuous third derivatives.
+//
+//    However, this function can cause the Nelder-Mead optimization
+//    algorithm to "converge" to a point which is not the minimizer
+//    of the function F.
+//
+//    Sample parameter values which cause problems for Nelder-Mead 
+//    include:
+//
+//      TAU = 1, THETA = 15, PHI =  10;
+//      TAU = 2, THETA =  6, PHI =  60;
+//      TAU = 3, THETA =  6, PHI = 400;
+//
+//    To get the bad behavior, we also assume the initial simplex has the form
+//
+//      X1 = (0,0),
+//      X2 = (1,1),
+//      X3 = (A,B), 
+//
+//    where 
+//
+//      A = (1+sqrt(33))/8 =  0.84307...
+//      B = (1-sqrt(33))/8 = -0.59307...
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    09 February 2008
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Reference:
+//
+//    Ken McKinnon,
+//    Convergence of the Nelder-Mead simplex method to a nonstationary point,
+//    SIAM Journal on Optimization,
+//    Volume 9, Number 1, 1998, pages 148-158.
+//
+//  Parameters:
+//
+//    Input, real X(2), the argument of the function.
+//
+//    Output, real F, the value of the function at X.
+//
+// Copyright (C) 2009 - INRIA - Michael Baudin, Scilab port
+
+function f = mckinnon3 ( x )
+
+  if ( length ( x ) ~= 2 )
+    error ( 'Error: function expects a two dimensional input\n' );
+  end
+
+  tau = 3.0;
+  theta = 6.0;
+  phi = 400.0;
+
+  if ( x(1) <= 0.0 )
+    f = theta * phi * abs ( x(1) ).^tau + x(2) * ( 1.0 + x(2) );
+  else
+    f = theta       *       x(1).^tau   + x(2) * ( 1.0 + x(2) );
+  end
+endfunction
+
+
+lambda1 = (1.0 + sqrt(33.0))/8.0
+lambda2 = (1.0 - sqrt(33.0))/8.0
+coords0 = [
+1.0 0.0 lambda1
+1.0 0.0 lambda2
+]
+
+
+nm = nmplot_new ();
+nm = nmplot_configure(nm,"-numberofvariables",2);
+nm = nmplot_configure(nm,"-function",mckinnon3);
+nm = nmplot_configure(nm,"-x0",[1.0 1.0]');
+nm = nmplot_configure(nm,"-maxiter",200);
+nm = nmplot_configure(nm,"-maxfunevals",300);
+nm = nmplot_configure(nm,"-tolfunrelative",10*%eps);
+nm = nmplot_configure(nm,"-tolxrelative",10*%eps);
+nm = nmplot_configure(nm,"-simplex0method","given");
+nm = nmplot_configure(nm,"-coords0",coords0);
+nm = nmplot_configure(nm,"-simplex0length",1.0);
+nm = nmplot_configure(nm,"-method","variable");
+//nm = nmplot_configure(nm,"-verbose",1);
+nm = nmplot_configure(nm,"-verbosetermination",1);
+//
+// Setup output files
+//
+nm = nmplot_configure(nm,"-simplexfn","mckinnon.history.simplex.txt");
+nm = nmplot_configure(nm,"-fbarfn","mckinnon.history.fbar.txt");
+nm = nmplot_configure(nm,"-foptfn","mckinnon.history.fopt.txt");
+nm = nmplot_configure(nm,"-sigmafn","mckinnon.history.sigma.txt");
+//
+// Perform optimization
+//
+nm = nmplot_search(nm);
+//
+// Plot
+//
+[nm , xdata , ydata , zdata ] = nmplot_contour ( nm , xmin = -0.2 , xmax = 1.2 , ymin = -2.0 , ymax = 2.0 , nx = 50 , ny = 50 );
+f = scf();
+xset("fpf"," ")
+contour ( xdata , ydata , zdata , 40 )
+nmplot_simplexhistory ( nm );
+xs2png(0,"mckinnon.history.simplex.png");
+f = scf();
+nmplot_historyplot ( nm , "mckinnon.history.fbar.txt" , ...
+  mytitle = "Function Value Average" , myxlabel = "Iterations" );
+xs2png(1,"mckinnon.history.fbar.png");
+f = scf();
+nmplot_historyplot ( nm , "mckinnon.history.fopt.txt" , ...
+  mytitle = "Minimum Function Value" , myxlabel = "Iterations" );
+xs2png(2,"mckinnon.history.fopt.png");
+f = scf();
+nmplot_historyplot ( nm , "mckinnon.history.sigma.txt" , ...
+  mytitle = "Maximum Oriented length" , myxlabel = "Iterations" );
+xs2png(3,"mckinnon.history.sigma.png");
+deletefile("mckinnon.history.simplex.txt");
+deletefile("mckinnon.history.fbar.txt");
+deletefile("mckinnon.history.fopt.txt");
+deletefile("mckinnon.history.sigma.txt");
+nm = nmplot_destroy(nm);
+
+
diff --git a/scilab/modules/optimization/demos/neldermead/nmplot_mckinnon2.sce b/scilab/modules/optimization/demos/neldermead/nmplot_mckinnon2.sce
new file mode 100644 (file)
index 0000000..ad455cd
--- /dev/null
@@ -0,0 +1,156 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2008-2009 - INRIA - Michael Baudin
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution.  The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+
+
+//dirname = get_absolute_file_path('nmplot_mckinnon.sce');
+
+//% MCKINNON computes the McKinnon function.
+//
+//  Discussion:
+//
+//    This function has a global minimizer:
+//
+//      X* = ( 0.0, -0.5 ), F(X*) = -0.25
+//
+//    There are three parameters, TAU, THETA and PHI.
+//
+//    1 < TAU, then F is strictly convex.
+//             and F has continuous first derivatives.
+//    2 < TAU, then F has continuous second derivatives.
+//    3 < TAU, then F has continuous third derivatives.
+//
+//    However, this function can cause the Nelder-Mead optimization
+//    algorithm to "converge" to a point which is not the minimizer
+//    of the function F.
+//
+//    Sample parameter values which cause problems for Nelder-Mead 
+//    include:
+//
+//      TAU = 1, THETA = 15, PHI =  10;
+//      TAU = 2, THETA =  6, PHI =  60;
+//      TAU = 3, THETA =  6, PHI = 400;
+//
+//    To get the bad behavior, we also assume the initial simplex has the form
+//
+//      X1 = (0,0),
+//      X2 = (1,1),
+//      X3 = (A,B), 
+//
+//    where 
+//
+//      A = (1+sqrt(33))/8 =  0.84307...
+//      B = (1-sqrt(33))/8 = -0.59307...
+//
+//  Licensing:
+//
+//    This code is distributed under the GNU LGPL license.
+//
+//  Modified:
+//
+//    09 February 2008
+//
+//  Author:
+//
+//    John Burkardt
+//
+//  Reference:
+//
+//    Ken McKinnon,
+//    Convergence of the Nelder-Mead simplex method to a nonstationary point,
+//    SIAM Journal on Optimization,
+//    Volume 9, Number 1, 1998, pages 148-158.
+//
+//  Parameters:
+//
+//    Input, real X(2), the argument of the function.
+//
+//    Output, real F, the value of the function at X.
+//
+// Copyright (C) 2009 - INRIA - Michael Baudin, Scilab port
+
+function f = mckinnon3 ( x )
+
+  if ( length ( x ) ~= 2 )
+    error ( 'Error: function expects a two dimensional input\n' );
+  end
+
+  tau = 3.0;
+  theta = 6.0;
+  phi = 400.0;
+
+  if ( x(1) <= 0.0 )
+    f = theta * phi * abs ( x(1) ).^tau + x(2) * ( 1.0 + x(2) );
+  else
+    f = theta       *       x(1).^tau   + x(2) * ( 1.0 + x(2) );
+  end
+endfunction
+
+lambda1 = (1.0 + sqrt(33.0))/8.0
+lambda2 = (1.0 - sqrt(33.0))/8.0
+coords0 = [
+1.0 0.0 lambda1
+1.0 0.0 lambda2
+]
+
+
+nm = nmplot_new ();
+nm = nmplot_configure(nm,"-numberofvariables",2);
+nm = nmplot_configure(nm,"-function",mckinnon3);
+nm = nmplot_configure(nm,"-x0",[1.0 1.0]');
+nm = nmplot_configure(nm,"-maxiter",200);
+nm = nmplot_configure(nm,"-maxfunevals",300);
+nm = nmplot_configure(nm,"-tolsimplexizerelative",1.e-6);
+nm = nmplot_configure(nm,"-simplex0method","given");
+nm = nmplot_configure(nm,"-coords0",coords0);
+nm = nmplot_configure(nm,"-simplex0length",1.0);
+nm = nmplot_configure(nm,"-method","variable");
+nm = nmplot_configure(nm,"-verbose",0);
+nm = nmplot_configure(nm,"-verbosetermination",0);
+nm = nmplot_configure(nm,"-kelleystagnationflag",1);
+nm = nmplot_configure(nm,"-restartflag",1);
+nm = nmplot_configure(nm,"-restartdetection","kelley");
+//
+// Setup output files
+//
+nm = nmplot_configure(nm,"-simplexfn","mckinnon.history.restart.simplex.txt");
+nm = nmplot_configure(nm,"-fbarfn","mckinnon.history.restart.fbar.txt");
+nm = nmplot_configure(nm,"-foptfn","mckinnon.history.restart.fopt.txt");
+nm = nmplot_configure(nm,"-sigmafn","mckinnon.history.restart.sigma.txt");
+//
+// Perform optimization
+//
+nm = nmplot_search(nm);
+//
+// Plot
+//
+[nm , xdata , ydata , zdata ] = nmplot_contour ( nm , xmin = -0.2 , xmax = 2.0 , ymin = -2.0 , ymax = 2.0 , nx = 100 , ny = 100 );
+f = scf();
+xset("fpf"," ")
+contour ( xdata , ydata , zdata , 40 )
+nmplot_simplexhistory ( nm );
+xs2png(0,"mckinnon.history.restart.simplex.png");
+f = scf();
+nmplot_historyplot ( nm , "mckinnon.history.restart.fbar.txt" , ...
+  mytitle = "Function Value Average" , myxlabel = "Iterations" );
+xs2png(1,"mckinnon.history.restart.fbar.png");
+f = scf();
+nmplot_historyplot ( nm , "mckinnon.history.restart.fopt.txt" , ...
+  mytitle = "Minimum Function Value" , myxlabel = "Iterations" );
+xs2png(2,"mckinnon.history.restart.fopt.png");
+f = scf();
+nmplot_historyplot ( nm , "mckinnon.history.restart.sigma.txt" , ...
+  mytitle = "Maximum Oriented length" , myxlabel = "Iterations" );
+xs2png(3,"mckinnon.history.restart.sigma.png");
+deletefile("mckinnon.history.restart.simplex.txt");
+deletefile("mckinnon.history.restart.fbar.txt");
+deletefile("mckinnon.history.restart.fopt.txt");
+deletefile("mckinnon.history.restart.sigma.txt");
+nm = nmplot_destroy(nm);
+
+
diff --git a/scilab/modules/optimization/demos/neldermead/nmplot_rosenbrock.fixed.sce b/scilab/modules/optimization/demos/neldermead/nmplot_rosenbrock.fixed.sce
new file mode 100644 (file)
index 0000000..a285447
--- /dev/null
@@ -0,0 +1,63 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2008-2009 - INRIA - Michael Baudin
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution.  The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+
+
+function y = rosenbrock (x)
+  y = 100*(x(2)-x(1)^2)^2 + (1-x(1))^2;
+endfunction
+
+nm = nmplot_new ();
+nm = nmplot_configure(nm,"-numberofvariables",2);
+nm = nmplot_configure(nm,"-function",rosenbrock);
+nm = nmplot_configure(nm,"-x0",[-1.2 1.0]');
+nm = nmplot_configure(nm,"-maxiter",200);
+nm = nmplot_configure(nm,"-maxfunevals",300);
+nm = nmplot_configure(nm,"-tolfunrelative",10*%eps);
+nm = nmplot_configure(nm,"-tolxrelative",10*%eps);
+nm = nmplot_configure(nm,"-simplex0method","axes");
+nm = nmplot_configure(nm,"-simplex0length",1.0);
+nm = nmplot_configure(nm,"-method","fixed");
+nm = nmplot_configure(nm,"-verbose",1);
+nm = nmplot_configure(nm,"-verbosetermination",0);
+//
+// Setup output files
+//
+nm = nmplot_configure(nm,"-simplexfn","rosenbrock.fixed.history.simplex.txt");
+nm = nmplot_configure(nm,"-fbarfn","rosenbrock.fixed.history.fbar.txt");
+nm = nmplot_configure(nm,"-foptfn","rosenbrock.fixed.history.fopt.txt");
+nm = nmplot_configure(nm,"-sigmafn","rosenbrock.fixed.history.sigma.txt");
+//
+// Perform optimization
+//
+nm = nmplot_search(nm);
+// Plot the contours of the cost function and the simplex history
+[nm , xdata , ydata , zdata ] = nmplot_contour ( nm , xmin = -2.0 , xmax = 2.0 , ymin = -2.0 , ymax = 2.0 , nx = 100 , ny = 100 );
+f = scf();
+contour ( xdata , ydata , zdata , 20 )
+nmplot_simplexhistory ( nm );
+xs2png(0,"rosenbrock.fixed.history.simplex.png");
+f = scf();
+nmplot_historyplot ( nm , "rosenbrock.fixed.history.fbar.txt" , ...
+  mytitle = "Function Value Average" , myxlabel = "Iterations" );
+xs2png(1,"rosenbrock.fixed.history.fbar.png");
+f = scf();
+nmplot_historyplot ( nm , "rosenbrock.fixed.history.fopt.txt" , ...
+  mytitle = "Minimum Function Value" , myxlabel = "Iterations" );
+xs2png(2,"rosenbrock.fixed.history.fopt.png");
+f = scf();
+nmplot_historyplot ( nm , "rosenbrock.fixed.history.sigma.txt" , ...
+  mytitle = "Maximum Oriented length" , myxlabel = "Iterations" );
+xs2png(3,"rosenbrock.fixed.history.sigma.png");
+deletefile("rosenbrock.fixed.history.simplex.txt");
+deletefile("rosenbrock.fixed.history.fbar.txt");
+deletefile("rosenbrock.fixed.history.fopt.txt");
+deletefile("rosenbrock.fixed.history.sigma.txt");
+nm = nmplot_destroy(nm);
+
+
diff --git a/scilab/modules/optimization/demos/neldermead/nmplot_rosenbrock.sce b/scilab/modules/optimization/demos/neldermead/nmplot_rosenbrock.sce
new file mode 100644 (file)
index 0000000..f180860
--- /dev/null
@@ -0,0 +1,63 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2008-2009 - INRIA - Michael Baudin
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution.  The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+
+
+function y = rosenbrock (x)
+  y = 100*(x(2)-x(1)^2)^2 + (1-x(1))^2;
+endfunction
+
+nm = nmplot_new ();
+nm = nmplot_configure(nm,"-numberofvariables",2);
+nm = nmplot_configure(nm,"-function",rosenbrock);
+nm = nmplot_configure(nm,"-x0",[-1.2 1.0]');
+nm = nmplot_configure(nm,"-maxiter",200);
+nm = nmplot_configure(nm,"-maxfunevals",300);
+nm = nmplot_configure(nm,"-tolfunrelative",10*%eps);
+nm = nmplot_configure(nm,"-tolxrelative",10*%eps);
+nm = nmplot_configure(nm,"-simplex0method","axes");
+nm = nmplot_configure(nm,"-simplex0length",1.0);
+nm = nmplot_configure(nm,"-method","variable");
+nm = nmplot_configure(nm,"-verbose",1);
+nm = nmplot_configure(nm,"-verbosetermination",0);
+//
+// Setup output files
+//
+nm = nmplot_configure(nm,"-simplexfn","rosenbrock.history.simplex.txt");
+nm = nmplot_configure(nm,"-fbarfn","rosenbrock.history.fbar.txt");
+nm = nmplot_configure(nm,"-foptfn","rosenbrock.history.fopt.txt");
+nm = nmplot_configure(nm,"-sigmafn","rosenbrock.history.sigma.txt");
+//
+// Perform optimization
+//
+nm = nmplot_search(nm);
+// Plot the contours of the cost function and the simplex history
+[nm , xdata , ydata , zdata ] = nmplot_contour ( nm , xmin = -2.0 , xmax = 2.0 , ymin = -1.0 , ymax = 2.5 , nx = 100 , ny = 100 );
+f = scf();
+contour ( xdata , ydata , zdata , 30 )
+nmplot_simplexhistory ( nm );
+xs2png(0,"rosenbrock.history.simplex.png");
+f = scf();
+nmplot_historyplot ( nm , "rosenbrock.history.fbar.txt" , ...
+  mytitle = "Function Value Average" , myxlabel = "Iterations" );
+xs2png(1,"rosenbrock.history.fbar.png");
+f = scf();
+nmplot_historyplot ( nm , "rosenbrock.history.fopt.txt" , ...
+  mytitle = "Minimum Function Value" , myxlabel = "Iterations" );
+xs2png(2,"rosenbrock.history.fopt.png");
+f = scf();
+nmplot_historyplot ( nm , "rosenbrock.history.sigma.txt" , ...
+  mytitle = "Maximum Oriented length" , myxlabel = "Iterations" );
+xs2png(3,"rosenbrock.history.sigma.png");
+deletefile("rosenbrock.history.simplex.txt");
+deletefile("rosenbrock.history.fbar.txt");
+deletefile("rosenbrock.history.fopt.txt");
+deletefile("rosenbrock.history.sigma.txt");
+nm = nmplot_destroy(nm);
+
+
diff --git a/scilab/modules/optimization/demos/neldermead/rosenbrock.fixed.history.fbar.png b/scilab/modules/optimization/demos/neldermead/rosenbrock.fixed.history.fbar.png
new file mode 100644 (file)
index 0000000..62880f5
Binary files /dev/null and b/scilab/modules/optimization/demos/neldermead/rosenbrock.fixed.history.fbar.png differ
diff --git a/scilab/modules/optimization/demos/neldermead/rosenbrock.fixed.history.fopt.png b/scilab/modules/optimization/demos/neldermead/rosenbrock.fixed.history.fopt.png
new file mode 100644 (file)
index 0000000..0f957bf
Binary files /dev/null and b/scilab/modules/optimization/demos/neldermead/rosenbrock.fixed.history.fopt.png differ
diff --git a/scilab/modules/optimization/demos/neldermead/rosenbrock.fixed.history.sigma.png b/scilab/modules/optimization/demos/neldermead/rosenbrock.fixed.history.sigma.png
new file mode 100644 (file)
index 0000000..03bce98
Binary files /dev/null and b/scilab/modules/optimization/demos/neldermead/rosenbrock.fixed.history.sigma.png differ
diff --git a/scilab/modules/optimization/demos/neldermead/rosenbrock.fixed.history.simplex.png b/scilab/modules/optimization/demos/neldermead/rosenbrock.fixed.history.simplex.png
new file mode 100644 (file)
index 0000000..1686ab0
Binary files /dev/null and b/scilab/modules/optimization/demos/neldermead/rosenbrock.fixed.history.simplex.png differ
diff --git a/scilab/modules/optimization/demos/neldermead/rosenbrock.history.fbar.png b/scilab/modules/optimization/demos/neldermead/rosenbrock.history.fbar.png
new file mode 100644 (file)
index 0000000..0a5470f
Binary files /dev/null and b/scilab/modules/optimization/demos/neldermead/rosenbrock.history.fbar.png differ
diff --git a/scilab/modules/optimization/demos/neldermead/rosenbrock.history.fbar.txt b/scilab/modules/optimization/demos/neldermead/rosenbrock.history.fbar.txt
new file mode 100644 (file)
index 0000000..71e5b88
--- /dev/null
@@ -0,0 +1,12 @@
+//
+// rosenbrock.history.fbar.txt--
+//   History of the function value average during Nelder-Mead algorithm.
+//
+// Copyright (C) 2008-2009 - INRIA - Michael Baudin
+//
+history = [
+0 3.784675e+000
+1 3.784675e+000
+2 1.994637e+000
+2 1.994637e+000
+]
diff --git a/scilab/modules/optimization/demos/neldermead/rosenbrock.history.fopt.png b/scilab/modules/optimization/demos/neldermead/rosenbrock.history.fopt.png
new file mode 100644 (file)
index 0000000..2fb0137
Binary files /dev/null and b/scilab/modules/optimization/demos/neldermead/rosenbrock.history.fopt.png differ
diff --git a/scilab/modules/optimization/demos/neldermead/rosenbrock.history.fopt.txt b/scilab/modules/optimization/demos/neldermead/rosenbrock.history.fopt.txt
new file mode 100644 (file)
index 0000000..cd6563c
--- /dev/null
@@ -0,0 +1,12 @@
+//
+// rosenbrock.history.fopt.txt--
+//   History of the function value optimum during Nelder-Mead algorithm.
+//
+// Copyright (C) 2008-2009 - INRIA - Michael Baudin
+//
+history = [
+0 8.000000e+000
+1 8.000000e+000
+2 8.000000e+000
+2 8.000000e+000
+]
diff --git a/scilab/modules/optimization/demos/neldermead/rosenbrock.history.sigma.png b/scilab/modules/optimization/demos/neldermead/rosenbrock.history.sigma.png
new file mode 100644 (file)
index 0000000..acb6d81
Binary files /dev/null and b/scilab/modules/optimization/demos/neldermead/rosenbrock.history.sigma.png differ
diff --git a/scilab/modules/optimization/demos/neldermead/rosenbrock.history.sigma.txt b/scilab/modules/optimization/demos/neldermead/rosenbrock.history.sigma.txt
new file mode 100644 (file)
index 0000000..0649bef
--- /dev/null
@@ -0,0 +1,12 @@
+//
+// rosenbrock.history.sigma.txt--
+//   History of the maximum of oriented length during Nelder-Mead algorithm.
+//
+// Copyright (C) 2008-2009 - INRIA - Michael Baudin
+//
+history = [
+0 1.414214e+000
+1 1.414214e+000
+2 1.030776e+000
+2 1.030776e+000
+]
diff --git a/scilab/modules/optimization/demos/neldermead/rosenbrock.history.simplex.png b/scilab/modules/optimization/demos/neldermead/rosenbrock.history.simplex.png
new file mode 100644 (file)
index 0000000..4f22998
Binary files /dev/null and b/scilab/modules/optimization/demos/neldermead/rosenbrock.history.simplex.png differ
diff --git a/scilab/modules/optimization/demos/neldermead/rosenbrock.history.simplex.txt b/scilab/modules/optimization/demos/neldermead/rosenbrock.history.simplex.txt
new file mode 100644 (file)
index 0000000..8c4de6e
--- /dev/null
@@ -0,0 +1,43 @@
+//
+// rosenbrock.history.simplex.txt--
+//   History of the simplex during Nelder-Mead algorithm.
+//
+// Copyright (C) 2008-2009 - INRIA - Michael Baudin
+//
+history = list()
+// Iteration #0
+history($+1) = [
+// Vertex #1
+0.000000e+000 0.000000e+000 
+// Vertex #2
+8.430703e-001 -5.930703e-001 
+// Vertex #3
+1.000000e+000 1.000000e+000 
+]
+// Iteration #1
+history($+1) = [
+// Vertex #1
+0.000000e+000 0.000000e+000 
+// Vertex #2
+8.430703e-001 -5.930703e-001 
+// Vertex #3
+1.000000e+000 1.000000e+000 
+]
+// Iteration #2
+history($+1) = [
+// Vertex #1
+0.000000e+000 0.000000e+000 
+// Vertex #2
+7.107676e-001 3.517324e-001 
+// Vertex #3
+8.430703e-001 -5.930703e-001 
+]
+// Iteration #2
+history($+1) = [
+// Vertex #1
+0.000000e+000 0.000000e+000 
+// Vertex #2
+7.107676e-001 3.517324e-001 
+// Vertex #3
+8.430703e-001 -5.930703e-001 
+]