summaryrefslogtreecommitdiffstats
path: root/scilab_doc
diff options
context:
space:
mode:
authorMichaŽl Baudin <michael.baudin@scilab.org>2009-10-08 15:01:35 +0200
committerMichaŽl Baudin <michael.baudin@scilab.org>2009-10-08 15:01:35 +0200
commitebf3fce946fe67578de034fcc89e69f5b740a385 (patch)
tree1b78e7ae51ece31e9998da168fb298b64b345444 /scilab_doc
parent86f041dd374fb593a4f345659d3d19395dd0dc52 (diff)
downloadscilab-ebf3fce946fe67578de034fcc89e69f5b740a385.zip
scilab-ebf3fce946fe67578de034fcc89e69f5b740a385.tar.gz
Added manual for plotting functions
Diffstat (limited to 'scilab_doc')
-rw-r--r--scilab_doc/neldermead/fminsearch-so.pdfbin226589 -> 239703 bytes
-rw-r--r--scilab_doc/neldermead/fminsearch.tex35
-rw-r--r--scilab_doc/neldermead/scripts/fminsearch_demo.m9
-rw-r--r--scilab_doc/neldermead/testFminsearchOptimplotfunccountScilab.pngbin0 -> 5164 bytes
-rw-r--r--scilab_doc/neldermead/testFminsearchOptimplotxMatlab.pngbin0 -> 5533 bytes
-rw-r--r--scilab_doc/neldermead/testFminsearchOptimplotxScilab.pngbin0 -> 4448 bytes
6 files changed, 33 insertions, 11 deletions
diff --git a/scilab_doc/neldermead/fminsearch-so.pdf b/scilab_doc/neldermead/fminsearch-so.pdf
index 5973dce8..22f5123 100644
--- a/scilab_doc/neldermead/fminsearch-so.pdf
+++ b/scilab_doc/neldermead/fminsearch-so.pdf
Binary files differ
diff --git a/scilab_doc/neldermead/fminsearch.tex b/scilab_doc/neldermead/fminsearch.tex
index 191541b..4545f5e 100644
--- a/scilab_doc/neldermead/fminsearch.tex
+++ b/scilab_doc/neldermead/fminsearch.tex
@@ -301,12 +301,6 @@ precision is both these softwares is $\epsilon \approx 10^{-16}$.
301That implies that there are approximately 16 significant digits. 301That implies that there are approximately 16 significant digits.
302Therefore, the relative error on $x$, which is equivalent to 15 302Therefore, the relative error on $x$, which is equivalent to 15
303significant digits, is acceptable. 303significant digits, is acceptable.
304If we now consider the relative error on $f$, which is equivalent
305to only 8 significant digits, that may sound as a problem.
306This corresponds to the square root of the relative precision,
307because $\sqrt{\epsilon} = \approx 10^{-8}$.
308In fact, this is the best that we can expect from an optimization
309algorithm (\cite{Brent73algorithmsfor,Gill81MurrayWright}).
310 304
311Therefore, the result is as close as possible to the result produced 305Therefore, the result is as close as possible to the result produced
312by Matlab. More specifically : 306by Matlab. More specifically :
@@ -666,3 +660,32 @@ The comparison between the figures \ref{fig-fminsearch-matlab-optimplotfval} and
666very similar plots. Notice that Scilab's \scifunction{fminsearch} does not 660very similar plots. Notice that Scilab's \scifunction{fminsearch} does not
667provide the "Stop" and "Pause" buttons. 661provide the "Stop" and "Pause" buttons.
668 662
663The figures \ref{fig-fminsearch-scilab-optimplotx} and \ref{fig-fminsearch-scilab-optimplotfunccount}
664present the results of Scilab's \scifunction{optimplotx} and \scifunction{optimplotfunccount}
665functions.
666
667\begin{figure}
668\begin{center}
669\includegraphics[width=10cm]{testFminsearchOptimplotxScilab.png}
670\end{center}
671\caption{Plot produced by Scilab's fminsearch, with the \scifunction{optimplotx} function.}
672\label{fig-fminsearch-scilab-optimplotx}
673\end{figure}
674
675\begin{figure}
676\begin{center}
677\includegraphics[width=10cm]{testFminsearchOptimplotfunccountScilab.png}
678\end{center}
679\caption{Plot produced by Scilab's fminsearch, with the \scifunction{optimplotfunccount} function.}
680\label{fig-fminsearch-scilab-optimplotfunccount}
681\end{figure}
682
683\section{Conclusion}
684
685The current version of Scilab's \scifunction{fminsearch} provides the same algorithm
686as Matlab's \scifunction{fminsearch}. The numerical precision is the same.
687The \scifunction{optimset} and \scifunction{optimget} functions allows to configure the optimization,
688as well as the output and plotting function.
689Pre-defined plotting function allows to get a fast and nice plot of the optimization.
690
691
diff --git a/scilab_doc/neldermead/scripts/fminsearch_demo.m b/scilab_doc/neldermead/scripts/fminsearch_demo.m
index 41f8365..4b72498 100644
--- a/scilab_doc/neldermead/scripts/fminsearch_demo.m
+++ b/scilab_doc/neldermead/scripts/fminsearch_demo.m
@@ -60,19 +60,18 @@ opt = optimset('Display','iter' , 'MaxIter' , 10 );
60% Sample use of an output function 60% Sample use of an output function
61options = optimset('OutputFcn', @outfun); 61options = optimset('OutputFcn', @outfun);
62hold on 62hold on
63objfun=@(x) exp(x(1))*(4*x(1)^2+2*x(2)^2+x(1)*x(2)+2*x(2)); 63[x fval] = fminsearch(objfun, [-1.2, 1], options)
64[x fval] = fminsearch(objfun, [-1 1], options)
65hold off 64hold off
66 65
67% Sample use of a plot function : optimplotfval 66% Sample use of a plot function : optimplotfval
68options = optimset('PlotFcns',@optimplotfval); 67options = optimset('PlotFcns',@optimplotfval);
69[x ffinal] = fminsearch(@onehump,[2,1],options) 68[x ffinal] = fminsearch(banana,[-1.2, 1],options)
70 69
71% Sample use of a plot function : optimplotx 70% Sample use of a plot function : optimplotx
72options = optimset('PlotFcns',@optimplotx); 71options = optimset('PlotFcns',@optimplotx);
73[x ffinal] = fminsearch(@onehump,[2,1],options) 72[x ffinal] = fminsearch(banana,[-1.2, 1],options)
74 73
75% Sample use of a plot function : optimplotfunccount 74% Sample use of a plot function : optimplotfunccount
76options = optimset('PlotFcns',@optimplotfunccount); 75options = optimset('PlotFcns',@optimplotfunccount);
77[x ffinal] = fminsearch(@onehump,[2,1],options) 76[x ffinal] = fminsearch(banana,[-1.2, 1],options)
78 77
diff --git a/scilab_doc/neldermead/testFminsearchOptimplotfunccountScilab.png b/scilab_doc/neldermead/testFminsearchOptimplotfunccountScilab.png
new file mode 100644
index 0000000..28ca428
--- /dev/null
+++ b/scilab_doc/neldermead/testFminsearchOptimplotfunccountScilab.png
Binary files differ
diff --git a/scilab_doc/neldermead/testFminsearchOptimplotxMatlab.png b/scilab_doc/neldermead/testFminsearchOptimplotxMatlab.png
new file mode 100644
index 0000000..9ef102a
--- /dev/null
+++ b/scilab_doc/neldermead/testFminsearchOptimplotxMatlab.png
Binary files differ
diff --git a/scilab_doc/neldermead/testFminsearchOptimplotxScilab.png b/scilab_doc/neldermead/testFminsearchOptimplotxScilab.png
new file mode 100644
index 0000000..7697c0e
--- /dev/null
+++ b/scilab_doc/neldermead/testFminsearchOptimplotxScilab.png
Binary files differ