Introduction to Unconstrained Optimization - Scilab
Introduction to Unconstrained Optimization - Scilab
Introduction to Unconstrained Optimization - Scilab
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
3000<br />
2500<br />
2000<br />
Z<br />
1500<br />
1000<br />
500<br />
0<br />
2.0<br />
1.5<br />
1.0<br />
0.5<br />
Y 0.5<br />
0.0<br />
0.0<br />
-0.5 X<br />
-0.5 -1.0<br />
-1.5<br />
-1.0 -2.0<br />
1.0<br />
1.5<br />
2.0<br />
Figure 4: Three dimensionnal plot of Rosenbrock’s function.<br />
data as input arguments.<br />
function f = rosenbrockS ( x1 , x2 )<br />
f = rosenbrock ( [ x1 x2 ] )<br />
endfunction<br />
The following statements allows <strong>to</strong> produce the plot presented in figure 4. Notice<br />
that we must transpose the output of feval in order <strong>to</strong> feed surf.<br />
x = linspace ( -2 , 2 , 20 );<br />
y = linspace ( -1 , 2 , 20 );<br />
Z = feval ( x , y , rosenbrockS );<br />
surf (x,y,Z ’)<br />
h = gcf ();<br />
cmap = graycolormap (10);<br />
h. color_map = cmap ;<br />
On one hand, the 3D plot seems <strong>to</strong> be more informative than the con<strong>to</strong>ur plot.<br />
On the other hand, we see that the level sets of the con<strong>to</strong>ur plot follow the curve<br />
quadratic curve x 2 = x 2 1, as expected from the function definition. The surface has<br />
the shape of a valley, which minimum is at x ⋆ = (1, 1) T . The whole picture has the<br />
form of a banana, which explains why some demonstrations of this test case present<br />
it as the banana function. As a matter of fact, the con<strong>to</strong>ur plot is often much more<br />
simple <strong>to</strong> analyze than a 3d surface plot. This is the reason why it is used more<br />
11