Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

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


Math Forum » Discussions » Software » comp.soft-sys.matlab

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

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Alan Weiss

Posts: 1,268
Registered: 11/27/08
Re: fmincon fixed costs
Posted: May 10, 2013 8:01 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

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



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.