matlab fmincon _ nonlinear optimization
2 次查看(过去 30 天)
显示 更早的评论
Hi. I have been trying to resolve the following issues, but i cannot solve that.
Used thing : Nonlinear optimization
Used option is
options = optimoptions('fmincon',...
'StepTolerance',1e-10,'Hessian','lbfgs','Display','iter','Algorithm','sqp','Display','iter', 'MaxFunEvals',1e4,'MaxIter',1e4,'FiniteDifferenceType','central',...
'OptimalityTolerance',1e-6)
My question is
- the objection function value is not changed after certain time.
2. But the first order optimality isnot zero.
3. The lase thing is that (the exitflag = 2) is not good solution ? ( optimality is not zero )
Please check the fig as following.
In my objective function is unknown function. I just known input variable & output. becuase I am using the linearization mode.
So I can only use difference in gradient.
I try to all of thing that i can do, but i cannot solve the problem. Please give me good solution.
( I also using 'interior-point', 'sqp' etc).
Thanks for reading.
12 个评论
Bruno Luong
2019-10-14
编辑:Bruno Luong
2019-10-14
"You mean first optimality have to be considered both case?"
Yes. Condider this simple 2D example, where I minimize a x(1) on the circle x(1)^2+x(2)^2 = 1 using non-linear constraint:
[x,fval,exitflag,output] = fmincon(@fun,[0; 0],[],[],[],[],[],[],@mycon)
function f=fun(x)
f = x(1);
end
function [c,ceq]=mycon(x)
c = [];
ceq = sum(x.^2)-1;
end
The output of FMINCON is
output =
struct with fields:
iterations: 9
funcCount: 43
constrviolation: 5.1070e-14
stepsize: 2.1720e-07
algorithm: 'interior-point'
firstorderopt: 2.2352e-08
cgiterations: 4
message: '↵Local minimum found that satisfies the constraints.↵↵Optimization completed because the objective function is non-decreasing in ↵feasible directions, to within the value of the optimality tolerance,↵and constraints are satisfied to within the value of the constraint tolerance.↵↵<stopping criteria details>↵↵Optimization completed: The relative first-order optimality measure, 2.235174e-08,↵is less than options.OptimalityTolerance = 1.000000e-06, and the relative maximum constraint↵violation, 5.107026e-14, is less than options.ConstraintTolerance = 1.000000e-06.↵↵'
The first order reach 2.2352e-08 and trigger the stop of FMINCON (read the message) because the firstorder is rightly computed from the gradient of the Lagrangian.
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Nonlinear Optimization 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!