Discontinuous Objective Function - unable to use fmincon
4 次查看(过去 30 天)
显示 更早的评论
Related to a previous question I asked on Optimization with a vector of penalty functions
I need to minimise the objective function which is the sum of a series of quadratics [a unique set of coefficients for each x(i)]:
N = size(coeffLocal,1);
y = zeros(N,1);
xHat = zeros(size(x));
for i = 1:N
if x(i)
xHat(i) = (x(i)-muLocal(i,1))/muLocal(i,2);
y(i) = coeffLocal(i,1) * (xHat(i))^2 + coeffLocal(i,2) * xHat(i) + ...
coeffLocal(i,3);
end
end
f = sum(y);
This optimization is S.T. equality and inequality constraints within bounds.
I am using fmincon because I cannot cast my problem in a form suitable for quadprog.
My call to fmincon is
[tradeWeightsMC,fValMC,exitFlagMC,outputMC] = fmincon(@objFun,...
abs(WeightsLP),A,0,AEq,delta,lowerBounds,upperBounds);
where the weightsLP is the result of a prior linear programming step based on a fixed vector of costs/penalties which I improve upon with my new objective function.
It seems fmincon always returns the local minimum I supply as an initial starting point - in the example above it will return abs(WeightsLP) - but I can calculate a better solution myself. Giving fmincon this solution results in fmincon returning this!
I believe the cause to be that I have the condition that the only contributors to the value of my objective function are the non-zero terms in x - i.e. the
if x(i)
condition above as this will cause a discontinuity.
I have tried all suitable fmincon algorithms and all possibilities within the optimisation toolbox that I believe are relevant. Has anyone managed to solve a problem of this sort before?
I don't have access to the globaloptimization toolbox but even then sending multiple initial solutiuons to fmincon seems an unlikely solution as the problem is probably the discontinuity in my objective function.
I would be very grateful for any pointers.
Many thanks, Oliver
0 个评论
采纳的回答
Matt J
2017-10-12
If the constraints are separable into 1D constraints, then so is the optimization problem. The 1D problem, though discontinuous, is much easier to solve.
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Get Started with Optimization Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!