fmincon is giving better results than ga for a nonlinear constrained optimization problem.

4 ビュー (過去 30 日間)
Nayan Rawat
Nayan Rawat 2019 年 7 月 12 日
編集済み: Matt J 2019 年 7 月 12 日
I used fmincon and ga for the same nonlinear constrained optimization (7-300 variables) but fmincon is giving much better results (all ceq<10^-8) while ga is not able to satisfy equality constraints. Help please.
Also: fmincon results vary with initial guess, step tolerance and constraint tolerance. What step tolerance and constraint tolerance should i choose?
  2 件のコメント
Matt J
Matt J 2019 年 7 月 12 日
What help is required? If fmincon responds better to the problem, why not just use that instead?
Nayan Rawat
Nayan Rawat 2019 年 7 月 12 日
Because fmincon result depends on initial guess. Changing the initial guess is changing the result while the ceq constraints are still very small(1e-8). This means that it may be a local minimum. I want to use other algorithms which give global minimum too (like ga, patternsearch etc).

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

回答 (1 件)

Star Strider
Star Strider 2019 年 7 月 12 日
The ga function produces its best results if you override the default population matrix with one of your own. I always use an options structure similar to:
PopSz = 500;
Parms = 6;
opts = optimoptions('ga', 'PopulationSize',PopSz, 'InitialPopulationMatrix',randi(1E+4,PopSz,Parms)*1E-3, 'MaxGenerations',2E3, 'PlotFcn',@gaplotbestf, 'PlotInterval',1);
where ‘PopSz’ is the size (dimension 1) of the population matrix, and ‘Parms’ (dimension 2) is the number of parameters to optimise. It takes a bit longer, however it almost always converges successfully, if a solution exists. I use randi to more efficiently control the range of the random matrix.
  3 件のコメント
Nayan Rawat
Nayan Rawat 2019 年 7 月 12 日
Thakks for the suggestion. I tried it but GA is not satisfying ceq even after taking 10 times more run time.
Nayan Rawat
Nayan Rawat 2019 年 7 月 12 日
Thanks, will try.

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

カテゴリ

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