Optimalization Toolbox

1 / 9

# Optimalization Toolbox - PowerPoint PPT Presentation

Optimalization Toolbox. Fmincon(). Štefan Kolesár. Inputs. x, b, beq, lb, ub sú vektory , A , Aeq sú matice c(x) , ceq(x) sú funkcie , ktoré vracajú vektor Funkčná hodnota f(x) je skalár f(x), c(x), ceq(x) – môžu b y ť nelineárne. Syntax. x = fmincon(fun,x0,A,b)

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.

## PowerPoint Slideshow about ' Optimalization Toolbox' - aileen

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

### Optimalization Toolbox

Fmincon()

Štefan Kolesár

Inputs
• x, b, beq, lb, ub sú vektory,
• A, Aeq sú matice
• c(x), ceq(x) sú funkcie, ktoré vracajú vektor
• Funkčná hodnota f(x) je skalár
• f(x), c(x), ceq(x) – môžu byť nelineárne
Syntax
• x = fmincon(fun,x0,A,b)
• x = fmincon(fun,x0,A,b,Aeq,beq)
• x = fmincon(fun,x0,A,b,Aeq,beq,lb,ub)
• x = fmincon(fun,x0,A,b,Aeq,beq,lb,ub,nonlcon)
• x = fmincon(fun,x0,A,b,Aeq,beq,lb,ub,nonlcon,options)
• x = fmincon(problem)
• [x,fval] = fmincon(...)
• [x,fval,exitflag] = fmincon(...)
• [x,fval,exitflag,output] = fmincon(...)
• [x,fval,exitflag,output,lambda] = fmincon(...)
• [x,fval,exitflag,output,lambda,grad] = fmincon(...)
• [x,fval,exitflag,output,lambda,grad,hessian] = fmincon(...)
Options
• options = optimset(\'GradConstr\',\'on\')
• options = optimset(\'Hessian\',\'user-supplied\');
• options = optimset( \'HessFcn\',@hessianfcn\');
• options=optimset(\'Algorithm\', \'trust-region-reflective\');
• options=optimset(\'Algorithm\',\'active-set\'); %default
• options=optimset(\'Algorithm\',\'interior-point\');
• options=optimset(\'Algorithm\',’sqp\');
Output
• [….output….]
• Iterations – počet iterácií
• funcCount – počet výpočtov funkčných hodnôt
• Lssteplength – dĺžka jedno-rozmer. kroku v pomere k smeru vyhľadávania
• Constrviolation – počet funkcií podmienky
• Stepsize – dĺžka kroku
• algorithm
• Najdite optimálne x f(x) = –x1*x2*x3, štartovacie body x = [10;10;10], za podmienky
• 0 ≤ x1 + 2*x2 + 2*x3 ≤ 72.
• Zapíšeme funkciu:

function f = myfun(x)

f = -x(1) * x(2) * x(3);

• Nerovnice podmienok

–x1–2*x2–2*x3 ≤ 0

x1 + 2*x2 + 2*x3≤ 72

• Obidve podmienky sú lineárne, zostavíme matice pravej a ľavej strany

A = [-1 -2 -2; ...

1 2 2];

b = [0;72];

• x0 = [10;10;10]; %štartovacie body
• [x,fval] = fmincon(@myfun,x0,A,b);
• Po 11tich interáciach

x

x =

24.0000

12.0000

12.0000

Funkčná hodnota:

fval

fval =

-3.4560e+03

• Overíme túto lineárnu nerovnosť podmienok (očakávame =<0|:

A*x-b

ans =

-72

0