diff options
Diffstat (limited to 'help/en_US/scilab_en_US_help/cbcintlinprog.html')
-rw-r--r-- | help/en_US/scilab_en_US_help/cbcintlinprog.html | 240 |
1 files changed, 240 insertions, 0 deletions
diff --git a/help/en_US/scilab_en_US_help/cbcintlinprog.html b/help/en_US/scilab_en_US_help/cbcintlinprog.html new file mode 100644 index 0000000..3ee12ea --- /dev/null +++ b/help/en_US/scilab_en_US_help/cbcintlinprog.html @@ -0,0 +1,240 @@ +<html><head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> + <title>cbcintlinprog</title> + <style type="text/css" media="all"> + @import url("scilab_code.css"); + @import url("xml_code.css"); + @import url("c_code.css"); + @import url("style.css"); + </style> + </head> + <body> + <div class="manualnavbar"> + <table width="100%"><tr> + <td width="30%"> + <span class="previous"><a href="section_44e1f57c5225357b5fe53cb5fad967e9.html"><< FOSSEE Optimization Toolbox</a></span> + + </td> + <td width="40%" class="center"> + <span class="top"><a href="section_44e1f57c5225357b5fe53cb5fad967e9.html">FOSSEE Optimization Toolbox</a></span> + + </td> + <td width="30%" class="next"> + <span class="next"><a href="fgoalattain.html">fgoalattain >></a></span> + + </td> + </tr></table> + <hr /> + </div> + + + + <span class="path"><a href="index.html">FOSSEE Optimization Toolbox</a> >> <a href="section_44e1f57c5225357b5fe53cb5fad967e9.html">FOSSEE Optimization Toolbox</a> > cbcintlinprog</span> + + <br /><br /> + <div class="refnamediv"><h1 class="refname">cbcintlinprog</h1> + <p class="refpurpose">Solves a mixed integer linear programming constrained optimization problem in intlinprog format.</p></div> + + +<div class="refsynopsisdiv"><h3 class="title">Calling Sequence</h3> + <div class="synopsis"><pre><span class="default">xopt</span><span class="default"> = </span><span class="functionid">cbcintlinprog</span><span class="default">(</span><span class="default">c</span><span class="default">,</span><span class="default">intcon</span><span class="default">,</span><span class="default">A</span><span class="default">,</span><span class="default">b</span><span class="default">)</span> +<span class="default">xopt</span><span class="default"> = </span><span class="functionid">cbcintlinprog</span><span class="default">(</span><span class="default">c</span><span class="default">,</span><span class="default">intcon</span><span class="default">,</span><span class="default">A</span><span class="default">,</span><span class="default">b</span><span class="default">,</span><span class="default">Aeq</span><span class="default">,</span><span class="default">beq</span><span class="default">)</span> +<span class="default">xopt</span><span class="default"> = </span><span class="functionid">cbcintlinprog</span><span class="default">(</span><span class="default">c</span><span class="default">,</span><span class="default">intcon</span><span class="default">,</span><span class="default">A</span><span class="default">,</span><span class="default">b</span><span class="default">,</span><span class="default">Aeq</span><span class="default">,</span><span class="default">beq</span><span class="default">,</span><span class="default">lb</span><span class="default">,</span><span class="default">ub</span><span class="default">)</span> +<span class="default">xopt</span><span class="default"> = </span><span class="functionid">cbcintlinprog</span><span class="default">(</span><span class="default">c</span><span class="default">,</span><span class="default">intcon</span><span class="default">,</span><span class="default">A</span><span class="default">,</span><span class="default">b</span><span class="default">,</span><span class="default">Aeq</span><span class="default">,</span><span class="default">beq</span><span class="default">,</span><span class="default">lb</span><span class="default">,</span><span class="default">ub</span><span class="default">,</span><span class="default">options</span><span class="default">)</span> +<span class="default">xopt</span><span class="default"> = </span><span class="functionid">cbcintlinprog</span><span class="default">(</span>'<span class="default">path_to_mps_file</span>'<span class="default">)</span> +<span class="default">xopt</span><span class="default"> = </span><span class="functionid">cbcintlinprog</span><span class="default">(</span>'<span class="default">path_to_mps_file</span>'<span class="default">,</span><span class="default">options</span><span class="default">)</span> +<span class="default">[</span><span class="default">xopt</span><span class="default">,</span><span class="default">fopt</span><span class="default">,</span><span class="default">status</span><span class="default">,</span><span class="default">output</span><span class="default">] = </span><span class="functionid">cbcintlinprog</span><span class="default">( ... )</span></pre></div></div> + +<div class="refsection"><h3 class="title">Input Parameters</h3> + <dl><dt><span class="term">c :</span> + <dd><p class="para">a vector of double, contains coefficients of the variables in the objective</p></dd></dt> + <dt><span class="term">intcon :</span> + <dd><p class="para">Vector of integer constraints, specified as a vector of positive integers. The values in intcon indicate the components of the decision variable x that are integer-valued. intcon has values from 1 through number of variable.</p></dd></dt> + <dt><span class="term">A :</span> + <dd><p class="para">A matrix of doubles, containing the coefficients of linear inequality constraints of size (m X n) where 'm' is the number of linear inequality constraints.</p></dd></dt> + <dt><span class="term">b :</span> + <dd><p class="para">A vector of doubles, related to 'A' and containing the the Right hand side equation of the linear inequality constraints of size (m X 1).</p></dd></dt> + <dt><span class="term">Aeq :</span> + <dd><p class="para">A matrix of doubles, containing the coefficients of linear equality constraints of size (m1 X n) where 'm1' is the number of linear equality constraints.</p></dd></dt> + <dt><span class="term">beq :</span> + <dd><p class="para">A vector of doubles, related to 'Aeq' and containing the the Right hand side equation of the linear equality constraints of size (m1 X 1).</p></dd></dt> + <dt><span class="term">lb :</span> + <dd><p class="para">A vector of doubles, containing the lower bounds of the variables of size (1 X n) or (n X 1) where 'n' is the number of variables.</p></dd></dt> + <dt><span class="term">ub :</span> + <dd><p class="para">A vector of doubles, containing the upper bounds of the variables of size (1 X n) or (n X 1) where 'n' is the number of variables.</p></dd></dt> + <dt><span class="term">options :</span> + <dd><p class="para">A list, containing the option for user to specify. See below for details.</p></dd></dt></dl></div> +<div class="refsection"><h3 class="title">Outputs</h3> + <dl><dt><span class="term">xopt :</span> + <dd><p class="para">A vector of doubles, containing the computed solution of the optimization problem.</p></dd></dt> + <dt><span class="term">fopt :</span> + <dd><p class="para">A double, containing the the function value at x.</p></dd></dt> + <dt><span class="term">status :</span> + <dd><p class="para">An integer, containing the flag which denotes the reason for termination of algorithm. See below for details.</p></dd></dt> + <dt><span class="term">output :</span> + <dd><p class="para">A structure, containing the information about the optimization. See below for details.</p></dd></dt></dl></div> + +<div class="refsection"><h3 class="title">Description</h3> + <p class="para">Search the minimum or maximum of a constrained mixed integer linear programming optimization problem specified by :</p> + <p class="para"><span><img src='./_LaTeX_cbcintlinprog.xml_1.png' style='position:relative;top:51px;width:270px;height:110px'/></span></p> + <p class="para">CBC, an optimization library written in C++, is used for solving the linear programming problems.</p> +<p class="para"><h3 class="title">Options</h3> +The options allow the user to set various parameters of the Optimization problem. The syntax for the options is given by:</p> + <p class="para">options= list("IntegerTolerance", [---], "MaxNodes",[---], "MaxIter", [---], "AllowableGap",[---] "CpuTime", [---],"gradobj", "off", "hessian", "off" ); +<ul class="itemizedlist"><li>IntegerTolerance : A Scalar, a number with that value of an integer is considered integer.</li> +<li>MaxNodes : A Scalar, containing the maximum number of nodes that the solver should search.</li> +<li>MaxTime : A scalar, specifying the maximum amount of CPU Time in seconds that the solver should take.</li> +<li>AllowableGap : A scalar, that specifies the gap between the computed solution and the the objective value of the best known solution stop, at which the tree search can be stopped.</li></ul> + The default values for the various items are given as:</p> + <p class="para">options = list('integertolerance',1d-06,'maxnodes',2147483647,'cputime',1d10,'allowablegap')</p> +<p class="para">The exitflag allows the user to know the status of the optimization which is returned by OSI-CBC. The values it can take and what they indicate is described below: +<ul class="itemizedlist"><li>0 : Optimal Solution Found</li> +<li>1 : Converged to a point of primal infeasibility.</li> +<li>2 : Solution Limit is reached</li> +<li>3 : Node Limit is reached. Output may not be optimal.</li> +<li>4 : Numerical Difficulties.</li> +<li>5 : Maximum amount of CPU Time exceeded.</li> +<li>6 : Continuous Solution Unbounded.</li> +<li>7 : Converged to a point of dual infeasibility.</li></ul></p> + <p class="para">For more details on exitflag, see the Bonmin documentation which can be found on http://www.coin-or.org/Cbc</p> + <p class="para"></p></div> + +<p class="para">A few examples displaying the various functionalities of cbcintlinprog have been provided below. You will find a series of problems and the appropriate code snippets to solve them.</p> + +<div class="refsection"><h3 class="title">Example</h3> + <p class="para">Here we solve a simple objective function, subjected to three linear inequality constraints.</p> + <p class="para">Find x in R^8 such that it minimizes:</p> + <p class="para"><span><img src='./_LaTeX_cbcintlinprog.xml_2.png' style='position:relative;top:12px;width:646px;height:146px'/></span></p> + <div class="programlisting"><table border="0" width="100%"><tr><td width="98%"><pre class="scilabcode"><span class="scilabcomment">// Example 1:</span> +<span class="scilabcomment">// Reference: Westerberg, Carl-Henrik, Bengt Bjorklund, and Eskil Hultman. </span><span class="scilabcomment">"</span><span class="scilabcomment">An application of mixed integer</span> +<span class="scilabcomment">// programming in a Swedish steel mill.</span><span class="scilabcomment">"</span><span class="scilabcomment"> Interfaces 7, no. 2 (1977): 39-43. Modified acc. to requirements.</span> +<span class="scilabid">c</span> <span class="scilaboperator">=</span> <span class="scilabopenclose">[</span><span class="scilabnumber">350</span><span class="scilaboperator">*</span><span class="scilabnumber">5</span><span class="scilabdefault">,</span><span class="scilabnumber">330</span><span class="scilaboperator">*</span><span class="scilabnumber">3</span><span class="scilabdefault">,</span><span class="scilabnumber">310</span><span class="scilaboperator">*</span><span class="scilabnumber">4</span><span class="scilabdefault">,</span><span class="scilabnumber">280</span><span class="scilaboperator">*</span><span class="scilabnumber">6</span><span class="scilabdefault">,</span><span class="scilabnumber">500</span><span class="scilabdefault">,</span><span class="scilabnumber">450</span><span class="scilabdefault">,</span><span class="scilabnumber">400</span><span class="scilabdefault">,</span><span class="scilabnumber">100</span><span class="scilabopenclose">]</span><span class="scilaboperator">'</span><span class="scilabdefault">;</span> +<span class="scilabid">A</span> <span class="scilaboperator">=</span> <span class="scilabopenclose">[</span><span class="scilabnumber">6</span><span class="scilabdefault">,</span><span class="scilabnumber">4.25</span><span class="scilabdefault">,</span> <span class="scilabnumber">5.5</span><span class="scilabdefault">,</span> <span class="scilabnumber">7.75</span><span class="scilabdefault">,</span> <span class="scilabnumber">3</span><span class="scilabdefault">,</span> <span class="scilabnumber">3.25</span><span class="scilabdefault">,</span> <span class="scilabnumber">3.5</span><span class="scilabdefault">,</span><span class="scilabnumber">3.75</span><span class="scilabdefault">;</span> + <span class="scilabnumber">1.25</span><span class="scilabdefault">,</span><span class="scilabnumber">1.37</span><span class="scilabdefault">,</span><span class="scilabnumber">1.7</span><span class="scilabdefault">,</span><span class="scilabnumber">1.93</span><span class="scilabdefault">,</span><span class="scilabnumber">2.08</span><span class="scilabdefault">,</span><span class="scilabnumber">2.32</span><span class="scilabdefault">,</span><span class="scilabnumber">2.56</span><span class="scilabdefault">,</span><span class="scilabnumber">2.78</span><span class="scilabdefault">;</span> + <span class="scilabnumber">1.15</span><span class="scilabdefault">,</span><span class="scilabnumber">1.34</span><span class="scilabdefault">,</span><span class="scilabnumber">1.66</span><span class="scilabdefault">,</span><span class="scilabnumber">1.99</span><span class="scilabdefault">,</span><span class="scilabnumber">2.06</span><span class="scilabdefault">,</span><span class="scilabnumber">2.32</span><span class="scilabdefault">,</span><span class="scilabnumber">2.58</span><span class="scilabdefault">,</span><span class="scilabnumber">2.84</span> <span class="scilabopenclose">]</span><span class="scilabdefault">;</span> +<span class="scilabid">b</span> <span class="scilaboperator">=</span> <span class="scilabopenclose">[</span><span class="scilabnumber">100</span> <span class="scilabdefault">,</span><span class="scilabnumber">205</span><span class="scilabdefault">,</span> <span class="scilabnumber">249</span> <span class="scilabopenclose">]</span><span class="scilabdefault">;</span> +<span class="scilabcomment">//Defining the integer constraints</span> +<span class="scilabid">intcon</span> <span class="scilaboperator">=</span> <span class="scilabopenclose">[</span><span class="scilabnumber">1</span> <span class="scilabnumber">2</span> <span class="scilabnumber">3</span> <span class="scilabnumber">4</span><span class="scilabopenclose">]</span><span class="scilabdefault">;</span> +<span class="scilabcomment">// Calling Symphony</span> +<span class="scilabopenclose">[</span><span class="scilabid">x</span><span class="scilabdefault">,</span><span class="scilabid">f</span><span class="scilabdefault">,</span><span class="scilabid">status</span><span class="scilabdefault">,</span><span class="scilabid">output</span><span class="scilabopenclose">]</span> <span class="scilaboperator">=</span> <span class="scilabid">cbcintlinprog</span><span class="scilabopenclose">(</span><span class="scilabid">c</span><span class="scilabdefault">,</span><span class="scilabid">intcon</span><span class="scilabdefault">,</span><span class="scilabid">A</span><span class="scilabdefault">,</span><span class="scilabid">b</span><span class="scilabopenclose">)</span> +<span class="scilabcomment">// Press ENTER to continue</span></pre></td><td valign="top"><a href="scilab://scilab.execexample/"><img src="ScilabExecute.png" border="0"/></a></td><td valign="top"><a href="scilab://scilab.editexample/"><img src="ScilabEdit.png" border="0"/></a></td><td></td></tr></table></div></div> + +<div class="refsection"><h3 class="title">Example</h3> + <p class="para">Here we build up on the previous example by adding upper and lower bounds to the variables. +We add the following bounds to the problem specified above:</p> + <p class="para"><span><img src='./_LaTeX_cbcintlinprog.xml_3.png' style='position:relative;top:76px;width:125px;height:160px'/></span></p> + <div class="programlisting"><table border="0" width="100%"><tr><td width="98%"><pre class="scilabcode"><span class="scilabcomment">// Example 2:</span> +<span class="scilabcomment">// Reference: Westerberg, Carl-Henrik, Bengt Bjorklund, and Eskil Hultman. </span><span class="scilabcomment">"</span><span class="scilabcomment">An application of mixed integer</span> +<span class="scilabcomment">// programming in a Swedish steel mill.</span><span class="scilabcomment">"</span><span class="scilabcomment"> Interfaces 7, no. 2 (1977): 39-43. Modified acc. to requirements.</span> + <span class="scilabid">c</span> <span class="scilaboperator">=</span> <span class="scilabopenclose">[</span><span class="scilabnumber">350</span><span class="scilaboperator">*</span><span class="scilabnumber">5</span><span class="scilabdefault">,</span><span class="scilabnumber">330</span><span class="scilaboperator">*</span><span class="scilabnumber">3</span><span class="scilabdefault">,</span><span class="scilabnumber">310</span><span class="scilaboperator">*</span><span class="scilabnumber">4</span><span class="scilabdefault">,</span><span class="scilabnumber">280</span><span class="scilaboperator">*</span><span class="scilabnumber">6</span><span class="scilabdefault">,</span><span class="scilabnumber">500</span><span class="scilabdefault">,</span><span class="scilabnumber">450</span><span class="scilabdefault">,</span><span class="scilabnumber">400</span><span class="scilabdefault">,</span><span class="scilabnumber">100</span><span class="scilabopenclose">]</span><span class="scilaboperator">'</span><span class="scilabdefault">;</span> + <span class="scilabcomment">//Inequality constraints</span> + <span class="scilabid">A</span> <span class="scilaboperator">=</span> <span class="scilabopenclose">[</span><span class="scilabnumber">6</span><span class="scilabdefault">,</span><span class="scilabnumber">4.25</span><span class="scilabdefault">,</span> <span class="scilabnumber">5.5</span><span class="scilabdefault">,</span> <span class="scilabnumber">7.75</span><span class="scilabdefault">,</span> <span class="scilabnumber">3</span><span class="scilabdefault">,</span> <span class="scilabnumber">3.25</span><span class="scilabdefault">,</span> <span class="scilabnumber">3.5</span><span class="scilabdefault">,</span><span class="scilabnumber">3.75</span><span class="scilabdefault">;</span> + <span class="scilabnumber">1.25</span><span class="scilabdefault">,</span><span class="scilabnumber">1.37</span><span class="scilabdefault">,</span><span class="scilabnumber">1.7</span><span class="scilabdefault">,</span><span class="scilabnumber">1.93</span><span class="scilabdefault">,</span><span class="scilabnumber">2.08</span><span class="scilabdefault">,</span><span class="scilabnumber">2.32</span><span class="scilabdefault">,</span><span class="scilabnumber">2.56</span><span class="scilabdefault">,</span><span class="scilabnumber">2.78</span><span class="scilabdefault">;</span> + <span class="scilabnumber">1.15</span><span class="scilabdefault">,</span><span class="scilabnumber">1.34</span><span class="scilabdefault">,</span><span class="scilabnumber">1.66</span><span class="scilabdefault">,</span><span class="scilabnumber">1.99</span><span class="scilabdefault">,</span><span class="scilabnumber">2.06</span><span class="scilabdefault">,</span><span class="scilabnumber">2.32</span><span class="scilabdefault">,</span><span class="scilabnumber">2.58</span><span class="scilabdefault">,</span><span class="scilabnumber">2.84</span> <span class="scilabopenclose">]</span><span class="scilabdefault">;</span> + <span class="scilabid">b</span> <span class="scilaboperator">=</span> <span class="scilabopenclose">[</span><span class="scilabnumber">100</span> <span class="scilabdefault">,</span><span class="scilabnumber">205</span><span class="scilabdefault">,</span> <span class="scilabnumber">249</span> <span class="scilabopenclose">]</span><span class="scilabdefault">;</span> + + <span class="scilabcomment">// Lower Bound of variable</span> +<span class="scilabid">lb</span> <span class="scilaboperator">=</span> <a class="scilabmacro" href="scilab://repmat">repmat</a><span class="scilabopenclose">(</span><span class="scilabnumber">0</span><span class="scilabdefault">,</span><span class="scilabnumber">1</span><span class="scilabdefault">,</span><span class="scilabnumber">8</span><span class="scilabopenclose">)</span><span class="scilabdefault">;</span> +<span class="scilabcomment">// Upper Bound of variables</span> +<span class="scilabid">ub</span> <span class="scilaboperator">=</span> <span class="scilabopenclose">[</span><a class="scilabmacro" href="scilab://repmat">repmat</a><span class="scilabopenclose">(</span><span class="scilabnumber">1</span><span class="scilabdefault">,</span><span class="scilabnumber">1</span><span class="scilabdefault">,</span><span class="scilabnumber">4</span><span class="scilabopenclose">)</span> <a class="scilabmacro" href="scilab://repmat">repmat</a><span class="scilabopenclose">(</span><span class="scilabconstants">%inf</span><span class="scilabdefault">,</span><span class="scilabnumber">1</span><span class="scilabdefault">,</span><span class="scilabnumber">4</span><span class="scilabopenclose">)</span><span class="scilabopenclose">]</span><span class="scilabdefault">;</span> + <span class="scilabcomment">//Integer Constraints</span> + <span class="scilabid">intcon</span> <span class="scilaboperator">=</span> <span class="scilabopenclose">[</span><span class="scilabnumber">1</span> <span class="scilabnumber">2</span> <span class="scilabnumber">3</span> <span class="scilabnumber">4</span><span class="scilabopenclose">]</span><span class="scilabdefault">;</span> + <span class="scilabcomment">// Calling Symphony</span> + <span class="scilabopenclose">[</span><span class="scilabid">x</span><span class="scilabdefault">,</span><span class="scilabid">f</span><span class="scilabdefault">,</span><span class="scilabid">status</span><span class="scilabdefault">,</span><span class="scilabid">output</span><span class="scilabopenclose">]</span> <span class="scilaboperator">=</span> <span class="scilabid">cbcintlinprog</span><span class="scilabopenclose">(</span><span class="scilabid">c</span><span class="scilabdefault">,</span><span class="scilabid">intcon</span><span class="scilabdefault">,</span><span class="scilabid">A</span><span class="scilabdefault">,</span><span class="scilabid">b</span><span class="scilabdefault">,</span><span class="scilabopenclose">[</span><span class="scilabopenclose">]</span><span class="scilabdefault">,</span><span class="scilabopenclose">[</span><span class="scilabopenclose">]</span><span class="scilabdefault">,</span><span class="scilabid">lb</span><span class="scilabdefault">,</span><span class="scilabid">ub</span><span class="scilabopenclose">)</span> +<span class="scilabcomment">// Press ENTER to continue</span></pre></td><td valign="top"><a href="scilab://scilab.execexample/"><img src="ScilabExecute.png" border="0"/></a></td><td valign="top"><a href="scilab://scilab.editexample/"><img src="ScilabEdit.png" border="0"/></a></td><td></td></tr></table></div></div> + +<div class="refsection"><h3 class="title">Example</h3> + <p class="para">In this example, we proceed to add the linear equality constraints to the objective function.</p> + + <p class="para"><span><img src='./_LaTeX_cbcintlinprog.xml_4.png' style='position:relative;top:27px;width:580px;height:62px'/></span></p> + <div class="programlisting"><table border="0" width="100%"><tr><td width="98%"><pre class="scilabcode"><span class="scilabcomment">// Example 3:</span> +<span class="scilabcomment">// Reference: Westerberg, Carl-Henrik, Bengt Bjorklund, and Eskil Hultman. </span><span class="scilabcomment">"</span><span class="scilabcomment">An application of mixed integer</span> +<span class="scilabcomment">// programming in a Swedish steel mill.</span><span class="scilabcomment">"</span><span class="scilabcomment"> Interfaces 7, no. 2 (1977): 39-43. Modified acc. to requirements.</span> +<span class="scilabid">c</span> <span class="scilaboperator">=</span> <span class="scilabopenclose">[</span><span class="scilabnumber">350</span><span class="scilaboperator">*</span><span class="scilabnumber">5</span><span class="scilabdefault">,</span><span class="scilabnumber">330</span><span class="scilaboperator">*</span><span class="scilabnumber">3</span><span class="scilabdefault">,</span><span class="scilabnumber">310</span><span class="scilaboperator">*</span><span class="scilabnumber">4</span><span class="scilabdefault">,</span><span class="scilabnumber">280</span><span class="scilaboperator">*</span><span class="scilabnumber">6</span><span class="scilabdefault">,</span><span class="scilabnumber">500</span><span class="scilabdefault">,</span><span class="scilabnumber">450</span><span class="scilabdefault">,</span><span class="scilabnumber">400</span><span class="scilabdefault">,</span><span class="scilabnumber">100</span><span class="scilabopenclose">]</span><span class="scilaboperator">'</span><span class="scilabdefault">;</span> +<span class="scilabcomment">//Inequality constraints</span> +<span class="scilabid">A</span> <span class="scilaboperator">=</span> <span class="scilabopenclose">[</span><span class="scilabnumber">6</span><span class="scilabdefault">,</span><span class="scilabnumber">4.25</span><span class="scilabdefault">,</span> <span class="scilabnumber">5.5</span><span class="scilabdefault">,</span> <span class="scilabnumber">7.75</span><span class="scilabdefault">,</span> <span class="scilabnumber">3</span><span class="scilabdefault">,</span> <span class="scilabnumber">3.25</span><span class="scilabdefault">,</span> <span class="scilabnumber">3.5</span><span class="scilabdefault">,</span><span class="scilabnumber">3.75</span><span class="scilabdefault">;</span> + <span class="scilabnumber">1.25</span><span class="scilabdefault">,</span><span class="scilabnumber">1.37</span><span class="scilabdefault">,</span><span class="scilabnumber">1.7</span><span class="scilabdefault">,</span><span class="scilabnumber">1.93</span><span class="scilabdefault">,</span><span class="scilabnumber">2.08</span><span class="scilabdefault">,</span><span class="scilabnumber">2.32</span><span class="scilabdefault">,</span><span class="scilabnumber">2.56</span><span class="scilabdefault">,</span><span class="scilabnumber">2.78</span><span class="scilabdefault">;</span> + <span class="scilabnumber">1.15</span><span class="scilabdefault">,</span><span class="scilabnumber">1.34</span><span class="scilabdefault">,</span><span class="scilabnumber">1.66</span><span class="scilabdefault">,</span><span class="scilabnumber">1.99</span><span class="scilabdefault">,</span><span class="scilabnumber">2.06</span><span class="scilabdefault">,</span><span class="scilabnumber">2.32</span><span class="scilabdefault">,</span><span class="scilabnumber">2.58</span><span class="scilabdefault">,</span><span class="scilabnumber">2.84</span> <span class="scilabopenclose">]</span><span class="scilabdefault">;</span> +<span class="scilabid">b</span> <span class="scilaboperator">=</span> <span class="scilabopenclose">[</span><span class="scilabnumber">100</span> <span class="scilabdefault">,</span><span class="scilabnumber">205</span><span class="scilabdefault">,</span> <span class="scilabnumber">249</span> <span class="scilabopenclose">]</span><span class="scilabdefault">;</span> +<span class="scilabcomment">// Lower Bound of variable</span> +<span class="scilabid">lb</span> <span class="scilaboperator">=</span> <a class="scilabmacro" href="scilab://repmat">repmat</a><span class="scilabopenclose">(</span><span class="scilabnumber">0</span><span class="scilabdefault">,</span><span class="scilabnumber">1</span><span class="scilabdefault">,</span><span class="scilabnumber">8</span><span class="scilabopenclose">)</span><span class="scilabdefault">;</span> +<span class="scilabcomment">// Upper Bound of variables</span> +<span class="scilabid">ub</span> <span class="scilaboperator">=</span> <span class="scilabopenclose">[</span><a class="scilabmacro" href="scilab://repmat">repmat</a><span class="scilabopenclose">(</span><span class="scilabnumber">1</span><span class="scilabdefault">,</span><span class="scilabnumber">1</span><span class="scilabdefault">,</span><span class="scilabnumber">4</span><span class="scilabopenclose">)</span> <a class="scilabmacro" href="scilab://repmat">repmat</a><span class="scilabopenclose">(</span><span class="scilabconstants">%inf</span><span class="scilabdefault">,</span><span class="scilabnumber">1</span><span class="scilabdefault">,</span><span class="scilabnumber">4</span><span class="scilabopenclose">)</span><span class="scilabopenclose">]</span><span class="scilabdefault">;</span> +<span class="scilabcomment">// Equality Constraints</span> +<span class="scilabid">Aeq</span> <span class="scilaboperator">=</span> <span class="scilabopenclose">[</span><span class="scilabnumber">5</span><span class="scilabdefault">,</span><span class="scilabnumber">3</span><span class="scilabdefault">,</span><span class="scilabnumber">4</span><span class="scilabdefault">,</span><span class="scilabnumber">6</span><span class="scilabdefault">,</span><span class="scilabnumber">1</span><span class="scilabdefault">,</span><span class="scilabnumber">1</span><span class="scilabdefault">,</span><span class="scilabnumber">1</span><span class="scilabdefault">,</span><span class="scilabnumber">1</span><span class="scilabdefault">;</span> +<span class="scilabnumber">5</span><span class="scilaboperator">*</span><span class="scilabnumber">0.05</span><span class="scilabdefault">,</span><span class="scilabnumber">3</span><span class="scilaboperator">*</span><span class="scilabnumber">0.04</span><span class="scilabdefault">,</span><span class="scilabnumber">4</span><span class="scilaboperator">*</span><span class="scilabnumber">0.05</span><span class="scilabdefault">,</span><span class="scilabnumber">6</span><span class="scilaboperator">*</span><span class="scilabnumber">0.03</span><span class="scilabdefault">,</span><span class="scilabnumber">0.08</span><span class="scilabdefault">,</span><span class="scilabnumber">0.07</span><span class="scilabdefault">,</span><span class="scilabnumber">0.06</span><span class="scilabdefault">,</span><span class="scilabnumber">0.03</span><span class="scilabdefault">;</span> +<span class="scilabnumber">5</span><span class="scilaboperator">*</span><span class="scilabnumber">0.03</span><span class="scilabdefault">,</span><span class="scilabnumber">3</span><span class="scilaboperator">*</span><span class="scilabnumber">0.03</span><span class="scilabdefault">,</span><span class="scilabnumber">4</span><span class="scilaboperator">*</span><span class="scilabnumber">0.04</span><span class="scilabdefault">,</span><span class="scilabnumber">6</span><span class="scilaboperator">*</span><span class="scilabnumber">0.04</span><span class="scilabdefault">,</span><span class="scilabnumber">0.06</span><span class="scilabdefault">,</span><span class="scilabnumber">0.07</span><span class="scilabdefault">,</span><span class="scilabnumber">0.08</span><span class="scilabdefault">,</span><span class="scilabnumber">0.09</span><span class="scilabdefault">;</span><span class="scilabopenclose">]</span> +<span class="scilabid">beq</span> <span class="scilaboperator">=</span> <span class="scilabopenclose">[</span> <span class="scilabnumber">25</span><span class="scilabdefault">,</span> <span class="scilabnumber">1.25</span><span class="scilabdefault">,</span> <span class="scilabnumber">1.25</span><span class="scilabopenclose">]</span><span class="scilabdefault">;</span> + <span class="scilabcomment">//Integer Constraints</span> +<span class="scilabid">intcon</span> <span class="scilaboperator">=</span> <span class="scilabopenclose">[</span><span class="scilabnumber">1</span> <span class="scilabnumber">2</span> <span class="scilabnumber">3</span> <span class="scilabnumber">4</span><span class="scilabopenclose">]</span><span class="scilabdefault">;</span> +<span class="scilabcomment">// Calling CBC</span> +<span class="scilabopenclose">[</span><span class="scilabid">x</span><span class="scilabdefault">,</span><span class="scilabid">f</span><span class="scilabdefault">,</span><span class="scilabid">status</span><span class="scilabdefault">,</span><span class="scilabid">output</span><span class="scilabopenclose">]</span> <span class="scilaboperator">=</span> <span class="scilabid">cbcintlinprog</span><span class="scilabopenclose">(</span><span class="scilabid">c</span><span class="scilabdefault">,</span><span class="scilabid">intcon</span><span class="scilabdefault">,</span><span class="scilabid">A</span><span class="scilabdefault">,</span><span class="scilabid">b</span><span class="scilabdefault">,</span><span class="scilabid">Aeq</span><span class="scilabdefault">,</span><span class="scilabid">beq</span><span class="scilabdefault">,</span><span class="scilabid">lb</span><span class="scilabdefault">,</span><span class="scilabid">ub</span><span class="scilabopenclose">)</span> +<span class="scilabcomment">// Press ENTER to continue</span></pre></td><td valign="top"><a href="scilab://scilab.execexample/"><img src="ScilabExecute.png" border="0"/></a></td><td valign="top"><a href="scilab://scilab.editexample/"><img src="ScilabEdit.png" border="0"/></a></td><td></td></tr></table></div></div> + +<div class="refsection"><h3 class="title">Example</h3> + <p class="para">Primal Infeasible Problems: Find x in R^8 such that it minimizes:</p> + <p class="para">Find x in R^8 such that it minimizes:</p> + <p class="para"><span><img src='./_LaTeX_cbcintlinprog.xml_5.png' style='position:relative;top:12px;width:666px;height:146px'/></span></p> + <div class="programlisting"><table border="0" width="100%"><tr><td width="98%"><pre class="scilabcode"><span class="scilabcomment">// Example 4:</span> +<span class="scilabcomment">// Reference: Westerberg, Carl-Henrik, Bengt Bjorklund, and Eskil Hultman. </span><span class="scilabcomment">"</span><span class="scilabcomment">An application of mixed integer </span> +<span class="scilabcomment">// programming in a Swedish steel mill.</span><span class="scilabcomment">"</span><span class="scilabcomment"> Interfaces 7, no. 2 (1977): 39-43. Modified acc. to requirements.</span> +<span class="scilabid">c</span> <span class="scilaboperator">=</span> <span class="scilabopenclose">[</span><span class="scilabnumber">350</span><span class="scilaboperator">*</span><span class="scilabnumber">5</span><span class="scilabdefault">,</span><span class="scilabnumber">330</span><span class="scilaboperator">*</span><span class="scilabnumber">3</span><span class="scilabdefault">,</span><span class="scilabnumber">310</span><span class="scilaboperator">*</span><span class="scilabnumber">4</span><span class="scilabdefault">,</span><span class="scilabnumber">280</span><span class="scilaboperator">*</span><span class="scilabnumber">6</span><span class="scilabdefault">,</span><span class="scilabnumber">500</span><span class="scilabdefault">,</span><span class="scilabnumber">450</span><span class="scilabdefault">,</span><span class="scilabnumber">400</span><span class="scilabdefault">,</span><span class="scilabnumber">100</span><span class="scilabopenclose">]</span><span class="scilaboperator">'</span><span class="scilabdefault">;</span> +<span class="scilabcomment">//Inequality constraints </span> +<span class="scilabid">A</span> <span class="scilaboperator">=</span> <span class="scilabopenclose">[</span><span class="scilabnumber">6</span><span class="scilabdefault">,</span><span class="scilabnumber">4.25</span><span class="scilabdefault">,</span> <span class="scilabnumber">5.5</span><span class="scilabdefault">,</span> <span class="scilabnumber">7.75</span><span class="scilabdefault">,</span> <span class="scilabnumber">3</span><span class="scilabdefault">,</span> <span class="scilabnumber">3.25</span><span class="scilabdefault">,</span> <span class="scilabnumber">3.5</span><span class="scilabdefault">,</span><span class="scilabnumber">3.75</span><span class="scilabdefault">;</span> + <span class="scilabnumber">1.25</span><span class="scilabdefault">,</span><span class="scilabnumber">1.37</span><span class="scilabdefault">,</span><span class="scilabnumber">1.7</span><span class="scilabdefault">,</span><span class="scilabnumber">1.93</span><span class="scilabdefault">,</span><span class="scilabnumber">2.08</span><span class="scilabdefault">,</span><span class="scilabnumber">2.32</span><span class="scilabdefault">,</span><span class="scilabnumber">2.56</span><span class="scilabdefault">,</span><span class="scilabnumber">2.78</span><span class="scilabdefault">;</span> + <span class="scilabnumber">1.15</span><span class="scilabdefault">,</span><span class="scilabnumber">1.34</span><span class="scilabdefault">,</span><span class="scilabnumber">1.66</span><span class="scilabdefault">,</span><span class="scilabnumber">1.99</span><span class="scilabdefault">,</span><span class="scilabnumber">2.06</span><span class="scilabdefault">,</span><span class="scilabnumber">2.32</span><span class="scilabdefault">,</span><span class="scilabnumber">2.58</span><span class="scilabdefault">,</span><span class="scilabnumber">2.84</span> <span class="scilabopenclose">]</span><span class="scilabdefault">;</span> +<span class="scilabid">b</span> <span class="scilaboperator">=</span> <span class="scilabopenclose">[</span><span class="scilabnumber">26.333</span> <span class="scilabdefault">,</span><span class="scilabnumber">3.916</span> <span class="scilabdefault">,</span><span class="scilabnumber">5.249</span> <span class="scilabopenclose">]</span><span class="scilabdefault">;</span> + <span class="scilabcomment">//Integer Constraints</span> +<span class="scilabid">intcon</span> <span class="scilaboperator">=</span> <span class="scilabopenclose">[</span><span class="scilabnumber">1</span> <span class="scilabnumber">2</span> <span class="scilabnumber">3</span> <span class="scilabnumber">4</span><span class="scilabopenclose">]</span><span class="scilabdefault">;</span> + +<span class="scilabcomment">// Calling CBC</span> + +<span class="scilabopenclose">[</span><span class="scilabid">x</span><span class="scilabdefault">,</span><span class="scilabid">f</span><span class="scilabdefault">,</span><span class="scilabid">status</span><span class="scilabdefault">,</span><span class="scilabid">output</span><span class="scilabopenclose">]</span> <span class="scilaboperator">=</span> <span class="scilabid">cbcintlinprog</span><span class="scilabopenclose">(</span><span class="scilabid">c</span><span class="scilabdefault">,</span><span class="scilabid">intcon</span><span class="scilabdefault">,</span><span class="scilabid">A</span><span class="scilabdefault">,</span><span class="scilabid">b</span><span class="scilabopenclose">)</span> +<span class="scilabcomment">// Press ENTER to continue</span></pre></td><td valign="top"><a href="scilab://scilab.execexample/"><img src="ScilabExecute.png" border="0"/></a></td><td valign="top"><a href="scilab://scilab.editexample/"><img src="ScilabEdit.png" border="0"/></a></td><td></td></tr></table></div></div> + +<div class="refsection"><h3 class="title">Example</h3> + <p class="para">Unbounded Problems. Find x in R^8 such that it minimizes:</p> + <p class="para"><span><img src='./_LaTeX_cbcintlinprog.xml_6.png' style='position:relative;top:12px;width:650px;height:146px'/></span></p> + <div class="programlisting"><table border="0" width="100%"><tr><td width="98%"><pre class="scilabcode"><span class="scilabcomment">// Example 5:</span> +<span class="scilabcomment">// Reference: Westerberg, Carl-Henrik, Bengt Bjorklund, and Eskil Hultman. </span><span class="scilabcomment">"</span><span class="scilabcomment">An application of mixed integer</span> +<span class="scilabcomment">// programming in a Swedish steel mill.</span><span class="scilabcomment">"</span><span class="scilabcomment"> Interfaces 7, no. 2 (1977): 39-43. Modified acc. to requirements.</span> +<span class="scilabid">c</span> <span class="scilaboperator">=</span> <span class="scilabopenclose">[</span><span class="scilabnumber">350</span><span class="scilaboperator">*</span><span class="scilabnumber">5</span><span class="scilabdefault">,</span><span class="scilabnumber">330</span><span class="scilaboperator">*</span><span class="scilabnumber">3</span><span class="scilabdefault">,</span><span class="scilabnumber">310</span><span class="scilaboperator">*</span><span class="scilabnumber">4</span><span class="scilabdefault">,</span><span class="scilabnumber">280</span><span class="scilaboperator">*</span><span class="scilabnumber">6</span><span class="scilabdefault">,</span><span class="scilabnumber">500</span><span class="scilabdefault">,</span><span class="scilabnumber">450</span><span class="scilabdefault">,</span><span class="scilabnumber">400</span><span class="scilabdefault">,</span><span class="scilabnumber">100</span><span class="scilabopenclose">]</span><span class="scilaboperator">'</span><span class="scilabdefault">;</span> +<span class="scilabcomment">//Inequality constraints</span> +<span class="scilabid">A</span> <span class="scilaboperator">=</span> <span class="scilabopenclose">[</span><span class="scilabopenclose">]</span><span class="scilabdefault">;</span> +<span class="scilabid">b</span> <span class="scilaboperator">=</span> <span class="scilabopenclose">[</span><span class="scilabopenclose">]</span><span class="scilabdefault">;</span> +<span class="scilabcomment">// Equality Constraints</span> +<span class="scilabid">Aeq</span> <span class="scilaboperator">=</span> <span class="scilabopenclose">[</span><span class="scilabnumber">5</span><span class="scilabdefault">,</span><span class="scilabnumber">3</span><span class="scilabdefault">,</span><span class="scilabnumber">4</span><span class="scilabdefault">,</span><span class="scilabnumber">6</span><span class="scilabdefault">,</span><span class="scilabnumber">1</span><span class="scilabdefault">,</span><span class="scilabnumber">1</span><span class="scilabdefault">,</span><span class="scilabnumber">1</span><span class="scilabdefault">,</span><span class="scilabnumber">1</span><span class="scilabdefault">;</span> +<span class="scilabnumber">5</span><span class="scilaboperator">*</span><span class="scilabnumber">0.05</span><span class="scilabdefault">,</span><span class="scilabnumber">3</span><span class="scilaboperator">*</span><span class="scilabnumber">0.04</span><span class="scilabdefault">,</span><span class="scilabnumber">4</span><span class="scilaboperator">*</span><span class="scilabnumber">0.05</span><span class="scilabdefault">,</span><span class="scilabnumber">6</span><span class="scilaboperator">*</span><span class="scilabnumber">0.03</span><span class="scilabdefault">,</span><span class="scilabnumber">0.08</span><span class="scilabdefault">,</span><span class="scilabnumber">0.07</span><span class="scilabdefault">,</span><span class="scilabnumber">0.06</span><span class="scilabdefault">,</span><span class="scilabnumber">0.03</span><span class="scilabdefault">;</span> +<span class="scilabnumber">5</span><span class="scilaboperator">*</span><span class="scilabnumber">0.03</span><span class="scilabdefault">,</span><span class="scilabnumber">3</span><span class="scilaboperator">*</span><span class="scilabnumber">0.03</span><span class="scilabdefault">,</span><span class="scilabnumber">4</span><span class="scilaboperator">*</span><span class="scilabnumber">0.04</span><span class="scilabdefault">,</span><span class="scilabnumber">6</span><span class="scilaboperator">*</span><span class="scilabnumber">0.04</span><span class="scilabdefault">,</span><span class="scilabnumber">0.06</span><span class="scilabdefault">,</span><span class="scilabnumber">0.07</span><span class="scilabdefault">,</span><span class="scilabnumber">0.08</span><span class="scilabdefault">,</span><span class="scilabnumber">0.09</span><span class="scilabdefault">;</span><span class="scilabopenclose">]</span> +<span class="scilabid">beq</span> <span class="scilaboperator">=</span> <span class="scilabopenclose">[</span> <span class="scilabnumber">25</span><span class="scilabdefault">,</span> <span class="scilabnumber">1.25</span><span class="scilabdefault">,</span> <span class="scilabnumber">1.25</span><span class="scilabopenclose">]</span><span class="scilabdefault">;</span> + <span class="scilabcomment">//Integer Constraints</span> +<span class="scilabid">intcon</span> <span class="scilaboperator">=</span> <span class="scilabopenclose">[</span><span class="scilabnumber">1</span> <span class="scilabnumber">2</span> <span class="scilabnumber">3</span> <span class="scilabnumber">4</span><span class="scilabopenclose">]</span><span class="scilabdefault">;</span> +<span class="scilabcomment">// Calling CBC</span> +<span class="scilabopenclose">[</span><span class="scilabid">x</span><span class="scilabdefault">,</span><span class="scilabid">f</span><span class="scilabdefault">,</span><span class="scilabid">status</span><span class="scilabdefault">,</span><span class="scilabid">output</span><span class="scilabopenclose">]</span> <span class="scilaboperator">=</span> <span class="scilabid">cbcintlinprog</span><span class="scilabopenclose">(</span><span class="scilabid">c</span><span class="scilabdefault">,</span><span class="scilabid">intcon</span><span class="scilabdefault">,</span><span class="scilabid">A</span><span class="scilabdefault">,</span><span class="scilabid">b</span><span class="scilabdefault">,</span><span class="scilabid">Aeq</span><span class="scilabdefault">,</span><span class="scilabid">beq</span><span class="scilabopenclose">)</span> +<span class="scilabcomment">// Press ENTER to continue</span></pre></td><td valign="top"><a href="scilab://scilab.execexample/"><img src="ScilabExecute.png" border="0"/></a></td><td valign="top"><a href="scilab://scilab.editexample/"><img src="ScilabEdit.png" border="0"/></a></td><td></td></tr></table></div></div> + +<div class="refsection"><h3 class="title">Authors</h3> + <ul class="itemizedlist"><li class="member">Akshay Miterani and Pranav Deshpande</li></ul></div> + <br /> + + <div class="manualnavbar"> + <table width="100%"> + <tr><td colspan="3" class="next"><a href="http://bugzilla.scilab.org/enter_bug.cgi?product=Scilab%20software&component=Documentation%20pages" class="ulink">Report an issue</a></td></tr> +<tr> + <td width="30%"> + <span class="previous"><a href="section_44e1f57c5225357b5fe53cb5fad967e9.html"><< FOSSEE Optimization Toolbox</a></span> + + </td> + <td width="40%" class="center"> + <span class="top"><a href="section_44e1f57c5225357b5fe53cb5fad967e9.html">FOSSEE Optimization Toolbox</a></span> + + </td> + <td width="30%" class="next"> + <span class="next"><a href="fgoalattain.html">fgoalattain >></a></span> + + </td> + </tr></table> + <hr /> + </div> + </body> +</html> |