optimalization toolbox
Download
Skip this Video
Download Presentation
Optimalization Toolbox

Loading in 2 Seconds...

play fullscreen
1 / 9

Optimalization Toolbox - PowerPoint PPT Presentation


  • 131 Views
  • Uploaded on

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)

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

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

Optimalization Toolbox

Fmincon()

Štefan Kolesár

inputs
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
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
  • 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
  • [….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
pr klad 1
Príklad 1.
  • 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];

pr klad 11
Príklad 1.
  • 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

pr klad z cvi enia
Príklad z cvičenia

   options = optimset(\'Algorithm\',\'interior-point\');    x = fmincon(@(x) myfun(x),[1;10],[],[],[],[],[],[],@(x) mycon(x),options)Do zvlášť súborov:

  function [c,ceq] = mycon(x)         c = x(1)^2 + 4*x(2)^2 -100;         ceq = [];       function f = myfun(x)         f = x(1)^2 - 48*x(1) - 48*x(2);      

interior point algorithm
Interior Point Algorithm
  • Problém (bariérova funkcia):
  • Možné riešenie pre μ>0
ad