Fmincon in Matlab 2014a

4 ビュー (過去 30 日間)
Son Tran
Son Tran 2014 年 9 月 13 日
コメント済み: Jonathan Pillow 2015 年 3 月 20 日
Hi, I've tried some of my code in MATLAB 2014a and many of them is not working, most are caused by fmincon function as "Error using fmincon (line 816), Hessian option set to 'on' but no Hessian function provided in options HessFcn nor in HessMult". This does not happen with previous Matlab version.

回答 (4 件)

Aleksandar Milchevski
Aleksandar Milchevski 2015 年 2 月 24 日
I had the same problem. I resolved it by specifying the algorithm used as trust-region-reflective i.e. adding 'Algorithm','trust-region-reflective' to the options.

Waleed El-Badry
Waleed El-Badry 2014 年 9 月 13 日
I believe backward compatibility is one of the merits of MATLAB. Even if new implementation is applied, it is done via overloading without touching the previous implementation as long as it was correct proof.
I recommend you try an example from MATLAB examples on optimization. I'm quite certain it will work.Review your parameters
  1 件のコメント
Jonathan Pillow
Jonathan Pillow 2015 年 3 月 20 日
Sorry, Waleed. Matlab fails backward compatibility here. I have code with fmincon using Hessian that works for earlier releases, but now throws an error unless I add (as suggested by Aleksandar below) an extra pair of arguments to optimset.

サインインしてコメントする。


Matt J
Matt J 2015 年 2 月 24 日
Set the Hessian option to 'off' if you are not providing your own routine to compute the Hessian.
Or, leave the option as is and go ahead and provide the Hessian in the form required by whatever fmincon algorithm it is you are using, see Including Derivatives.

Alan Weiss
Alan Weiss 2015 年 2 月 24 日
This is happening because you are running a different algorithm than you expect. As stated in the R2014a release notes, the default fmincon algorithm changed from 'trust-region-reflective' to 'interior-point'. To choose the 'trust-region-reflective' algorithm, update your 'Algorithm' option.
Alan Weiss
MATLAB mathematical toolbox documentation

カテゴリ

Help Center および File ExchangeSolver Outputs and Iterative Display についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by