12.07.2015 Views

What Is Optimization Toolbox?

What Is Optimization Toolbox?

What Is Optimization Toolbox?

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

fseminfThe plot command inside 'mycon.m' slows down the computation.Remove this line to improve the speed.Two-Dimensional ExampleFind values ofx that minimizewherefor all values of and over the rangesstarting at the point .Note that the semi-infinite constraint is two-dimensional, that is, amatrix.First, write an M-file that computes the objective function.function f = myfun(x,s)% Objective functionf = sum((x-0.2).^2);Second, write an M-file for the constraints, called mycon.m. Includecode to draw the surface plot of the semi-infinite constraint each timemycon is called. This enables you to see how the constraint changes as Xis being minimized.function [c,ceq,K1,s] = mycon(X,s)% Initial sampling intervalif isnan(s(1,1)),8-103

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

Saved successfully!

Ooh no, something went wrong!