資源簡介
This short script demonstrates the use of the interior-point solver to
compute the solution to a quadratic program with convex objective
代碼片段和文件信息
%?X?=?IPSOLVER(X0OBJGRADCONSTRJACOBIANDESCENTDIRTOLMAXITERVERBOSE)
%?is?a?simple?yet?reasonably?robust?implementation?of?a?primal-dual
%?interior-point?solver?for?convex?programs?with?convex?inequality
%?constraints?(it?does?not?handle?equality?constraints).?Precisely?speaking
%?it?will?compute?the?solution?to?the?following?optimization?problem:
%
%?????minimize????f(x)
%?????subject?to??c(x)?0
%
%?where?f(x)?is?a?convex?objective?and?c(x)?is?a?vector-valued?function?with
%?outputs?that?are?convex?in?x.?There?are?many?many?optimization?problems
%?that?can?be?framed?in?this?form?(see?the?book?“Convex?Optimization“?by
%?Boyd?and?Vandenberghe?for?a?good?start).?This?code?is?mostly?based?on
%?the?descriptions?provided?in?this?reference:
%
%????Paul?Armand?Jean?C.?Gilbert?Sophie?Jan-Jegou.?A?Feasible?BFGS
%????Interior?Point?Algorithm?for?Solving?Convex?Minimization?Problems.?
%????SIAM?Journal?on?Optimization?Vol.?11?No.?1?pp.?199-222.
%
%?However?to?understand?what?is?going?on?you?will?need?to?read?up?on
%?interior-point?methods?for?constrained?optimization.?A?good?starting
%?point?is?the?book?of?Boyd?and?Vandenberghe.
%
%?The?input?X0?is?the?initial?point?for?the?solver.?It?must?be?an?n?x?1
%?matrix?where?n?is?the?number?of?(primal)?optimization?variables.
%?DESCENTDIR?must?be?either:?‘newton‘?for?the?Newton?search?direction
%?‘bfgs‘?for?the?quasi-Newton?search?direction?with?the
%?Broyden-Fletcher-Goldfarb-Shanno?(BFGS)?update?or?‘steepest‘?for?the
%?steepest?descent?direction.?The?steepest?descent?direction?is?often?quite
%?bad?and?the?solver?may?fail?to?converge?to?the?solution?if?you?take?this
%?option.?For?the?Newton?direction?you?must?be?able?to?compute?the?the
%?Hessian?of?the?objective.?Also?note?that?we?form?a?quasi-Newton
%?approximation?to?the?objective?not?to?the?Lagrangian?(as?is?usually
%?done).?This?means?that?you?will?always?have?to?provide?second-order
%?information?about?the?inequality?constraint?functions.
%?
%?TOL?is?the?tolerance?of?the?convergence?criterion;?it?determines?when?the
%?solver?should?stop.?MAXITER?is?the?maximum?number?of?iterations.?And?the
%?final?input?VERBOSE?must?be?set?to?true?or?false?depending?on?whether
%?you?would?like?to?see?the?progress?of?the?solver.
%
%?The?inputs?OBJ?GRAD?CONSTR?and?JACOBIAN?must?all?be?function?handles.?If
%?you?don‘t?know?what?function?handles?are?type?HELP?FUNCTION_HANDLE?in
%?MATLAB.
%?
%????*?OBJ?must?be?a?handle?to?a?function?that?takes?1?input?the?vector
%??????of?optimization?variables?and?returns?the?value?of?the?function?at
%??????the?given?point.?The?function?definition?should?look?something?like?F
%??????=?objectIVE(X).
%
%????*?GRAD?is?a?pointer?to?a?function?of?the?form?G?=?GRADIENT(X)?where
%??????G?is?the?n?x?1?gradient?vector?of?the?objective?or?[G?H]?=
%??????GRADIENT(X)?if?the?Newton?step?is?used?in?which?case?H?is?the?n?x?n
%??????Hessian?of?the?objective.
%
%????*?CONSTR?is?a?handle?to?a?function?of?the?form?C?=?CONSTRAINTS(X)
- 上一篇:matlab讀入三維點云數據斯坦福兔子
- 下一篇:異步電機矢量控制 mdl
評論
共有 條評論