http://www.mathworks.com/matlabcentral/newsreader/view_thread/328898
MATLAB Central Newsreader  fmincon fixed costs
Feed for thread: fmincon fixed costs
enus
©19942014 by MathWorks, Inc.
webmaster@mathworks.com
MATLAB Central Newsreader
http://blogs.law.harvard.edu/tech/rss
60
MathWorks
http://www.mathworks.com/images/membrane_icon.gif

Thu, 09 May 2013 20:55:09 +0000
fmincon fixed costs
http://www.mathworks.com/matlabcentral/newsreader/view_thread/328898#904110
Nivi
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 <a href="http://www.mathworks.in/matlabcentral/newsreader/view_thread/314409">http://www.mathworks.in/matlabcentral/newsreader/view_thread/314409</a><br>
I shall attach my testing objective function to this mail. If you have some insight into this matter, please help me out.<br>
<br>
Thank You<br>
<br>
function y = simple_objective(x,C,c,nodes)<br>
y=0;<br>
k=1;<br>
for i = 1:nodes,<br>
for j = 1:nodes,<br>
if c(i,j) > 1<br>
if(c(i,j)> 0)<br>
y = y+ x(k)*C(i,j) + x(k)*x(k);<br>
end<br>
k = k+1;<br>
end<br>
end<br>
end<br>
% New links in full merger : 3 4 5 6 12 14 15 17<br>
% fixed costs on these : 50 25 40 30 25 10 30 20<br>
fc = zeros(1,18);<br>
fc(3)=50;<br>
fc(4)=25;<br>
fc(5)=40;<br>
fc(6)=30;<br>
fc(12)=25;<br>
fc(14)=10;<br>
fc(15)=30;<br>
fc(17)=20;<br>
fc2 = zeros(1,18);<br>
for i = 1:18,<br>
if x(i)> 0.0001<br>
if fc2(i)==0<br>
y = y+fc(i)*5;<br>
fc2(i)=1;<br>
end<br>
end <br>
end<br>
end

Fri, 10 May 2013 12:01:47 +0000
Re: fmincon fixed costs
http://www.mathworks.com/matlabcentral/newsreader/view_thread/328898#904138
Alan_Weiss
On 5/9/2013 4:55 PM, Nivi wrote:<br>
> I am using Matlab R2012a and I am trying to incorporate fixed costs in <br>
> establishing links in a supply chain. My objective function is very <br>
> similar to the one discussed in this thread <br>
> <a href="http://www.mathworks.in/matlabcentral/newsreader/view_thread/314409">http://www.mathworks.in/matlabcentral/newsreader/view_thread/314409</a><br>
> I shall attach my testing objective function to this mail. If you have <br>
> some insight into this matter, please help me out.<br>
><br>
> Thank You<br>
><br>
> function y = simple_objective(x,C,c,nodes)<br>
> y=0;<br>
> k=1;<br>
> for i = 1:nodes,<br>
> for j = 1:nodes,<br>
> if c(i,j) > 1<br>
> if(c(i,j)> 0)<br>
> y = y+ x(k)*C(i,j) + x(k)*x(k);<br>
> end<br>
> k = k+1;<br>
> end<br>
> end<br>
> end<br>
> % New links in full merger : 3 4 5 6 12 14 15 17<br>
> % fixed costs on these : 50 25 40 30 25 10 30 20<br>
> fc = zeros(1,18);<br>
> fc(3)=50;<br>
> fc(4)=25;<br>
> fc(5)=40;<br>
> fc(6)=30;<br>
> fc(12)=25;<br>
> fc(14)=10;<br>
> fc(15)=30;<br>
> fc(17)=20;<br>
> fc2 = zeros(1,18);<br>
> for i = 1:18,<br>
> if x(i)> 0.0001<br>
> if fc2(i)==0<br>
> y = y+fc(i)*5;<br>
> fc2(i)=1;<br>
> end<br>
> end end<br>
> end<br>
<br>
I do not understand the question. What is it you want us to do? Is there <br>
an error that MATLAB throws? Or is it something else?<br>
<br>
Alan Weiss<br>
MATLAB mathematical toolbox documentation

