Discontinuous Objective Function - unable to use fmincon
3 ビュー (過去 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!