15.05.2015 Views

Introduction to Unconstrained Optimization - Scilab

Introduction to Unconstrained Optimization - Scilab

Introduction to Unconstrained Optimization - Scilab

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

often in an optimization context, and particularily in this document. Still, for more<br />

than two parameters, no con<strong>to</strong>ur plot can be drawn. Therefore, when the objective<br />

function depends on more than two parameters, it is not easy <strong>to</strong> represent ourselves<br />

its associated landscape.<br />

Although this is not an issue in most cases, it might happen that the performance<br />

might be a problem <strong>to</strong> create the con<strong>to</strong>ur plot. In this case, we can rely on the<br />

vec<strong>to</strong>rization features of <strong>Scilab</strong>, which allows <strong>to</strong> greatly improve the speed of the<br />

creation of the computations.<br />

In the following script, we create a rosenbrockV function which is a vec<strong>to</strong>rized<br />

version of the Rosenbrock function. It takes the m-by-n matrices x1 and x2 as input<br />

arguments and returns the m-by-n matrix f which contains all the required function<br />

values. We use of the elementwise opera<strong>to</strong>rs .* and .^, which apply <strong>to</strong> a matrix of<br />

values element-by-element operations. Then we use the meshgrid function, which<br />

creates the two 100-by-100 matrices XX1 and XX2, containing combinations of the<br />

1-by-100 matrices x1 and x2. This allows <strong>to</strong> compute the 100-by-100 matrix Z in<br />

one single call <strong>to</strong> the rosenbrockV function. Finally, we call the con<strong>to</strong>ur function<br />

which creates the same figure as previously.<br />

function f = rosenbrockV ( x1 , x2 )<br />

f = 100 *(x2 -x1 .^2).^2 + (1-x1 ).^2<br />

endfunction<br />

x1 = linspace ( -2 ,2 ,100);<br />

x2 = linspace ( -2 ,2 ,100);<br />

[XX1 , XX2 ]= meshgrid (x1 ,x2 );<br />

Z = rosenbrockV ( XX1 , XX2 );<br />

con<strong>to</strong>ur ( x1 , x2 , Z’ , [1 10 100 500 1000] );<br />

The previous script is significantly faster than the previous versions. But it requires<br />

<strong>to</strong> rewrite the Rosenbrock function as a vec<strong>to</strong>rized function, which can be impossible<br />

in some practical cases.<br />

1.5 What is an optimum ?<br />

In this section, we present the characteristics of the solution of an optimization<br />

problem. The definitions presented in this section are mainly of theoretical value,<br />

and, in some sense, of didactic value as well. More practical results will be presented<br />

later.<br />

For any given feasible point x ∈ R n , let us define N(x, δ) the set of feasible points<br />

contained in a δ− neighbourhood of x.<br />

A δ− neighbourhood of x is the ball centered at x with radius δ,<br />

N(x, δ) = {y ∈ R n , ‖x − y‖ ≤ δ} . (16)<br />

There are three different types of minimum :<br />

• strong local minimum,<br />

• weak local minimum,<br />

• strong global minimum.<br />

12

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!