Optimizing minimization with fmincon function

조회 수: 1 (최근 30일)
ektor
ektor 2019년 5월 25일
댓글: Sulaymon Eshkabilov 2019년 5월 26일
Dear all,
I have this function which I minimize:
g=randn(1000,1);
u=randn(1000,1);
y=randn(1000,1);
options = optimoptions('fmincon','Display','off');
f = @(x) sum( ( y-x(1)*g-u*x(2) ).^2 );
nonlcon = @unitdisk;
x = fmincon(f,[0.2 0.02],[],[],[],[],[],[],nonlcon,options);
where
function [c,ceq] = unitdisk(x)
c = - x(2) +0.01;
ceq = [];
Is there a faster way of doing this minimization?
Thanks in advance.

채택된 답변

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2019년 5월 25일
Hi,
By setting up the solver algorithm in the option settings, the simulation time cna be shortened substantially. E.g.
g=randn(1000,1);
u=randn(1000,1);
y=randn(1000,1);
options = optimoptions('fmincon','Display','off', 'Algorithm', 'active-set');
f = @(x) sum( ( y-x(1)*g-u*x(2) ).^2 );
nonlcon = @unitdisk;
x = fmincon(f,[0.2 0.02],[],[],[],[],[],[],nonlcon,options);
This algorithm shortens the computation time by about 50%. If you are not satisfied with this, you can investigate furthermore with the option settings for fmincon.
Good luck.
  댓글 수: 2
ektor
ektor 2019년 5월 25일
Indeed it is much faster now.
What should be the 'options' settings for the 'fminsearch'?
Could you give me an 'options' example for this function?
Sulaymon Eshkabilov
Sulaymon Eshkabilov 2019년 5월 26일
hi,
Again if you post your example, that would be good to answer specifically w.r.t your problem constraints.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Solver 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