Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
Drexel University or The Math Forum.



Re: fmincon fixed costs
Posted:
May 10, 2013 8:01 AM


On 5/9/2013 4:55 PM, Nivi wrote: > 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
I do not understand the question. What is it you want us to do? Is there an error that MATLAB throws? Or is it something else?
Alan Weiss MATLAB mathematical toolbox documentation



