Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: fmincon fixed costs
Replies: 5   Last Post: May 10, 2013 10:39 AM

 Messages: [ Previous | Next ]
 Alan Weiss Posts: 1,430 Registered: 11/27/08
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
> I shall attach my testing objective function to this mail. If you have
>
> 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

Date Subject Author
5/9/13 Nivi
5/10/13 Alan Weiss
5/10/13 Nivi
5/10/13 Torsten
5/10/13 Nivi
5/10/13 Torsten