1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
|
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>symphonymat</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="symphony.html"><< symphony</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="section_5fc7ef02a133896efbd190355314d3fc.html">Symphony Native Functions >></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> > symphonymat</span>
<br /><br />
<div class="refnamediv"><h1 class="refname">symphonymat</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">symphonymat</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">symphonymat</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">symphonymat</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">symphonymat</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">[</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">symphonymat</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 doubles, containing the coefficients of the variables in the objective function.</p></dd></dt>
<dt><span class="term">intcon :</span>
<dd><p class="para">A 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 to n where n is the 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 represents the linear coefficients in 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 double, vector of doubles, related to 'Aeq' and represents the linear coefficients in the 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 value of the function at x.</p></dd></dt>
<dt><span class="term">status :</span>
<dd><p class="para">The status flag returned from symphony. 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_symphonymat.xml_1.png' style='position:relative;top:51px;width:189px;height:110px'/></span></p>
<p class="para">The routine calls SYMPHONY, a solver for mixed-integer linear programs written in C, for the actual computation.</p>
<p class="para"><h3 class="title">Options</h3>
The options should be defined as type "list" and consist of over a hundred fields, the most important ones of which have been detailed here:</p>
<p class="para"><ul class="itemizedlist"><li>node_limit : A scalar, specifying the max. number of nodes allowed to be analyzed during the solution.</li>
<li>time_limit : A scalar, specifying the maximum amount of CPU time in seconds that the solver should take.</li>
<li>gap_limit : A scalar, representing the target gap limit allowed for solution.</li>
<li>granularity : A scalar, “the minimum difference between two distinct objective function values</li>
<li>node_selection_rule : A Scalar, specifying the maximum number of iterations that the solver should take.</li>
<li>prep_level : An integer, that determines the level of preprocessing that should be done on the current MILP instance.</li>
<li>do_branch_and_cut : A boolean, representing the decision whether to run the branch and cut algorithm or not.</li></ul></p>
<p class="para">The status allows the user to know the status of the optimization which is returned by Symphony. The values it can take and what they indicate is described below:
<ul class="itemizedlist"><li>227 : Optimal Solution Found</li>
<li>228 : Maximum CPU Time exceeded.</li>
<li>229 : Maximum Number of Node Limit Exceeded.</li>
<li>230 : Maximum Number of Iterations Limit Exceeded.</li></ul></p>
<p class="para">For more details on the status, see the symphony documentation which can be found on http://www.coin-or.org/SYMPHONY/man-5.6/</p>
<p class="para">The output data structure contains detailed information about the optimization process.
It is of type "struct" and contains the following fields.
<ul class="itemizedlist"><li>output.iterations: The number of iterations performed.</li></ul></p>
<p class="para"></p></div>
<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_symphonymat.xml_2.png' style='position:relative;top:12px;width:646px;height:146px'/></span></p>
<p class="para"></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">symphonymat</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>
<p class="para">A few examples displaying the various functionalities of symphonymat 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 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_symphonymat.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">symphonymat</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_symphonymat.xml_4.png' style='position:relative;top:27px;width:581px;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 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">symphonymat</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">In this example, we further enhance the functionality of symphonymat by setting input options. This provides us with the ability to control the solver parameters such as the maximum number of solver iterations and the max. CPU time allowed for the computation.</p>
<p class="para"></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">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">//Options</span>
<span class="scilabid">options</span> <span class="scilaboperator">=</span> <a class="scilabcommand" href="scilab://list">list</a><span class="scilabopenclose">(</span><span class="scilabstring">"</span><span class="scilabstring">time_limit</span><span class="scilabstring">"</span><span class="scilabdefault">,</span> <span class="scilabnumber">25</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">symphonymat</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_symphonymat.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 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="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 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">symphonymat</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_symphonymat.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 6:</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 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">symphonymat</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">Keyur Joshi, Saikiran, Iswarya, Harpreet Singh</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="symphony.html"><< symphony</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="section_5fc7ef02a133896efbd190355314d3fc.html">Symphony Native Functions >></a></span>
</td>
</tr></table>
<hr />
</div>
</body>
</html>
|