Fri, 10 May 2013 12:27:10 +0000
Re: fmincon fixed costs
http://www.mathworks.com/matlabcentral/newsreader/view_thread/328898#904140
Nivi
Alan_Weiss <aweiss@mathworks.com> wrote in message <kminjb$1ul$1@newscl01ah.mathworks.com>...<br>
> On 5/9/2013 4:55 PM, Nivi wrote:<br>
> > I am using Matlab R2012a and I am trying to incorporate fixed costs in <br>
> > establishing links in a sup<br>
<br>
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. <br>
I run the code and it doesn't converge... 20 long minute i waited and it wouldn't give me a solution<br>
<br>
<br>
If Fmincon can't help, is there any other alternative ?

Fri, 10 May 2013 12:50:11 +0000
Re: fmincon fixed costs
http://www.mathworks.com/matlabcentral/newsreader/view_thread/328898#904144
Torsten
"Nivi" wrote in message <kmip2u$6hg$1@newscl01ah.mathworks.com>...<br>
> Alan_Weiss <aweiss@mathworks.com> wrote in message <kminjb$1ul$1@newscl01ah.mathworks.com>...<br>
> > On 5/9/2013 4:55 PM, Nivi wrote:<br>
> > > I am using Matlab R2012a and I am trying to incorporate fixed costs in <br>
> > > establishing links in a sup<br>
> <br>
> 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. <br>
> I run the code and it doesn't converge... 20 long minute i waited and it wouldn't give me a solution<br>
> <br>
> <br>
> If Fmincon can't help, is there any other alternative ?<br>
<br>
Write out your problem in mathematical notation (not as MATLAB code).<br>
Maybe then somebody can give advice about suitable MATLAB routines for a solution.<br>
<br>
Best wishes<br>
Torsten.

Fri, 10 May 2013 14:06:07 +0000
Re: fmincon fixed costs
http://www.mathworks.com/matlabcentral/newsreader/view_thread/328898#904151
Nivi
so there's a supply chain.... products moving along certain pathways from manufacturers to the retailers. when two companies undergo a merger or an acquisition, the supply chain merges.... now i use fmincon to optimize the flow, find the most economical path the products should take, but during mergers new links are created, say from manufacturer of firm A to warehouse of firm B, now there are costs associated with establishing these new links, what i call fixed costs, and variable costs which is a function of the flow along that path/link. i've modelled variable costs and optimized my results, but i am unable to incorporate the fixed costs which must be 0 if there is no flow on the new link and nonzero if there is ANY flow on that link because sometimes there could be an optimal solution if one link is not established AT ALL and the flow which is supposed to be on that link is balanced <br>
on another

Fri, 10 May 2013 14:39:07 +0000
Re: fmincon fixed costs
http://www.mathworks.com/matlabcentral/newsreader/view_thread/328898#904153
Torsten
"Nivi" wrote in message <kmiusf$pbp$1@newscl01ah.mathworks.com>...<br>
> so there's a supply chain.... products moving along certain pathways from manufacturers to the retailers. when two companies undergo a merger or an acquisition, the supply chain merges.... now i use fmincon to optimize the flow, find the most economical path the products should take, but during mergers new links are created, say from manufacturer of firm A to warehouse of firm B, now there are costs associated with establishing these new links, what i call fixed costs, and variable costs which is a function of the flow along that path/link. i've modelled variable costs and optimized my results, but i am unable to incorporate the fixed costs which must be 0 if there is no flow on the new link and nonzero if there is ANY flow on that link because sometimes there could be an optimal solution if one link is not established AT ALL and the flow which is supposed to be on that link is <br>
balanced <br>
> on another <br>
<br>
I think whether a link is estabished or not must be accounted for by a binary variable<br>
(0 or 1). <br>
Thus your problem becomes a MINLP problem that you should not handle using fmincon. There are also no other MATLAB solvers available for this kind of problem.<br>
<br>
Best wishes<br>
Torsten.