Fmincon usage for fixed costs
Show older comments
I am using Matlab R2012a and I am trying to incorporate fixed costs in establishing links in a supply chain. My objective function is very similar to the one discussed in this thread http://www.mathworks.in/matlabcentral/newsreader/view_thread/314409 I shall attach my testing objective function to this mail. If you have some insight into this matter, please help me out.
Thank You
function y = simple_objective(x,C,c,nodes)
y=0;
k=1;
for i = 1:nodes,
for j = 1:nodes,
if c(i,j) > -1
if(c(i,j)> 0)
y = y+ x(k)*C(i,j) + x(k)*x(k);
end
k = k+1;
end
end
end
% New links in full merger : 3 4 5 6 12 14 15 17
% fixed costs on these : 50 25 40 30 25 10 30 20
fc = zeros(1,18);
fc(3)=50;
fc(4)=25;
fc(5)=40;
fc(6)=30;
fc(12)=25;
fc(14)=10;
fc(15)=30;
fc(17)=20;
fc2 = zeros(1,18);
for i = 1:18,
if x(i)> 0.0001
if fc2(i)==0
y = y+fc(i)*5;
fc2(i)=1;
end
end
end
end
The last part is what i want clarified.... The fixed cost must come into picture only if there is a flow on the respective new link If Fmincon can't help, is there any other alternative ?
Answers (0)
Categories
Find more on Physics in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!