diff options
author | Harpreet | 2015-12-29 00:38:48 +0530 |
---|---|---|
committer | Harpreet | 2015-12-29 00:38:48 +0530 |
commit | eb9ca1191c94059cd7adcf69805906c809fe9712 (patch) | |
tree | f98e728341812b8a0eb46aa4159b062a22225f05 /help | |
parent | 0eee95dfb1edec6ce52ec3065a3adb1bf169c9f9 (diff) | |
download | FOSSEE-Optimization-toolbox-eb9ca1191c94059cd7adcf69805906c809fe9712.tar.gz FOSSEE-Optimization-toolbox-eb9ca1191c94059cd7adcf69805906c809fe9712.tar.bz2 FOSSEE-Optimization-toolbox-eb9ca1191c94059cd7adcf69805906c809fe9712.zip |
Bugs fixed 4
Diffstat (limited to 'help')
25 files changed, 183 insertions, 501 deletions
diff --git a/help/en_US/lsqlin.xml b/help/en_US/lsqlin.xml index 73416a9..c08905e 100644 --- a/help/en_US/lsqlin.xml +++ b/help/en_US/lsqlin.xml @@ -38,9 +38,9 @@ <title>Parameters</title> <variablelist> <varlistentry><term>C :</term> - <listitem><para> a matrix of double, represents the multiplier of the solution x in the expression C*x - d. C is M-by-N, where M is the number of equations, and N is the number of elements of x.</para></listitem></varlistentry> + <listitem><para> a matrix of double, represents the multiplier of the solution x in the expression C*x - d. Number of columns in C is equal to the number of elements in x.</para></listitem></varlistentry> <varlistentry><term>d :</term> - <listitem><para> a vector of double, represents the additive constant term in the expression C*x - d. d is M-by-1, where M is the number of equations.</para></listitem></varlistentry> + <listitem><para> a vector of double, represents the additive constant term in the expression C*x - d. Number of elements in d is equal to the number of rows in C matrix.</para></listitem></varlistentry> <varlistentry><term>A :</term> <listitem><para> a vector of double, represents the linear coefficients in the inequality constraints</para></listitem></varlistentry> <varlistentry><term>b :</term> @@ -49,9 +49,9 @@ <listitem><para> a matrix of double, represents the linear coefficients in the equality constraints</para></listitem></varlistentry> <varlistentry><term>beq :</term> <listitem><para> a vector of double, represents the linear coefficients in the equality constraints</para></listitem></varlistentry> - <varlistentry><term>LB :</term> + <varlistentry><term>lb :</term> <listitem><para> a vector of double, contains lower bounds of the variables.</para></listitem></varlistentry> - <varlistentry><term>UB :</term> + <varlistentry><term>ub :</term> <listitem><para> a vector of double, contains upper bounds of the variables.</para></listitem></varlistentry> <varlistentry><term>x0 :</term> <listitem><para> a vector of double, contains initial guess of variables.</para></listitem></varlistentry> @@ -64,11 +64,11 @@ <varlistentry><term>residual :</term> <listitem><para> a vector of double, solution residuals returned as the vector C*x-d.</para></listitem></varlistentry> <varlistentry><term>exitflag :</term> - <listitem><para> Integer identifying the reason the algorithm terminated.</para></listitem></varlistentry> + <listitem><para> Integer identifying the reason the algorithm terminated. It could be 0, 1 or 2 etc. i.e. Optimal, Maximum Number of Iterations Exceeded, CPU time exceeded. Other flags one can see in the lsqlin macro.</para></listitem></varlistentry> <varlistentry><term>output :</term> - <listitem><para> Structure containing information about the optimization. Right now it contains number of iteration.</para></listitem></varlistentry> + <listitem><para> Structure containing information about the optimization. This version only contains number of iterations.</para></listitem></varlistentry> <varlistentry><term>lambda :</term> - <listitem><para> Structure containing the Lagrange multipliers at the solution x (separated by constraint type).It contains lower, upper and linear equality, inequality constraints.</para></listitem></varlistentry> + <listitem><para> Structure containing the Lagrange multipliers at the solution x (separated by constraint type).It contains lower, upper bound multiplier and linear equality, inequality constraints.</para></listitem></varlistentry> </variablelist> </refsection> @@ -81,15 +81,15 @@ Search the minimum of a constrained linear least square problem specified by : <latex> \begin{eqnarray} &\mbox{min}_{x} -& 1/2||C*x - d||_2^2 \\ -& \text{subject to} & A*x \leq b \\ -& & Aeq*x = beq \\ +& 1/2||C⋅x - d||_2^2 \\ +& \text{subject to} & A⋅x \leq b \\ +& & Aeq⋅x = beq \\ & & lb \leq x \leq ub \\ \end{eqnarray} </latex> </para> <para> -We are calling IPOpt for solving the linear least square problem, IPOpt is a library written in C++. +The routine calls Ipopt for solving the linear least square problem, Ipopt is a library written in C++. </para> <para> </para> @@ -124,7 +124,7 @@ b = [0.5251 <refsection> <title>Examples</title> <programlisting role="example"><![CDATA[ -//A basic example for equality, inequality and bounds +//A basic example for equality, inequality constraints and variable bounds C = [0.9501 0.7620 0.6153 0.4057 0.2311 0.4564 0.7919 0.9354 0.6068 0.0185 0.9218 0.9169 diff --git a/help/en_US/lsqnonneg.xml b/help/en_US/lsqnonneg.xml index daf79bf..662ba2a 100644 --- a/help/en_US/lsqnonneg.xml +++ b/help/en_US/lsqnonneg.xml @@ -35,21 +35,21 @@ <title>Parameters</title> <variablelist> <varlistentry><term>C :</term> - <listitem><para> a matrix of doubles, represents the multiplier of the solution x in the expression C*x - d. C is M-by-N, where M is the number of equations, and N is the number of elements of x.</para></listitem></varlistentry> + <listitem><para> a matrix of double, represents the multiplier of the solution x in the expression C*x - d. Number of columns in C is equal to the number of elements in x.</para></listitem></varlistentry> <varlistentry><term>d :</term> - <listitem><para> a vector of doubles, represents the additive constant term in the expression C*x - d. d is M-by-1, where M is the number of equations.</para></listitem></varlistentry> + <listitem><para> a vector of double, represents the additive constant term in the expression C*x - d. Number of elements in d is equal to the number of rows in C matrix.</para></listitem></varlistentry> <varlistentry><term>xopt :</term> - <listitem><para> a vector of doubles, the computed solution of the optimization problem.</para></listitem></varlistentry> + <listitem><para> a vector of double, the computed solution of the optimization problem.</para></listitem></varlistentry> <varlistentry><term>resnorm :</term> <listitem><para> a double, objective value returned as the scalar value norm(C*x-d)^2.</para></listitem></varlistentry> <varlistentry><term>residual :</term> - <listitem><para> a vector of doubles, solution residuals returned as the vector C*x-d.</para></listitem></varlistentry> + <listitem><para> a vector of double, solution residuals returned as the vector C*x-d.</para></listitem></varlistentry> <varlistentry><term>exitflag :</term> - <listitem><para> Integer identifying the reason the algorithm terminated.</para></listitem></varlistentry> + <listitem><para> Integer identifying the reason the algorithm terminated. It could be 0, 1 or 2 i.e. Optimal, Maximum Number of Iterations Exceeded, CPU time exceeded.</para></listitem></varlistentry> <varlistentry><term>output :</term> - <listitem><para> Structure containing information about the optimization. Right now it contains number of iteration.</para></listitem></varlistentry> + <listitem><para> Structure containing information about the optimization. This version only contains number of iterations.</para></listitem></varlistentry> <varlistentry><term>lambda :</term> - <listitem><para> Structure containing the Lagrange multipliers at the solution x (separated by constraint type).It contains lower, upper and linear equality, inequality constraints.</para></listitem></varlistentry> + <listitem><para> Structure containing the Lagrange multipliers at the solution x. It contains lower and upper bound multiplier.</para></listitem></varlistentry> </variablelist> </refsection> @@ -62,13 +62,13 @@ Solves nonnegative least-squares curve fitting problems specified by : <latex> \begin{eqnarray} &\mbox{min}_{x} -& 1/2||C*x - d||_2^2 \\ +& 1/2||C⋅x - d||_2^2 \\ & & x \geq 0 \\ \end{eqnarray} </latex> </para> <para> -We are calling IPOpt for solving the nonnegative least-squares curve fitting problems, IPOpt is a library written in C++. +The routine calls Ipopt for solving the nonnegative least-squares curve fitting problems, Ipopt is a library written in C++. </para> <para> </para> diff --git a/help/en_US/qpipopt.xml b/help/en_US/qpipopt.xml index 23e2c52..6dd578d 100644 --- a/help/en_US/qpipopt.xml +++ b/help/en_US/qpipopt.xml @@ -24,9 +24,9 @@ <refsynopsisdiv> <title>Calling Sequence</title> <synopsis> - xopt = qpipopt(nbVar,nbCon,Q,p,LB,UB,conMatrix,conLB,conUB) - xopt = qpipopt(nbVar,nbCon,Q,p,LB,UB,conMatrix,conLB,conUB,x0) - xopt = qpipopt(nbVar,nbCon,Q,p,LB,UB,conMatrix,conLB,conUB,x0,param) + xopt = qpipopt(nbVar,nbCon,H,f,lb,ub,A,conLB,conUB) + xopt = qpipopt(nbVar,nbCon,H,f,lb,ub,A,conLB,conUB,x0) + xopt = qpipopt(nbVar,nbCon,H,f,lb,ub,A,conLB,conUB,x0,param) [xopt,fopt,exitflag,output,lamda] = qpipopt( ... ) </synopsis> @@ -39,15 +39,15 @@ <listitem><para> a double, number of variables</para></listitem></varlistentry> <varlistentry><term>nbCon :</term> <listitem><para> a double, number of constraints</para></listitem></varlistentry> - <varlistentry><term>Q :</term> + <varlistentry><term>H :</term> <listitem><para> a symmetric matrix of double, represents coefficients of quadratic in the quadratic problem.</para></listitem></varlistentry> - <varlistentry><term>p :</term> + <varlistentry><term>f :</term> <listitem><para> a vector of double, represents coefficients of linear in the quadratic problem</para></listitem></varlistentry> - <varlistentry><term>LB :</term> + <varlistentry><term>lb :</term> <listitem><para> a vector of double, contains lower bounds of the variables.</para></listitem></varlistentry> - <varlistentry><term>UB :</term> + <varlistentry><term>ub :</term> <listitem><para> a vector of double, contains upper bounds of the variables.</para></listitem></varlistentry> - <varlistentry><term>conMatrix :</term> + <varlistentry><term>A :</term> <listitem><para> a matrix of double, contains matrix representing the constraint matrix</para></listitem></varlistentry> <varlistentry><term>conLB :</term> <listitem><para> a vector of double, contains lower bounds of the constraints.</para></listitem></varlistentry> @@ -62,9 +62,9 @@ <varlistentry><term>fopt :</term> <listitem><para> a double, the function value at x.</para></listitem></varlistentry> <varlistentry><term>exitflag :</term> - <listitem><para> Integer identifying the reason the algorithm terminated.</para></listitem></varlistentry> + <listitem><para> Integer identifying the reason the algorithm terminated. It could be 0, 1 or 2 etc. i.e. Optimal, Maximum Number of Iterations Exceeded, CPU time exceeded. Other flags one can see in the qpipopt macro.</para></listitem></varlistentry> <varlistentry><term>output :</term> - <listitem><para> Structure containing information about the optimization. Right now it contains number of iteration.</para></listitem></varlistentry> + <listitem><para> Structure containing information about the optimization. This version only contains number of iterations</para></listitem></varlistentry> <varlistentry><term>lambda :</term> <listitem><para> Structure containing the Lagrange multipliers at the solution x (separated by constraint type).It contains lower, upper and linear equality, inequality constraints.</para></listitem></varlistentry> </variablelist> @@ -80,14 +80,14 @@ find the minimum of f(x) such that <latex> \begin{eqnarray} &\mbox{min}_{x} -& 1/2*x'*Q*x + p'*x \\ -& \text{subject to} & conLB \leq C(x) \leq conUB \\ +& 1/2⋅x^T⋅H⋅x + f^T⋅x \\ +& \text{subject to} & conLB \leq A⋅x \leq conUB \\ & & lb \leq x \leq ub \\ \end{eqnarray} </latex> </para> <para> -We are calling IPOpt for solving the quadratic problem, IPOpt is a library written in C++. +The routine calls Ipopt for solving the quadratic problem, Ipopt is a library written in C++. </para> <para> </para> @@ -97,7 +97,7 @@ We are calling IPOpt for solving the quadratic problem, IPOpt is a library writt <title>Examples</title> <programlisting role="example"><![CDATA[ //Find x in R^6 such that: -conMatrix= [1,-1,1,0,3,1; +A= [1,-1,1,0,3,1; -1,0,-3,-4,5,6; 2,5,3,0,1,0 0,1,0,1,2,-1; @@ -106,13 +106,13 @@ conLB=[1;2;3;-%inf;-%inf]; conUB = [1;2;3;-1;2.5]; lb=[-1000;-10000; 0; -1000; -1000; -1000]; ub=[10000; 100; 1.5; 100; 100; 1000]; -//and minimize 0.5*x'*Q*x + p'*x with -p=[1; 2; 3; 4; 5; 6]; Q=eye(6,6); +//and minimize 0.5*x'⋅H⋅x + f'⋅x with +f=[1; 2; 3; 4; 5; 6]; H=eye(6,6); nbVar = 6; nbCon = 5; x0 = repmat(0,nbVar,1); param = list("MaxIter", 300, "CpuTime", 100); -[xopt,fopt,exitflag,output,lambda]=qpipopt(nbVar,nbCon,Q,p,lb,ub,conMatrix,conLB,conUB,x0,param) +[xopt,fopt,exitflag,output,lambda]=qpipopt(nbVar,nbCon,H,f,lb,ub,A,conLB,conUB,x0,param) // Press ENTER to continue ]]></programlisting> @@ -128,16 +128,16 @@ param = list("MaxIter", 300, "CpuTime", 100); // –x1 + 2x2 ≤ 2 // 2x1 + x2 ≤ 3 // 0 ≤ x1, 0 ≤ x2. -Q = [1 -1; -1 2]; -p = [-2; -6]; -conMatrix = [1 1; -1 2; 2 1]; +H = [1 -1; -1 2]; +f = [-2; -6]; +A = [1 1; -1 2; 2 1]; conUB = [2; 2; 3]; conLB = [-%inf; -%inf; -%inf]; lb = [0; 0]; ub = [%inf; %inf]; nbVar = 2; nbCon = 3; -[xopt,fopt,exitflag,output,lambda] = qpipopt(nbVar,nbCon,Q,p,lb,ub,conMatrix,conLB,conUB) +[xopt,fopt,exitflag,output,lambda] = qpipopt(nbVar,nbCon,H,f,lb,ub,A,conLB,conUB) ]]></programlisting> </refsection> diff --git a/help/en_US/qpipoptmat.xml b/help/en_US/qpipoptmat.xml index 70150bc..8d0bc0c 100644 --- a/help/en_US/qpipoptmat.xml +++ b/help/en_US/qpipoptmat.xml @@ -50,9 +50,9 @@ <listitem><para> a matrix of double, represents the linear coefficients in the equality constraints</para></listitem></varlistentry> <varlistentry><term>beq :</term> <listitem><para> a vector of double, represents the linear coefficients in the equality constraints</para></listitem></varlistentry> - <varlistentry><term>LB :</term> + <varlistentry><term>lb :</term> <listitem><para> a vector of double, contains lower bounds of the variables.</para></listitem></varlistentry> - <varlistentry><term>UB :</term> + <varlistentry><term>ub :</term> <listitem><para> a vector of double, contains upper bounds of the variables.</para></listitem></varlistentry> <varlistentry><term>x0 :</term> <listitem><para> a vector of double, contains initial guess of variables.</para></listitem></varlistentry> @@ -63,9 +63,9 @@ <varlistentry><term>fopt :</term> <listitem><para> a double, the function value at x.</para></listitem></varlistentry> <varlistentry><term>exitflag :</term> - <listitem><para> Integer identifying the reason the algorithm terminated.</para></listitem></varlistentry> + <listitem><para> Integer identifying the reason the algorithm terminated.It could be 0, 1 or 2 etc. i.e. Optimal, Maximum Number of Iterations Exceeded, CPU time exceeded. Other flags one can see in the qpipoptmat macro.</para></listitem></varlistentry> <varlistentry><term>output :</term> - <listitem><para> Structure containing information about the optimization. Right now it contains number of iteration.</para></listitem></varlistentry> + <listitem><para> Structure containing information about the optimization. This version only contains number of iterations.</para></listitem></varlistentry> <varlistentry><term>lambda :</term> <listitem><para> Structure containing the Lagrange multipliers at the solution x (separated by constraint type).It contains lower, upper and linear equality, inequality constraints.</para></listitem></varlistentry> </variablelist> @@ -81,15 +81,15 @@ find the minimum of f(x) such that <latex> \begin{eqnarray} &\mbox{min}_{x} -& 1/2*x'*H*x + f'*x \\ -& \text{subject to} & A*x \leq b \\ -& & Aeq*x = beq \\ +& 1/2⋅x^T⋅H⋅x + f^T⋅x \\ +& \text{subject to} & A⋅x \leq b \\ +& & Aeq⋅x = beq \\ & & lb \leq x \leq ub \\ \end{eqnarray} </latex> </para> <para> -We are calling IPOpt for solving the quadratic problem, IPOpt is a library written in C++. +The routine calls Ipopt for solving the quadratic problem, Ipopt is a library written in C++. </para> <para> </para> diff --git a/help/en_US/scilab_en_US_help/JavaHelpSearch/DOCS b/help/en_US/scilab_en_US_help/JavaHelpSearch/DOCS Binary files differindex 90b22d8..8ebf21b 100644 --- a/help/en_US/scilab_en_US_help/JavaHelpSearch/DOCS +++ b/help/en_US/scilab_en_US_help/JavaHelpSearch/DOCS diff --git a/help/en_US/scilab_en_US_help/JavaHelpSearch/DOCS.TAB b/help/en_US/scilab_en_US_help/JavaHelpSearch/DOCS.TAB Binary files differindex 8cff552..728f68c 100644 --- a/help/en_US/scilab_en_US_help/JavaHelpSearch/DOCS.TAB +++ b/help/en_US/scilab_en_US_help/JavaHelpSearch/DOCS.TAB diff --git a/help/en_US/scilab_en_US_help/JavaHelpSearch/OFFSETS b/help/en_US/scilab_en_US_help/JavaHelpSearch/OFFSETS Binary files differindex 62368d7..9468d7f 100644 --- a/help/en_US/scilab_en_US_help/JavaHelpSearch/OFFSETS +++ b/help/en_US/scilab_en_US_help/JavaHelpSearch/OFFSETS diff --git a/help/en_US/scilab_en_US_help/JavaHelpSearch/POSITIONS b/help/en_US/scilab_en_US_help/JavaHelpSearch/POSITIONS Binary files differindex c85a3ee..d5dee46 100644 --- a/help/en_US/scilab_en_US_help/JavaHelpSearch/POSITIONS +++ b/help/en_US/scilab_en_US_help/JavaHelpSearch/POSITIONS diff --git a/help/en_US/scilab_en_US_help/JavaHelpSearch/SCHEMA b/help/en_US/scilab_en_US_help/JavaHelpSearch/SCHEMA index b5697c6..e2b33d1 100644 --- a/help/en_US/scilab_en_US_help/JavaHelpSearch/SCHEMA +++ b/help/en_US/scilab_en_US_help/JavaHelpSearch/SCHEMA @@ -1,2 +1,2 @@ JavaSearch 1.0 -TMAP bs=2048 rt=1 fl=-1 id1=1439 id2=1 +TMAP bs=2048 rt=1 fl=-1 id1=1446 id2=1 diff --git a/help/en_US/scilab_en_US_help/JavaHelpSearch/TMAP b/help/en_US/scilab_en_US_help/JavaHelpSearch/TMAP Binary files differindex 80e09d1..35dc462 100644 --- a/help/en_US/scilab_en_US_help/JavaHelpSearch/TMAP +++ b/help/en_US/scilab_en_US_help/JavaHelpSearch/TMAP diff --git a/help/en_US/scilab_en_US_help/_LaTeX_lsqlin.xml_1.png b/help/en_US/scilab_en_US_help/_LaTeX_lsqlin.xml_1.png Binary files differindex 873dc47..9015755 100644 --- a/help/en_US/scilab_en_US_help/_LaTeX_lsqlin.xml_1.png +++ b/help/en_US/scilab_en_US_help/_LaTeX_lsqlin.xml_1.png diff --git a/help/en_US/scilab_en_US_help/_LaTeX_lsqnonneg.xml_1.png b/help/en_US/scilab_en_US_help/_LaTeX_lsqnonneg.xml_1.png Binary files differindex b923eeb..3dd57aa 100644 --- a/help/en_US/scilab_en_US_help/_LaTeX_lsqnonneg.xml_1.png +++ b/help/en_US/scilab_en_US_help/_LaTeX_lsqnonneg.xml_1.png diff --git a/help/en_US/scilab_en_US_help/_LaTeX_qpipopt.xml_1.png b/help/en_US/scilab_en_US_help/_LaTeX_qpipopt.xml_1.png Binary files differindex 6750af2..e2fbbde 100644 --- a/help/en_US/scilab_en_US_help/_LaTeX_qpipopt.xml_1.png +++ b/help/en_US/scilab_en_US_help/_LaTeX_qpipopt.xml_1.png diff --git a/help/en_US/scilab_en_US_help/_LaTeX_qpipoptmat.xml_1.png b/help/en_US/scilab_en_US_help/_LaTeX_qpipoptmat.xml_1.png Binary files differindex 7331197..3846115 100644 --- a/help/en_US/scilab_en_US_help/_LaTeX_qpipoptmat.xml_1.png +++ b/help/en_US/scilab_en_US_help/_LaTeX_qpipoptmat.xml_1.png diff --git a/help/en_US/scilab_en_US_help/_LaTeX_symphony.xml_1.png b/help/en_US/scilab_en_US_help/_LaTeX_symphony.xml_1.png Binary files differindex 96b5161..9155e8f 100644 --- a/help/en_US/scilab_en_US_help/_LaTeX_symphony.xml_1.png +++ b/help/en_US/scilab_en_US_help/_LaTeX_symphony.xml_1.png diff --git a/help/en_US/scilab_en_US_help/_LaTeX_symphonymat.xml_1.png b/help/en_US/scilab_en_US_help/_LaTeX_symphonymat.xml_1.png Binary files differindex 2d61fb7..9c2039f 100644 --- a/help/en_US/scilab_en_US_help/_LaTeX_symphonymat.xml_1.png +++ b/help/en_US/scilab_en_US_help/_LaTeX_symphonymat.xml_1.png diff --git a/help/en_US/scilab_en_US_help/lsqlin.html b/help/en_US/scilab_en_US_help/lsqlin.html index b843257..aef773d 100644 --- a/help/en_US/scilab_en_US_help/lsqlin.html +++ b/help/en_US/scilab_en_US_help/lsqlin.html @@ -46,9 +46,9 @@ <div class="refsection"><h3 class="title">Parameters</h3> <dl><dt><span class="term">C :</span> - <dd><p class="para">a matrix of double, represents the multiplier of the solution x in the expression C*x - d. C is M-by-N, where M is the number of equations, and N is the number of elements of x.</p></dd></dt> + <dd><p class="para">a matrix of double, represents the multiplier of the solution x in the expression C*x - d. Number of columns in C is equal to the number of elements in x.</p></dd></dt> <dt><span class="term">d :</span> - <dd><p class="para">a vector of double, represents the additive constant term in the expression C*x - d. d is M-by-1, where M is the number of equations.</p></dd></dt> + <dd><p class="para">a vector of double, represents the additive constant term in the expression C*x - d. Number of elements in d is equal to the number of rows in C matrix.</p></dd></dt> <dt><span class="term">A :</span> <dd><p class="para">a vector of double, represents the linear coefficients in the inequality constraints</p></dd></dt> <dt><span class="term">b :</span> @@ -57,9 +57,9 @@ <dd><p class="para">a matrix of double, represents the linear coefficients in the equality constraints</p></dd></dt> <dt><span class="term">beq :</span> <dd><p class="para">a vector of double, represents the linear coefficients in the equality constraints</p></dd></dt> - <dt><span class="term">LB :</span> + <dt><span class="term">lb :</span> <dd><p class="para">a vector of double, contains lower bounds of the variables.</p></dd></dt> - <dt><span class="term">UB :</span> + <dt><span class="term">ub :</span> <dd><p class="para">a vector of double, contains upper bounds of the variables.</p></dd></dt> <dt><span class="term">x0 :</span> <dd><p class="para">a vector of double, contains initial guess of variables.</p></dd></dt> @@ -72,16 +72,16 @@ <dt><span class="term">residual :</span> <dd><p class="para">a vector of double, solution residuals returned as the vector C*x-d.</p></dd></dt> <dt><span class="term">exitflag :</span> - <dd><p class="para">Integer identifying the reason the algorithm terminated.</p></dd></dt> + <dd><p class="para">Integer identifying the reason the algorithm terminated. It could be 0, 1 or 2 etc. i.e. Optimal, Maximum Number of Iterations Exceeded, CPU time exceeded. Other flags one can see in the lsqlin macro.</p></dd></dt> <dt><span class="term">output :</span> - <dd><p class="para">Structure containing information about the optimization. Right now it contains number of iteration.</p></dd></dt> + <dd><p class="para">Structure containing information about the optimization. This version only contains number of iterations.</p></dd></dt> <dt><span class="term">lambda :</span> - <dd><p class="para">Structure containing the Lagrange multipliers at the solution x (separated by constraint type).It contains lower, upper and linear equality, inequality constraints.</p></dd></dt></dl></div> + <dd><p class="para">Structure containing the Lagrange multipliers at the solution x (separated by constraint type).It contains lower, upper bound multiplier and linear equality, inequality constraints.</p></dd></dt></dl></div> <div class="refsection"><h3 class="title">Description</h3> <p class="para">Search the minimum of a constrained linear least square problem specified by :</p> - <p class="para"><span><img src='./_LaTeX_lsqlin.xml_1.png' style='position:relative;top:41px;width:234px;height:90px'/></span></p> - <p class="para">We are calling IPOpt for solving the linear least square problem, IPOpt is a library written in C++.</p> + <p class="para"><span><img src='./_LaTeX_lsqlin.xml_1.png' style='position:relative;top:41px;width:230px;height:90px'/></span></p> + <p class="para">The routine calls Ipopt for solving the linear least square problem, Ipopt is a library written in C++.</p> <p class="para"></p></div> <div class="refsection"><h3 class="title">Examples</h3> @@ -106,7 +106,7 @@ <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">Examples</h3> - <div class="programlisting"><table border="0" width="100%"><tr><td width="98%"><pre class="scilabcode"><span class="scilabcomment">//A basic example for equality, inequality and bounds</span> + <div class="programlisting"><table border="0" width="100%"><tr><td width="98%"><pre class="scilabcode"><span class="scilabcomment">//A basic example for equality, inequality constraints and variable bounds</span> <span class="scilabid">C</span> <span class="scilaboperator">=</span> <span class="scilabopenclose">[</span><span class="scilabnumber">0.9501</span> <span class="scilabnumber">0.7620</span> <span class="scilabnumber">0.6153</span> <span class="scilabnumber">0.4057</span> <span class="scilabnumber">0.2311</span> <span class="scilabnumber">0.4564</span> <span class="scilabnumber">0.7919</span> <span class="scilabnumber">0.9354</span> <span class="scilabnumber">0.6068</span> <span class="scilabnumber">0.0185</span> <span class="scilabnumber">0.9218</span> <span class="scilabnumber">0.9169</span> diff --git a/help/en_US/scilab_en_US_help/lsqnonneg.html b/help/en_US/scilab_en_US_help/lsqnonneg.html index 40139a0..e9a9110 100644 --- a/help/en_US/scilab_en_US_help/lsqnonneg.html +++ b/help/en_US/scilab_en_US_help/lsqnonneg.html @@ -43,26 +43,26 @@ <div class="refsection"><h3 class="title">Parameters</h3> <dl><dt><span class="term">C :</span> - <dd><p class="para">a matrix of doubles, represents the multiplier of the solution x in the expression C*x - d. C is M-by-N, where M is the number of equations, and N is the number of elements of x.</p></dd></dt> + <dd><p class="para">a matrix of double, represents the multiplier of the solution x in the expression C*x - d. Number of columns in C is equal to the number of elements in x.</p></dd></dt> <dt><span class="term">d :</span> - <dd><p class="para">a vector of doubles, represents the additive constant term in the expression C*x - d. d is M-by-1, where M is the number of equations.</p></dd></dt> + <dd><p class="para">a vector of double, represents the additive constant term in the expression C*x - d. Number of elements in d is equal to the number of rows in C matrix.</p></dd></dt> <dt><span class="term">xopt :</span> - <dd><p class="para">a vector of doubles, the computed solution of the optimization problem.</p></dd></dt> + <dd><p class="para">a vector of double, the computed solution of the optimization problem.</p></dd></dt> <dt><span class="term">resnorm :</span> <dd><p class="para">a double, objective value returned as the scalar value norm(C*x-d)^2.</p></dd></dt> <dt><span class="term">residual :</span> - <dd><p class="para">a vector of doubles, solution residuals returned as the vector C*x-d.</p></dd></dt> + <dd><p class="para">a vector of double, solution residuals returned as the vector C*x-d.</p></dd></dt> <dt><span class="term">exitflag :</span> - <dd><p class="para">Integer identifying the reason the algorithm terminated.</p></dd></dt> + <dd><p class="para">Integer identifying the reason the algorithm terminated. It could be 0, 1 or 2 i.e. Optimal, Maximum Number of Iterations Exceeded, CPU time exceeded.</p></dd></dt> <dt><span class="term">output :</span> - <dd><p class="para">Structure containing information about the optimization. Right now it contains number of iteration.</p></dd></dt> + <dd><p class="para">Structure containing information about the optimization. This version only contains number of iterations.</p></dd></dt> <dt><span class="term">lambda :</span> - <dd><p class="para">Structure containing the Lagrange multipliers at the solution x (separated by constraint type).It contains lower, upper and linear equality, inequality constraints.</p></dd></dt></dl></div> + <dd><p class="para">Structure containing the Lagrange multipliers at the solution x. It contains lower and upper bound multiplier.</p></dd></dt></dl></div> <div class="refsection"><h3 class="title">Description</h3> <p class="para">Solves nonnegative least-squares curve fitting problems specified by :</p> - <p class="para"><span><img src='./_LaTeX_lsqnonneg.xml_1.png' style='position:relative;top:19px;width:197px;height:46px'/></span></p> - <p class="para">We are calling IPOpt for solving the nonnegative least-squares curve fitting problems, IPOpt is a library written in C++.</p> + <p class="para"><span><img src='./_LaTeX_lsqnonneg.xml_1.png' style='position:relative;top:19px;width:193px;height:46px'/></span></p> + <p class="para">The routine calls Ipopt for solving the nonnegative least-squares curve fitting problems, Ipopt is a library written in C++.</p> <p class="para"></p></div> <div class="refsection"><h3 class="title">Examples</h3> diff --git a/help/en_US/scilab_en_US_help/qpipopt.html b/help/en_US/scilab_en_US_help/qpipopt.html index d4b6b3c..349bbc4 100644 --- a/help/en_US/scilab_en_US_help/qpipopt.html +++ b/help/en_US/scilab_en_US_help/qpipopt.html @@ -37,9 +37,9 @@ <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">qpipopt</span><span class="default">(</span><span class="default">nbVar</span><span class="default">,</span><span class="default">nbCon</span><span class="default">,</span><span class="default">Q</span><span class="default">,</span><span class="default">p</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">conMatrix</span><span class="default">,</span><span class="default">conLB</span><span class="default">,</span><span class="default">conUB</span><span class="default">)</span> -<span class="default">xopt</span><span class="default"> = </span><span class="functionid">qpipopt</span><span class="default">(</span><span class="default">nbVar</span><span class="default">,</span><span class="default">nbCon</span><span class="default">,</span><span class="default">Q</span><span class="default">,</span><span class="default">p</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">conMatrix</span><span class="default">,</span><span class="default">conLB</span><span class="default">,</span><span class="default">conUB</span><span class="default">,</span><span class="default">x0</span><span class="default">)</span> -<span class="default">xopt</span><span class="default"> = </span><span class="functionid">qpipopt</span><span class="default">(</span><span class="default">nbVar</span><span class="default">,</span><span class="default">nbCon</span><span class="default">,</span><span class="default">Q</span><span class="default">,</span><span class="default">p</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">conMatrix</span><span class="default">,</span><span class="default">conLB</span><span class="default">,</span><span class="default">conUB</span><span class="default">,</span><span class="default">x0</span><span class="default">,</span><span class="default">param</span><span class="default">)</span> + <div class="synopsis"><pre><span class="default">xopt</span><span class="default"> = </span><span class="functionid">qpipopt</span><span class="default">(</span><span class="default">nbVar</span><span class="default">,</span><span class="default">nbCon</span><span class="default">,</span><span class="default">H</span><span class="default">,</span><span class="default">f</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">A</span><span class="default">,</span><span class="default">conLB</span><span class="default">,</span><span class="default">conUB</span><span class="default">)</span> +<span class="default">xopt</span><span class="default"> = </span><span class="functionid">qpipopt</span><span class="default">(</span><span class="default">nbVar</span><span class="default">,</span><span class="default">nbCon</span><span class="default">,</span><span class="default">H</span><span class="default">,</span><span class="default">f</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">A</span><span class="default">,</span><span class="default">conLB</span><span class="default">,</span><span class="default">conUB</span><span class="default">,</span><span class="default">x0</span><span class="default">)</span> +<span class="default">xopt</span><span class="default"> = </span><span class="functionid">qpipopt</span><span class="default">(</span><span class="default">nbVar</span><span class="default">,</span><span class="default">nbCon</span><span class="default">,</span><span class="default">H</span><span class="default">,</span><span class="default">f</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">A</span><span class="default">,</span><span class="default">conLB</span><span class="default">,</span><span class="default">conUB</span><span class="default">,</span><span class="default">x0</span><span class="default">,</span><span class="default">param</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">exitflag</span><span class="default">,</span><span class="default">output</span><span class="default">,</span><span class="default">lamda</span><span class="default">] = </span><span class="functionid">qpipopt</span><span class="default">( ... )</span></pre></div></div> <div class="refsection"><h3 class="title">Parameters</h3> @@ -47,15 +47,15 @@ <dd><p class="para">a double, number of variables</p></dd></dt> <dt><span class="term">nbCon :</span> <dd><p class="para">a double, number of constraints</p></dd></dt> - <dt><span class="term">Q :</span> + <dt><span class="term">H :</span> <dd><p class="para">a symmetric matrix of double, represents coefficients of quadratic in the quadratic problem.</p></dd></dt> - <dt><span class="term">p :</span> + <dt><span class="term">f :</span> <dd><p class="para">a vector of double, represents coefficients of linear in the quadratic problem</p></dd></dt> - <dt><span class="term">LB :</span> + <dt><span class="term">lb :</span> <dd><p class="para">a vector of double, contains lower bounds of the variables.</p></dd></dt> - <dt><span class="term">UB :</span> + <dt><span class="term">ub :</span> <dd><p class="para">a vector of double, contains upper bounds of the variables.</p></dd></dt> - <dt><span class="term">conMatrix :</span> + <dt><span class="term">A :</span> <dd><p class="para">a matrix of double, contains matrix representing the constraint matrix</p></dd></dt> <dt><span class="term">conLB :</span> <dd><p class="para">a vector of double, contains lower bounds of the constraints.</p></dd></dt> @@ -70,22 +70,22 @@ <dt><span class="term">fopt :</span> <dd><p class="para">a double, the function value at x.</p></dd></dt> <dt><span class="term">exitflag :</span> - <dd><p class="para">Integer identifying the reason the algorithm terminated.</p></dd></dt> + <dd><p class="para">Integer identifying the reason the algorithm terminated. It could be 0, 1 or 2 etc. i.e. Optimal, Maximum Number of Iterations Exceeded, CPU time exceeded. Other flags one can see in the qpipopt macro.</p></dd></dt> <dt><span class="term">output :</span> - <dd><p class="para">Structure containing information about the optimization. Right now it contains number of iteration.</p></dd></dt> + <dd><p class="para">Structure containing information about the optimization. This version only contains number of iterations</p></dd></dt> <dt><span class="term">lambda :</span> <dd><p class="para">Structure containing the Lagrange multipliers at the solution x (separated by constraint type).It contains lower, upper and linear equality, inequality constraints.</p></dd></dt></dl></div> <div class="refsection"><h3 class="title">Description</h3> <p class="para">Search the minimum of a constrained linear quadratic optimization problem specified by : find the minimum of f(x) such that</p> - <p class="para"><span><img src='./_LaTeX_qpipopt.xml_1.png' style='position:relative;top:31px;width:293px;height:70px'/></span></p> - <p class="para">We are calling IPOpt for solving the quadratic problem, IPOpt is a library written in C++.</p> + <p class="para"><span><img src='./_LaTeX_qpipopt.xml_1.png' style='position:relative;top:31px;width:292px;height:70px'/></span></p> + <p class="para">The routine calls Ipopt for solving the quadratic problem, Ipopt is a library written in C++.</p> <p class="para"></p></div> <div class="refsection"><h3 class="title">Examples</h3> <div class="programlisting"><table border="0" width="100%"><tr><td width="98%"><pre class="scilabcode"><span class="scilabcomment">//Find x in R^6 such that:</span> -<span class="scilabid">conMatrix</span><span class="scilaboperator">=</span> <span class="scilabopenclose">[</span><span class="scilabnumber">1</span><span class="scilabdefault">,</span><span class="scilaboperator">-</span><span class="scilabnumber">1</span><span class="scilabdefault">,</span><span class="scilabnumber">1</span><span class="scilabdefault">,</span><span class="scilabnumber">0</span><span class="scilabdefault">,</span><span class="scilabnumber">3</span><span class="scilabdefault">,</span><span class="scilabnumber">1</span><span class="scilabdefault">;</span> +<span class="scilabid">A</span><span class="scilaboperator">=</span> <span class="scilabopenclose">[</span><span class="scilabnumber">1</span><span class="scilabdefault">,</span><span class="scilaboperator">-</span><span class="scilabnumber">1</span><span class="scilabdefault">,</span><span class="scilabnumber">1</span><span class="scilabdefault">,</span><span class="scilabnumber">0</span><span class="scilabdefault">,</span><span class="scilabnumber">3</span><span class="scilabdefault">,</span><span class="scilabnumber">1</span><span class="scilabdefault">;</span> <span class="scilaboperator">-</span><span class="scilabnumber">1</span><span class="scilabdefault">,</span><span class="scilabnumber">0</span><span class="scilabdefault">,</span><span class="scilaboperator">-</span><span class="scilabnumber">3</span><span class="scilabdefault">,</span><span class="scilaboperator">-</span><span class="scilabnumber">4</span><span class="scilabdefault">,</span><span class="scilabnumber">5</span><span class="scilabdefault">,</span><span class="scilabnumber">6</span><span class="scilabdefault">;</span> <span class="scilabnumber">2</span><span class="scilabdefault">,</span><span class="scilabnumber">5</span><span class="scilabdefault">,</span><span class="scilabnumber">3</span><span class="scilabdefault">,</span><span class="scilabnumber">0</span><span class="scilabdefault">,</span><span class="scilabnumber">1</span><span class="scilabdefault">,</span><span class="scilabnumber">0</span> <span class="scilabnumber">0</span><span class="scilabdefault">,</span><span class="scilabnumber">1</span><span class="scilabdefault">,</span><span class="scilabnumber">0</span><span class="scilabdefault">,</span><span class="scilabnumber">1</span><span class="scilabdefault">,</span><span class="scilabnumber">2</span><span class="scilabdefault">,</span><span class="scilaboperator">-</span><span class="scilabnumber">1</span><span class="scilabdefault">;</span> @@ -94,13 +94,13 @@ find the minimum of f(x) such that</p> <span class="scilabid">conUB</span> <span class="scilaboperator">=</span> <span class="scilabopenclose">[</span><span class="scilabnumber">1</span><span class="scilabdefault">;</span><span class="scilabnumber">2</span><span class="scilabdefault">;</span><span class="scilabnumber">3</span><span class="scilabdefault">;</span><span class="scilaboperator">-</span><span class="scilabnumber">1</span><span class="scilabdefault">;</span><span class="scilabnumber">2.5</span><span class="scilabopenclose">]</span><span class="scilabdefault">;</span> <span class="scilabid">lb</span><span class="scilaboperator">=</span><span class="scilabopenclose">[</span><span class="scilaboperator">-</span><span class="scilabnumber">1000</span><span class="scilabdefault">;</span><span class="scilaboperator">-</span><span class="scilabnumber">10000</span><span class="scilabdefault">;</span> <span class="scilabnumber">0</span><span class="scilabdefault">;</span> <span class="scilaboperator">-</span><span class="scilabnumber">1000</span><span class="scilabdefault">;</span> <span class="scilaboperator">-</span><span class="scilabnumber">1000</span><span class="scilabdefault">;</span> <span class="scilaboperator">-</span><span class="scilabnumber">1000</span><span class="scilabopenclose">]</span><span class="scilabdefault">;</span> <span class="scilabid">ub</span><span class="scilaboperator">=</span><span class="scilabopenclose">[</span><span class="scilabnumber">10000</span><span class="scilabdefault">;</span> <span class="scilabnumber">100</span><span class="scilabdefault">;</span> <span class="scilabnumber">1.5</span><span class="scilabdefault">;</span> <span class="scilabnumber">100</span><span class="scilabdefault">;</span> <span class="scilabnumber">100</span><span class="scilabdefault">;</span> <span class="scilabnumber">1000</span><span class="scilabopenclose">]</span><span class="scilabdefault">;</span> -<span class="scilabcomment">//and minimize 0.5*x</span><span class="scilabcomment">'</span><span class="scilabcomment">*Q*x + p</span><span class="scilabcomment">'</span><span class="scilabcomment">*x with</span> -<span class="scilabid">p</span><span class="scilaboperator">=</span><span class="scilabopenclose">[</span><span class="scilabnumber">1</span><span class="scilabdefault">;</span> <span class="scilabnumber">2</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">5</span><span class="scilabdefault">;</span> <span class="scilabnumber">6</span><span class="scilabopenclose">]</span><span class="scilabdefault">;</span> <span class="scilabid">Q</span><span class="scilaboperator">=</span><a class="scilabcommand" href="scilab://eye">eye</a><span class="scilabopenclose">(</span><span class="scilabnumber">6</span><span class="scilabdefault">,</span><span class="scilabnumber">6</span><span class="scilabopenclose">)</span><span class="scilabdefault">;</span> +<span class="scilabcomment">//and minimize 0.5*x</span><span class="scilabcomment">'</span><span class="scilabcomment">⋅H⋅x + f</span><span class="scilabcomment">'</span><span class="scilabcomment">⋅x with</span> +<span class="scilabid">f</span><span class="scilaboperator">=</span><span class="scilabopenclose">[</span><span class="scilabnumber">1</span><span class="scilabdefault">;</span> <span class="scilabnumber">2</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">5</span><span class="scilabdefault">;</span> <span class="scilabnumber">6</span><span class="scilabopenclose">]</span><span class="scilabdefault">;</span> <span class="scilabid">H</span><span class="scilaboperator">=</span><a class="scilabcommand" href="scilab://eye">eye</a><span class="scilabopenclose">(</span><span class="scilabnumber">6</span><span class="scilabdefault">,</span><span class="scilabnumber">6</span><span class="scilabopenclose">)</span><span class="scilabdefault">;</span> <span class="scilabid">nbVar</span> <span class="scilaboperator">=</span> <span class="scilabnumber">6</span><span class="scilabdefault">;</span> <span class="scilabid">nbCon</span> <span class="scilaboperator">=</span> <span class="scilabnumber">5</span><span class="scilabdefault">;</span> <span class="scilabid">x0</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="scilabid">nbVar</span><span class="scilabdefault">,</span><span class="scilabnumber">1</span><span class="scilabopenclose">)</span><span class="scilabdefault">;</span> <span class="scilabid">param</span> <span class="scilaboperator">=</span> <a class="scilabcommand" href="scilab://list">list</a><span class="scilabopenclose">(</span><span class="scilabstring">"</span><span class="scilabstring">MaxIter</span><span class="scilabstring">"</span><span class="scilabdefault">,</span> <span class="scilabnumber">300</span><span class="scilabdefault">,</span> <span class="scilabstring">"</span><span class="scilabstring">CpuTime</span><span class="scilabstring">"</span><span class="scilabdefault">,</span> <span class="scilabnumber">100</span><span class="scilabopenclose">)</span><span class="scilabdefault">;</span> -<span class="scilabopenclose">[</span><span class="scilabid">xopt</span><span class="scilabdefault">,</span><span class="scilabid">fopt</span><span class="scilabdefault">,</span><span class="scilabid">exitflag</span><span class="scilabdefault">,</span><span class="scilabid">output</span><span class="scilabdefault">,</span><span class="scilabid">lambda</span><span class="scilabopenclose">]</span><span class="scilaboperator">=</span><span class="scilabid">qpipopt</span><span class="scilabopenclose">(</span><span class="scilabid">nbVar</span><span class="scilabdefault">,</span><span class="scilabid">nbCon</span><span class="scilabdefault">,</span><span class="scilabid">Q</span><span class="scilabdefault">,</span><span class="scilabid">p</span><span class="scilabdefault">,</span><span class="scilabid">lb</span><span class="scilabdefault">,</span><span class="scilabid">ub</span><span class="scilabdefault">,</span><span class="scilabid">conMatrix</span><span class="scilabdefault">,</span><span class="scilabid">conLB</span><span class="scilabdefault">,</span><span class="scilabid">conUB</span><span class="scilabdefault">,</span><span class="scilabid">x0</span><span class="scilabdefault">,</span><span class="scilabid">param</span><span class="scilabopenclose">)</span> +<span class="scilabopenclose">[</span><span class="scilabid">xopt</span><span class="scilabdefault">,</span><span class="scilabid">fopt</span><span class="scilabdefault">,</span><span class="scilabid">exitflag</span><span class="scilabdefault">,</span><span class="scilabid">output</span><span class="scilabdefault">,</span><span class="scilabid">lambda</span><span class="scilabopenclose">]</span><span class="scilaboperator">=</span><span class="scilabid">qpipopt</span><span class="scilabopenclose">(</span><span class="scilabid">nbVar</span><span class="scilabdefault">,</span><span class="scilabid">nbCon</span><span class="scilabdefault">,</span><span class="scilabid">H</span><span class="scilabdefault">,</span><span class="scilabid">f</span><span class="scilabdefault">,</span><span class="scilabid">lb</span><span class="scilabdefault">,</span><span class="scilabid">ub</span><span class="scilabdefault">,</span><span class="scilabid">A</span><span class="scilabdefault">,</span><span class="scilabid">conLB</span><span class="scilabdefault">,</span><span class="scilabid">conUB</span><span class="scilabdefault">,</span><span class="scilabid">x0</span><span class="scilabdefault">,</span><span class="scilabid">param</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">Examples</h3> @@ -111,16 +111,16 @@ find the minimum of f(x) such that</p> <span class="scilabcomment">// –x1 + 2x2 ≤ 2</span> <span class="scilabcomment">// 2x1 + x2 ≤ 3</span> <span class="scilabcomment">// 0 ≤ x1, 0 ≤ x2.</span> -<span class="scilabid">Q</span> <span class="scilaboperator">=</span> <span class="scilabopenclose">[</span><span class="scilabnumber">1</span> <span class="scilaboperator">-</span><span class="scilabnumber">1</span><span class="scilabdefault">;</span> <span class="scilaboperator">-</span><span class="scilabnumber">1</span> <span class="scilabnumber">2</span><span class="scilabopenclose">]</span><span class="scilabdefault">;</span> -<span class="scilabid">p</span> <span class="scilaboperator">=</span> <span class="scilabopenclose">[</span><span class="scilaboperator">-</span><span class="scilabnumber">2</span><span class="scilabdefault">;</span> <span class="scilaboperator">-</span><span class="scilabnumber">6</span><span class="scilabopenclose">]</span><span class="scilabdefault">;</span> -<span class="scilabid">conMatrix</span> <span class="scilaboperator">=</span> <span class="scilabopenclose">[</span><span class="scilabnumber">1</span> <span class="scilabnumber">1</span><span class="scilabdefault">;</span> <span class="scilaboperator">-</span><span class="scilabnumber">1</span> <span class="scilabnumber">2</span><span class="scilabdefault">;</span> <span class="scilabnumber">2</span> <span class="scilabnumber">1</span><span class="scilabopenclose">]</span><span class="scilabdefault">;</span> +<span class="scilabid">H</span> <span class="scilaboperator">=</span> <span class="scilabopenclose">[</span><span class="scilabnumber">1</span> <span class="scilaboperator">-</span><span class="scilabnumber">1</span><span class="scilabdefault">;</span> <span class="scilaboperator">-</span><span class="scilabnumber">1</span> <span class="scilabnumber">2</span><span class="scilabopenclose">]</span><span class="scilabdefault">;</span> +<span class="scilabid">f</span> <span class="scilaboperator">=</span> <span class="scilabopenclose">[</span><span class="scilaboperator">-</span><span class="scilabnumber">2</span><span class="scilabdefault">;</span> <span class="scilaboperator">-</span><span class="scilabnumber">6</span><span class="scilabopenclose">]</span><span class="scilabdefault">;</span> +<span class="scilabid">A</span> <span class="scilaboperator">=</span> <span class="scilabopenclose">[</span><span class="scilabnumber">1</span> <span class="scilabnumber">1</span><span class="scilabdefault">;</span> <span class="scilaboperator">-</span><span class="scilabnumber">1</span> <span class="scilabnumber">2</span><span class="scilabdefault">;</span> <span class="scilabnumber">2</span> <span class="scilabnumber">1</span><span class="scilabopenclose">]</span><span class="scilabdefault">;</span> <span class="scilabid">conUB</span> <span class="scilaboperator">=</span> <span class="scilabopenclose">[</span><span class="scilabnumber">2</span><span class="scilabdefault">;</span> <span class="scilabnumber">2</span><span class="scilabdefault">;</span> <span class="scilabnumber">3</span><span class="scilabopenclose">]</span><span class="scilabdefault">;</span> <span class="scilabid">conLB</span> <span class="scilaboperator">=</span> <span class="scilabopenclose">[</span><span class="scilaboperator">-</span><span class="scilabconstants">%inf</span><span class="scilabdefault">;</span> <span class="scilaboperator">-</span><span class="scilabconstants">%inf</span><span class="scilabdefault">;</span> <span class="scilaboperator">-</span><span class="scilabconstants">%inf</span><span class="scilabopenclose">]</span><span class="scilabdefault">;</span> <span class="scilabid">lb</span> <span class="scilaboperator">=</span> <span class="scilabopenclose">[</span><span class="scilabnumber">0</span><span class="scilabdefault">;</span> <span class="scilabnumber">0</span><span class="scilabopenclose">]</span><span class="scilabdefault">;</span> <span class="scilabid">ub</span> <span class="scilaboperator">=</span> <span class="scilabopenclose">[</span><span class="scilabconstants">%inf</span><span class="scilabdefault">;</span> <span class="scilabconstants">%inf</span><span class="scilabopenclose">]</span><span class="scilabdefault">;</span> <span class="scilabid">nbVar</span> <span class="scilaboperator">=</span> <span class="scilabnumber">2</span><span class="scilabdefault">;</span> <span class="scilabid">nbCon</span> <span class="scilaboperator">=</span> <span class="scilabnumber">3</span><span class="scilabdefault">;</span> -<span class="scilabopenclose">[</span><span class="scilabid">xopt</span><span class="scilabdefault">,</span><span class="scilabid">fopt</span><span class="scilabdefault">,</span><span class="scilabid">exitflag</span><span class="scilabdefault">,</span><span class="scilabid">output</span><span class="scilabdefault">,</span><span class="scilabid">lambda</span><span class="scilabopenclose">]</span> <span class="scilaboperator">=</span> <span class="scilabid">qpipopt</span><span class="scilabopenclose">(</span><span class="scilabid">nbVar</span><span class="scilabdefault">,</span><span class="scilabid">nbCon</span><span class="scilabdefault">,</span><span class="scilabid">Q</span><span class="scilabdefault">,</span><span class="scilabid">p</span><span class="scilabdefault">,</span><span class="scilabid">lb</span><span class="scilabdefault">,</span><span class="scilabid">ub</span><span class="scilabdefault">,</span><span class="scilabid">conMatrix</span><span class="scilabdefault">,</span><span class="scilabid">conLB</span><span class="scilabdefault">,</span><span class="scilabid">conUB</span><span class="scilabopenclose">)</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> +<span class="scilabopenclose">[</span><span class="scilabid">xopt</span><span class="scilabdefault">,</span><span class="scilabid">fopt</span><span class="scilabdefault">,</span><span class="scilabid">exitflag</span><span class="scilabdefault">,</span><span class="scilabid">output</span><span class="scilabdefault">,</span><span class="scilabid">lambda</span><span class="scilabopenclose">]</span> <span class="scilaboperator">=</span> <span class="scilabid">qpipopt</span><span class="scilabopenclose">(</span><span class="scilabid">nbVar</span><span class="scilabdefault">,</span><span class="scilabid">nbCon</span><span class="scilabdefault">,</span><span class="scilabid">H</span><span class="scilabdefault">,</span><span class="scilabid">f</span><span class="scilabdefault">,</span><span class="scilabid">lb</span><span class="scilabdefault">,</span><span class="scilabid">ub</span><span class="scilabdefault">,</span><span class="scilabid">A</span><span class="scilabdefault">,</span><span class="scilabid">conLB</span><span class="scilabdefault">,</span><span class="scilabid">conUB</span><span class="scilabopenclose">)</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> diff --git a/help/en_US/scilab_en_US_help/qpipoptmat.html b/help/en_US/scilab_en_US_help/qpipoptmat.html index 2ed139d..73c7298 100644 --- a/help/en_US/scilab_en_US_help/qpipoptmat.html +++ b/help/en_US/scilab_en_US_help/qpipoptmat.html @@ -58,9 +58,9 @@ <dd><p class="para">a matrix of double, represents the linear coefficients in the equality constraints</p></dd></dt> <dt><span class="term">beq :</span> <dd><p class="para">a vector of double, represents the linear coefficients in the equality constraints</p></dd></dt> - <dt><span class="term">LB :</span> + <dt><span class="term">lb :</span> <dd><p class="para">a vector of double, contains lower bounds of the variables.</p></dd></dt> - <dt><span class="term">UB :</span> + <dt><span class="term">ub :</span> <dd><p class="para">a vector of double, contains upper bounds of the variables.</p></dd></dt> <dt><span class="term">x0 :</span> <dd><p class="para">a vector of double, contains initial guess of variables.</p></dd></dt> @@ -71,17 +71,17 @@ <dt><span class="term">fopt :</span> <dd><p class="para">a double, the function value at x.</p></dd></dt> <dt><span class="term">exitflag :</span> - <dd><p class="para">Integer identifying the reason the algorithm terminated.</p></dd></dt> + <dd><p class="para">Integer identifying the reason the algorithm terminated.It could be 0, 1 or 2 etc. i.e. Optimal, Maximum Number of Iterations Exceeded, CPU time exceeded. Other flags one can see in the qpipoptmat macro.</p></dd></dt> <dt><span class="term">output :</span> - <dd><p class="para">Structure containing information about the optimization. Right now it contains number of iteration.</p></dd></dt> + <dd><p class="para">Structure containing information about the optimization. This version only contains number of iterations.</p></dd></dt> <dt><span class="term">lambda :</span> <dd><p class="para">Structure containing the Lagrange multipliers at the solution x (separated by constraint type).It contains lower, upper and linear equality, inequality constraints.</p></dd></dt></dl></div> <div class="refsection"><h3 class="title">Description</h3> <p class="para">Search the minimum of a constrained linear quadratic optimization problem specified by : find the minimum of f(x) such that</p> - <p class="para"><span><img src='./_LaTeX_qpipoptmat.xml_1.png' style='position:relative;top:40px;width:284px;height:88px'/></span></p> - <p class="para">We are calling IPOpt for solving the quadratic problem, IPOpt is a library written in C++.</p> + <p class="para"><span><img src='./_LaTeX_qpipoptmat.xml_1.png' style='position:relative;top:41px;width:277px;height:90px'/></span></p> + <p class="para">The routine calls Ipopt for solving the quadratic problem, Ipopt is a library written in C++.</p> <p class="para"></p></div> <div class="refsection"><h3 class="title">Examples</h3> diff --git a/help/en_US/scilab_en_US_help/symphony.html b/help/en_US/scilab_en_US_help/symphony.html index 96be830..b81bbb0 100644 --- a/help/en_US/scilab_en_US_help/symphony.html +++ b/help/en_US/scilab_en_US_help/symphony.html @@ -37,9 +37,9 @@ <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">symphony</span><span class="default">(</span><span class="default">nbVar</span><span class="default">,</span><span class="default">nbCon</span><span class="default">,</span><span class="default">objCoef</span><span class="default">,</span><span class="default">isInt</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">conMatrix</span><span class="default">,</span><span class="default">conLB</span><span class="default">,</span><span class="default">conUB</span><span class="default">)</span> -<span class="default">xopt</span><span class="default"> = </span><span class="functionid">symphony</span><span class="default">(</span><span class="default">nbVar</span><span class="default">,</span><span class="default">nbCon</span><span class="default">,</span><span class="default">objCoef</span><span class="default">,</span><span class="default">isInt</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">conMatrix</span><span class="default">,</span><span class="default">conLB</span><span class="default">,</span><span class="default">conUB</span><span class="default">,</span><span class="default">objSense</span><span class="default">)</span> -<span class="default">xopt</span><span class="default"> = </span><span class="functionid">symphony</span><span class="default">(</span><span class="default">nbVar</span><span class="default">,</span><span class="default">nbCon</span><span class="default">,</span><span class="default">objCoef</span><span class="default">,</span><span class="default">isInt</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">conMatrix</span><span class="default">,</span><span class="default">conLB</span><span class="default">,</span><span class="default">conUB</span><span class="default">,</span><span class="default">objSense</span><span class="default">,</span><span class="default">options</span><span class="default">)</span> + <div class="synopsis"><pre><span class="default">xopt</span><span class="default"> = </span><span class="functionid">symphony</span><span class="default">(</span><span class="default">nbVar</span><span class="default">,</span><span class="default">nbCon</span><span class="default">,</span><span class="default">c</span><span class="default">,</span><span class="default">isInt</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">A</span><span class="default">,</span><span class="default">conLB</span><span class="default">,</span><span class="default">conUB</span><span class="default">)</span> +<span class="default">xopt</span><span class="default"> = </span><span class="functionid">symphony</span><span class="default">(</span><span class="default">nbVar</span><span class="default">,</span><span class="default">nbCon</span><span class="default">,</span><span class="default">c</span><span class="default">,</span><span class="default">isInt</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">A</span><span class="default">,</span><span class="default">conLB</span><span class="default">,</span><span class="default">conUB</span><span class="default">,</span><span class="default">objSense</span><span class="default">)</span> +<span class="default">xopt</span><span class="default"> = </span><span class="functionid">symphony</span><span class="default">(</span><span class="default">nbVar</span><span class="default">,</span><span class="default">nbCon</span><span class="default">,</span><span class="default">c</span><span class="default">,</span><span class="default">isInt</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">A</span><span class="default">,</span><span class="default">conLB</span><span class="default">,</span><span class="default">conUB</span><span class="default">,</span><span class="default">objSense</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">symphony</span><span class="default">( ... )</span></pre></div></div> <div class="refsection"><h3 class="title">Parameters</h3> @@ -47,15 +47,15 @@ <dd><p class="para">a double, number of variables.</p></dd></dt> <dt><span class="term">nbCon :</span> <dd><p class="para">a double, number of constraints.</p></dd></dt> - <dt><span class="term">objCoeff :</span> + <dt><span class="term">c :</span> <dd><p class="para">a vector of double, represents coefficients of the variables in the objective.</p></dd></dt> <dt><span class="term">isInt :</span> <dd><p class="para">a vector of boolean, represents wether a variable is constrained to be an integer.</p></dd></dt> - <dt><span class="term">LB :</span> + <dt><span class="term">lb :</span> <dd><p class="para">a vector of double, represents lower bounds of the variables.</p></dd></dt> - <dt><span class="term">UB :</span> + <dt><span class="term">ub :</span> <dd><p class="para">a vector of double, represents upper bounds of the variables.</p></dd></dt> - <dt><span class="term">conMatrix :</span> + <dt><span class="term">A :</span> <dd><p class="para">a matrix of double, represents matrix representing the constraint matrix.</p></dd></dt> <dt><span class="term">conLB :</span> <dd><p class="para">a vector of double, represents lower bounds of the constraints.</p></dd></dt> @@ -64,45 +64,45 @@ <dt><span class="term">objSense :</span> <dd><p class="para">The sense (maximization/minimization) of the objective. Use 1(sym_minimize ) or -1 (sym_maximize) here.</p></dd></dt> <dt><span class="term">options :</span> - <dd><p class="para">a a list containing the the parameters to be set.</p></dd></dt> + <dd><p class="para">a list containing the the parameters to be set.</p></dd></dt> <dt><span class="term">xopt :</span> <dd><p class="para">a vector of double, the computed solution of the optimization problem.</p></dd></dt> <dt><span class="term">fopt :</span> <dd><p class="para">a double, the function value at x.</p></dd></dt> <dt><span class="term">status :</span> - <dd><p class="para">status flag from symphony.</p></dd></dt> + <dd><p class="para">status flag from symphony. 227 is optimal, 228 is Time limit exceeded, 230 is iteration limit exceeded.</p></dd></dt> <dt><span class="term">output :</span> - <dd><p class="para">The output data structure contains detailed informations about the optimization process. Right now it contains number of iteration.</p></dd></dt></dl></div> + <dd><p class="para">The output data structure contains detailed information about the optimization process. This version only contains number of iterations</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 : find the minimum or maximum of f(x) such that</p> - <p class="para"><span><img src='./_LaTeX_symphony.xml_1.png' style='position:relative;top:41px;width:295px;height:90px'/></span></p> - <p class="para">We are calling SYMPHONY written in C by gateway files for the actual computation.</p> + <p class="para"><span><img src='./_LaTeX_symphony.xml_1.png' style='position:relative;top:41px;width:292px;height:90px'/></span></p> + <p class="para">The routine calls SYMPHONY written in C by gateway files for the actual computation.</p> <p class="para"></p></div> <div class="refsection"><h3 class="title">Examples</h3> <div class="programlisting"><table border="0" width="100%"><tr><td width="98%"><pre class="scilabcode"><span class="scilabcomment">//A basic case :</span> <span class="scilabcomment">// Objective function</span> -<span class="scilabid">objCoef</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">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">// 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">8</span><span class="scilabdefault">,</span><span class="scilabnumber">1</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">4</span><span class="scilabdefault">,</span><span class="scilabnumber">1</span><span class="scilabopenclose">)</span><span class="scilabdefault">;</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">4</span><span class="scilabdefault">,</span><span class="scilabnumber">1</span><span class="scilabopenclose">)</span><span class="scilabopenclose">]</span><span class="scilabdefault">;</span> <span class="scilabcomment">// Constraint Matrix</span> -<span class="scilabid">conMatrix</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="scilabid">A</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="scilabcomment">// Lower Bound of constrains</span> +<span class="scilabcomment">// Lower Bound of constraints</span> <span class="scilabid">conlb</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="scilabcomment">// Upper Bound of constrains</span> +<span class="scilabcomment">// Upper Bound of constraints</span> <span class="scilabid">conub</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="scilabcomment">// Row Matrix for telling symphony that the is integer or not</span> <span class="scilabid">isInt</span> <span class="scilaboperator">=</span> <span class="scilabopenclose">[</span><a class="scilabmacro" href="scilab://repmat">repmat</a><span class="scilabopenclose">(</span><span class="scilabconstants">%t</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">%f</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="scilabid">xopt</span> <span class="scilaboperator">=</span> <span class="scilabopenclose">[</span><span class="scilabnumber">1</span> <span class="scilabnumber">1</span> <span class="scilabnumber">0</span> <span class="scilabnumber">1</span> <span class="scilabnumber">7.25</span> <span class="scilabnumber">0</span> <span class="scilabnumber">0.25</span> <span class="scilabnumber">3.5</span><span class="scilabopenclose">]</span> <span class="scilabid">fopt</span> <span class="scilaboperator">=</span> <span class="scilabopenclose">[</span><span class="scilabnumber">8495</span><span class="scilabopenclose">]</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">symphony</span><span class="scilabopenclose">(</span><span class="scilabnumber">8</span><span class="scilabdefault">,</span><span class="scilabnumber">3</span><span class="scilabdefault">,</span><span class="scilabid">c</span><span class="scilabdefault">,</span><span class="scilabid">isInt</span><span class="scilabdefault">,</span><span class="scilabid">lb</span><span class="scilabdefault">,</span><span class="scilabid">ub</span><span class="scilabdefault">,</span><span class="scilabid">conMatrix</span><span class="scilabdefault">,</span><span class="scilabid">conlb</span><span class="scilabdefault">,</span><span class="scilabid">conub</span><span class="scilabdefault">,</span><span class="scilabnumber">1</span><span class="scilabopenclose">)</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">symphony</span><span class="scilabopenclose">(</span><span class="scilabnumber">8</span><span class="scilabdefault">,</span><span class="scilabnumber">3</span><span class="scilabdefault">,</span><span class="scilabid">c</span><span class="scilabdefault">,</span><span class="scilabid">isInt</span><span class="scilabdefault">,</span><span class="scilabid">lb</span><span class="scilabdefault">,</span><span class="scilabid">ub</span><span class="scilabdefault">,</span><span class="scilabid">A</span><span class="scilabdefault">,</span><span class="scilabid">conlb</span><span class="scilabdefault">,</span><span class="scilabid">conub</span><span class="scilabdefault">,</span><span class="scilabnumber">1</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">Examples</h3> @@ -116,7 +116,7 @@ find the minimum or maximum of f(x) such that</p> <span class="scilabcomment">// st sum{j=1,...,n} r(i,j)x(j) </span><span class="scilabcomment"><</span><span class="scilabcomment">= b(i) i=1,...,m</span> <span class="scilabcomment">// x(j)=0 or 1</span> <span class="scilabcomment">// The function to be maximize i.e. P(j)</span> -<span class="scilabid">p</span> <span class="scilaboperator">=</span> <span class="scilabopenclose">[</span> <span class="scilabnumber">504</span> <span class="scilabnumber">803</span> <span class="scilabnumber">667</span> <span class="scilabnumber">1103</span> <span class="scilabnumber">834</span> <span class="scilabnumber">585</span> <span class="scilabnumber">811</span> <span class="scilabnumber">856</span> <span class="scilabnumber">690</span> <span class="scilabnumber">832</span> <span class="scilabnumber">846</span> <span class="scilabnumber">813</span> <span class="scilabnumber">868</span> <span class="scilabnumber">793</span> <span class="scilabspecial">..</span> +<span class="scilabid">c</span> <span class="scilaboperator">=</span> <span class="scilabopenclose">[</span> <span class="scilabnumber">504</span> <span class="scilabnumber">803</span> <span class="scilabnumber">667</span> <span class="scilabnumber">1103</span> <span class="scilabnumber">834</span> <span class="scilabnumber">585</span> <span class="scilabnumber">811</span> <span class="scilabnumber">856</span> <span class="scilabnumber">690</span> <span class="scilabnumber">832</span> <span class="scilabnumber">846</span> <span class="scilabnumber">813</span> <span class="scilabnumber">868</span> <span class="scilabnumber">793</span> <span class="scilabspecial">..</span> <span class="scilabnumber">825</span> <span class="scilabnumber">1002</span> <span class="scilabnumber">860</span> <span class="scilabnumber">615</span> <span class="scilabnumber">540</span> <span class="scilabnumber">797</span> <span class="scilabnumber">616</span> <span class="scilabnumber">660</span> <span class="scilabnumber">707</span> <span class="scilabnumber">866</span> <span class="scilabnumber">647</span> <span class="scilabnumber">746</span> <span class="scilabnumber">1006</span> <span class="scilabnumber">608</span> <span class="scilabspecial">..</span> <span class="scilabnumber">877</span> <span class="scilabnumber">900</span> <span class="scilabnumber">573</span> <span class="scilabnumber">788</span> <span class="scilabnumber">484</span> <span class="scilabnumber">853</span> <span class="scilabnumber">942</span> <span class="scilabnumber">630</span> <span class="scilabnumber">591</span> <span class="scilabnumber">630</span> <span class="scilabnumber">640</span> <span class="scilabnumber">1169</span> <span class="scilabnumber">932</span> <span class="scilabnumber">1034</span> <span class="scilabspecial">..</span> <span class="scilabnumber">957</span> <span class="scilabnumber">798</span> <span class="scilabnumber">669</span> <span class="scilabnumber">625</span> <span class="scilabnumber">467</span> <span class="scilabnumber">1051</span> <span class="scilabnumber">552</span> <span class="scilabnumber">717</span> <span class="scilabnumber">654</span> <span class="scilabnumber">388</span> <span class="scilabnumber">559</span> <span class="scilabnumber">555</span> <span class="scilabnumber">1104</span> <span class="scilabnumber">783</span> <span class="scilabspecial">..</span> @@ -124,7 +124,7 @@ find the minimum or maximum of f(x) such that</p> <span class="scilabnumber">510</span> <span class="scilabnumber">671</span> <span class="scilabnumber">575</span> <span class="scilabnumber">740</span> <span class="scilabnumber">510</span> <span class="scilabnumber">675</span> <span class="scilabnumber">996</span> <span class="scilabnumber">636</span> <span class="scilabnumber">826</span> <span class="scilabnumber">1022</span> <span class="scilabnumber">1140</span> <span class="scilabnumber">654</span> <span class="scilabnumber">909</span> <span class="scilabnumber">799</span> <span class="scilabspecial">..</span> <span class="scilabnumber">1162</span> <span class="scilabnumber">653</span> <span class="scilabnumber">814</span> <span class="scilabnumber">625</span> <span class="scilabnumber">599</span> <span class="scilabnumber">476</span> <span class="scilabnumber">767</span> <span class="scilabnumber">954</span> <span class="scilabnumber">906</span> <span class="scilabnumber">904</span> <span class="scilabnumber">649</span> <span class="scilabnumber">873</span> <span class="scilabnumber">565</span> <span class="scilabnumber">853</span> <span class="scilabnumber">1008</span> <span class="scilabnumber">632</span><span class="scilabopenclose">]</span><span class="scilaboperator">'</span><span class="scilabdefault">;</span> <span class="scilabcomment">//Constraint Matrix</span> -<span class="scilabid">conMatrix</span> <span class="scilaboperator">=</span> <span class="scilabopenclose">[</span> +<span class="scilabid">A</span> <span class="scilaboperator">=</span> <span class="scilabopenclose">[</span> <span class="scilabcomment">//Constraint 1</span> <span class="scilabnumber">42</span> <span class="scilabnumber">41</span> <span class="scilabnumber">523</span> <span class="scilabnumber">215</span> <span class="scilabnumber">819</span> <span class="scilabnumber">551</span> <span class="scilabnumber">69</span> <span class="scilabnumber">193</span> <span class="scilabnumber">582</span> <span class="scilabnumber">375</span> <span class="scilabnumber">367</span> <span class="scilabnumber">478</span> <span class="scilabnumber">162</span> <span class="scilabnumber">898</span> <span class="scilabspecial">..</span> <span class="scilabnumber">550</span> <span class="scilabnumber">553</span> <span class="scilabnumber">298</span> <span class="scilabnumber">577</span> <span class="scilabnumber">493</span> <span class="scilabnumber">183</span> <span class="scilabnumber">260</span> <span class="scilabnumber">224</span> <span class="scilabnumber">852</span> <span class="scilabnumber">394</span> <span class="scilabnumber">958</span> <span class="scilabnumber">282</span> <span class="scilabnumber">402</span> <span class="scilabnumber">604</span> <span class="scilabspecial">..</span> @@ -166,15 +166,15 @@ find the minimum or maximum of f(x) such that</p> <span class="scilabnumber">483</span> <span class="scilabnumber">336</span> <span class="scilabnumber">765</span> <span class="scilabnumber">637</span> <span class="scilabnumber">981</span> <span class="scilabnumber">980</span> <span class="scilabnumber">202</span> <span class="scilabnumber">35</span> <span class="scilabnumber">594</span> <span class="scilabnumber">689</span> <span class="scilabnumber">602</span> <span class="scilabnumber">76</span> <span class="scilabnumber">767</span> <span class="scilabnumber">693</span> <span class="scilabspecial">..</span> <span class="scilabnumber">893</span> <span class="scilabnumber">160</span> <span class="scilabnumber">785</span> <span class="scilabnumber">311</span> <span class="scilabnumber">417</span> <span class="scilabnumber">748</span> <span class="scilabnumber">375</span> <span class="scilabnumber">362</span> <span class="scilabnumber">617</span> <span class="scilabnumber">553</span> <span class="scilabnumber">474</span> <span class="scilabnumber">915</span> <span class="scilabnumber">457</span> <span class="scilabnumber">261</span> <span class="scilabnumber">350</span> <span class="scilabnumber">635</span> <span class="scilabdefault">;</span> <span class="scilabopenclose">]</span><span class="scilabdefault">;</span> -<span class="scilabid">nbCon</span> <span class="scilaboperator">=</span> <a class="scilabcommand" href="scilab://size">size</a><span class="scilabopenclose">(</span><span class="scilabid">conMatrix</span><span class="scilabdefault">,</span><span class="scilabnumber">1</span><span class="scilabopenclose">)</span> -<span class="scilabid">nbVar</span> <span class="scilaboperator">=</span> <a class="scilabcommand" href="scilab://size">size</a><span class="scilabopenclose">(</span><span class="scilabid">conMatrix</span><span class="scilabdefault">,</span><span class="scilabnumber">2</span><span class="scilabopenclose">)</span> +<span class="scilabid">nbCon</span> <span class="scilaboperator">=</span> <a class="scilabcommand" href="scilab://size">size</a><span class="scilabopenclose">(</span><span class="scilabid">A</span><span class="scilabdefault">,</span><span class="scilabnumber">1</span><span class="scilabopenclose">)</span> +<span class="scilabid">nbVar</span> <span class="scilaboperator">=</span> <a class="scilabcommand" href="scilab://size">size</a><span class="scilabopenclose">(</span><span class="scilabid">A</span><span class="scilabdefault">,</span><span class="scilabnumber">2</span><span class="scilabopenclose">)</span> <span class="scilabcomment">// Lower Bound of variables</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="scilabid">nbVar</span><span class="scilabdefault">,</span><span class="scilabnumber">1</span><span class="scilabopenclose">)</span> <span class="scilabcomment">// Upper Bound of variables</span> <span class="scilabid">ub</span> <span class="scilaboperator">=</span> <a class="scilabmacro" href="scilab://repmat">repmat</a><span class="scilabopenclose">(</span><span class="scilabnumber">1</span><span class="scilabdefault">,</span><span class="scilabid">nbVar</span><span class="scilabdefault">,</span><span class="scilabnumber">1</span><span class="scilabopenclose">)</span> <span class="scilabcomment">// Row Matrix for telling symphony that the is integer or not</span> <span class="scilabid">isInt</span> <span class="scilaboperator">=</span> <a class="scilabmacro" href="scilab://repmat">repmat</a><span class="scilabopenclose">(</span><span class="scilabconstants">%t</span><span class="scilabdefault">,</span><span class="scilabnumber">1</span><span class="scilabdefault">,</span><span class="scilabid">nbVar</span><span class="scilabopenclose">)</span> -<span class="scilabcomment">// Lower Bound of constrains</span> +<span class="scilabcomment">// Lower Bound of constraints</span> <span class="scilabid">conLB</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="scilabid">nbCon</span><span class="scilabdefault">,</span><span class="scilabnumber">1</span><span class="scilabopenclose">)</span><span class="scilabdefault">;</span> <span class="scilabcomment">// Upper Bound of constraints</span> <span class="scilabid">conUB</span><span class="scilaboperator">=</span><span class="scilabopenclose">[</span><span class="scilabnumber">11927</span> <span class="scilabnumber">13727</span> <span class="scilabnumber">11551</span> <span class="scilabnumber">13056</span> <span class="scilabnumber">13460</span> <span class="scilabopenclose">]</span><span class="scilaboperator">'</span><span class="scilabdefault">;</span> @@ -187,7 +187,7 @@ find the minimum or maximum of f(x) such that</p> <span class="scilabcomment">// Optimal value</span> <span class="scilabid">fopt</span> <span class="scilaboperator">=</span> <span class="scilabopenclose">[</span> <span class="scilabnumber">24381</span> <span class="scilabopenclose">]</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">symphony</span><span class="scilabopenclose">(</span><span class="scilabid">nbVar</span><span class="scilabdefault">,</span><span class="scilabid">nbCon</span><span class="scilabdefault">,</span><span class="scilabid">p</span><span class="scilabdefault">,</span><span class="scilabid">isInt</span><span class="scilabdefault">,</span><span class="scilabid">lb</span><span class="scilabdefault">,</span><span class="scilabid">ub</span><span class="scilabdefault">,</span><span class="scilabid">conMatrix</span><span class="scilabdefault">,</span><span class="scilabid">conLB</span><span class="scilabdefault">,</span><span class="scilabid">conUB</span><span class="scilabdefault">,</span><span class="scilaboperator">-</span><span class="scilabnumber">1</span><span class="scilabdefault">,</span><span class="scilabid">options</span><span class="scilabopenclose">)</span><span class="scilabdefault">;</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> +<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">symphony</span><span class="scilabopenclose">(</span><span class="scilabid">nbVar</span><span class="scilabdefault">,</span><span class="scilabid">nbCon</span><span class="scilabdefault">,</span><span class="scilabid">c</span><span class="scilabdefault">,</span><span class="scilabid">isInt</span><span class="scilabdefault">,</span><span class="scilabid">lb</span><span class="scilabdefault">,</span><span class="scilabid">ub</span><span class="scilabdefault">,</span><span class="scilabid">A</span><span class="scilabdefault">,</span><span class="scilabid">conLB</span><span class="scilabdefault">,</span><span class="scilabid">conUB</span><span class="scilabdefault">,</span><span class="scilaboperator">-</span><span class="scilabnumber">1</span><span class="scilabdefault">,</span><span class="scilabid">options</span><span class="scilabopenclose">)</span><span class="scilabdefault">;</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> diff --git a/help/en_US/scilab_en_US_help/symphony.html~ b/help/en_US/scilab_en_US_help/symphony.html~ deleted file mode 100644 index 0b78b0d..0000000 --- a/help/en_US/scilab_en_US_help/symphony.html~ +++ /dev/null @@ -1,318 +0,0 @@ -<html><head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> - <title>fmincon</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_ed3c614d9a2555a6802170ca29940f55.html"><< Fmincon Toolbox</a></span> - - </td> - <td width="40%" class="center"> - <span class="top"><a href="section_ed3c614d9a2555a6802170ca29940f55.html">Fmincon Toolbox</a></span> - - </td> - <td width="30%" class="next"> - <span class="next"><a href="optimget.html">optimget >></a></span> - - </td> - </tr></table> - <hr /> - </div> - - - - <span class="path"><a href="index.html">Fmincon Toolbox</a> >> <a href="section_ed3c614d9a2555a6802170ca29940f55.html">Fmincon Toolbox</a> > fmincon</span> - - <br /><br /> - <div class="info"></div> - - <div class="refnamediv"><h1 class="refname">fmincon</h1><p class="refpurpose">Solves a nonlinearily constrained optimization problem.</p></div> - - - -<div class="refsynopsisdiv"><h3 class="title">Calling Sequence</h3> - <div class="synopsis"><pre><span class="default">x</span><span class="default"> = </span><span class="functionid">fmincon</span><span class="default">(</span><span class="default">fun</span><span class="default">,</span><span class="default">x0</span><span class="default">)</span> -<span class="default">x</span><span class="default"> = </span><span class="functionid">fmincon</span><span class="default">(</span><span class="default">fun</span><span class="default">,</span><span class="default">x0</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">x</span><span class="default"> = </span><span class="functionid">fmincon</span><span class="default">(</span><span class="default">fun</span><span class="default">,</span><span class="default">x0</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">x</span><span class="default"> = </span><span class="functionid">fmincon</span><span class="default">(</span><span class="default">fun</span><span class="default">,</span><span class="default">x0</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">x</span><span class="default"> = </span><span class="functionid">fmincon</span><span class="default">(</span><span class="default">fun</span><span class="default">,</span><span class="default">x0</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">nonlcon</span><span class="default">)</span> -<span class="default">x</span><span class="default"> = </span><span class="functionid">fmincon</span><span class="default">(</span><span class="default">fun</span><span class="default">,</span><span class="default">x0</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">nonlcon</span><span class="default">,</span><span class="default">options</span><span class="default">)</span> -<span class="default">[</span><span class="default">x</span><span class="default">,</span><span class="default">fval</span><span class="default">,</span><span class="default">exitflag</span><span class="default">,</span><span class="default">output</span><span class="default">,</span><span class="default">lambda</span><span class="default">,</span><span class="default">grad</span><span class="default">,</span><span class="default">hessian</span><span class="default">] = </span><span class="functionid">fmincon</span><span class="default"> ( ... )</span></pre></div></div> - -<div class="refsection"><h3 class="title">Parameters</h3> - <dl><dt><span class="term">fun:</span> - <dd><p class="para">a function, the function to minimize. See below for the complete specifications.</p></dd></dt> - <dt><span class="term">x0:</span> - <dd><p class="para">a nx1 or 1xn matrix of doubles, where n is the number of variables. The initial guess for the optimization algorithm.</p></dd></dt> - <dt><span class="term">A:</span> - <dd><p class="para">a nil x n matrix of doubles, where n is the number of variables and nil is the number of linear inequalities. If A==[] and b==[], it is assumed that there is no linear inequality constraints. If (A==[] & b<>[]), fmincon generates an error (the same happens if (A<>[] & b==[])).</p></dd></dt> - <dt><span class="term">b:</span> - <dd><p class="para">a nil x 1 matrix of doubles, where nil is the number of linear inequalities.</p></dd></dt> - <dt><span class="term">Aeq:</span> - <dd><p class="para">a nel x n matrix of doubles, where n is the number of variables and nel is the number of linear equalities. If A==[] and b==[], it is assumed that there is no linear equality constraints. If (Aeq==[] & beq<>[]), fmincon generates an error (the same happens if (Aeq<>[] & beq==[])).</p></dd></dt> - <dt><span class="term">beq:</span> - <dd><p class="para">a nel x 1 matrix of doubles, where nel is the number of linear inequalities.</p></dd></dt> - <dt><span class="term">lb:</span> - <dd><p class="para">a nx1 or 1xn matrix of doubles, where n is the number of variables. The lower bound for x. If lb==[], then the lower bound is automatically set to -inf.</p></dd></dt> - <dt><span class="term">ub:</span> - <dd><p class="para">a nx1 or 1xn matrix of doubles, where n is the number of variables. The upper bound for x. If lb==[], then the upper bound is automatically set to +inf.</p></dd></dt> - <dt><span class="term">nonlcon:</span> - <dd><p class="para">a function, the nonlinear constraints. See below for the complete specifications.</p></dd></dt> - <dt><span class="term">x:</span> - <dd><p class="para">a nx1 matrix of doubles, the computed solution of the optimization problem</p></dd></dt> - <dt><span class="term">fval:</span> - <dd><p class="para">a 1x1 matrix of doubles, the function value at x</p></dd></dt> - <dt><span class="term">exitflag:</span> - <dd><p class="para">a 1x1 matrix of floating point integers, the exit status. See below for details.</p></dd></dt> - <dt><span class="term">output:</span> - <dd><p class="para">a struct, the details of the optimization process. See below for details.</p></dd></dt> - <dt><span class="term">lambda:</span> - <dd><p class="para">a struct, the Lagrange multipliers at optimum. See below for details.</p></dd></dt> - <dt><span class="term">grad:</span> - <dd><p class="para">a nx1 matrix of doubles, the gradient of the objective function at optimum</p></dd></dt> - <dt><span class="term">hessian:</span> - <dd><p class="para">a nxn matrix of doubles, the Hessian of the objective function at optimum</p></dd></dt> - <dt><span class="term">options:</span> - <dd><p class="para">an optional struct, as provided by optimset</p></dd></dt></dl></div> - -<div class="refsection"><h3 class="title">Description</h3> - <p class="para">Search the minimum of a constrained optimization problem specified by : -find the minimum of f(x) such that</p> - <p class="para">c(x)<=0, ceq(x)<=0, A*x<=b, Aeq*x=beq and lb<=x<=ub.</p> - <p class="para"><span><img src='./_LaTeX_fmincon.xml_1.png' style='position:relative;top:64px;width:186px;height:136px'/></span></p> - <p class="para">Currently, we use ipopt for the actual solver of fmincon.</p> - <p class="para">See the demonstrations for additionnal examples.</p> - <p class="para">The objective function must have header : -<div class="programlisting"><table border="0" width="100%"><tr><td width="98%"><pre class="scilabcode"><span class="scilabid">f</span> <span class="scilaboperator">=</span> <span class="scilabid">objfun</span> <span class="scilabopenclose">(</span> <span class="scilabid">x</span> <span class="scilabopenclose">)</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> -where x is a n x 1 matrix of doubles and f is a 1 x 1 matrix of doubles. -On input, the variable x contains the current point and, on output, -the variable f must contain the objective function value.</p> - <p class="para">By default, fmincon uses finite differences with order 2 formulas and -optimum step size in order to compute a numerical gradient of the -objective function. -If we can provide exact gradients, we should do so since it improves -the convergence speed of the optimization algorithm. -In order to use exact gradients, we must update the header of the -objective function to : -<div class="programlisting"><table border="0" width="100%"><tr><td width="98%"><pre class="scilabcode"><span class="scilabopenclose">[</span><span class="scilabid">f</span><span class="scilabdefault">,</span><span class="scilabid">G</span><span class="scilabopenclose">]</span> <span class="scilaboperator">=</span> <span class="scilabid">objfungrad</span> <span class="scilabopenclose">(</span> <span class="scilabid">x</span> <span class="scilabopenclose">)</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> -where x is a n x 1 matrix of doubles, f is a 1 x 1 matrix of doubles -and G is a n x 1 matrix of doubles. -On input, the variable x contains the current point and, on output, -the variable f must contain the objective function value and the variable -G must contain the gradient of the objective function. -Furthermore, we must enable the "GradObj" option with the statement : -<div class="programlisting"><table border="0" width="100%"><tr><td width="98%"><pre class="scilabcode"><span class="scilabid">options</span> <span class="scilaboperator">=</span> <a class="scilabmacro" href="optimset.html">optimset</a><span class="scilabopenclose">(</span><span class="scilabstring">"</span><span class="scilabstring">GradObj</span><span class="scilabstring">"</span><span class="scilabdefault">,</span><span class="scilabstring">"</span><span class="scilabstring">on</span><span class="scilabstring">"</span><span class="scilabopenclose">)</span><span class="scilabdefault">;</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> -This will let fmincon know that the exact gradient of the objective -function is known, so that it can change the calling sequence to the -objective function.</p> - <p class="para">The constraint function must have header : -<div class="programlisting"><table border="0" width="100%"><tr><td width="98%"><pre class="scilabcode"><span class="scilabopenclose">[</span><span class="scilabid">c</span><span class="scilabdefault">,</span> <span class="scilabid">ceq</span><span class="scilabopenclose">]</span> <span class="scilaboperator">=</span> <span class="scilabid">confun</span><span class="scilabopenclose">(</span><span class="scilabid">x</span><span class="scilabopenclose">)</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> -where x is a n x 1 matrix of doubles, c is a nni x 1 matrix of doubles and -ceq is a nne x 1 matrix of doubles (nni : number of nonlinear inequality -constraints, nne : number of nonlinear equality constraints). -On input, the variable x contains the current point and, on output, -the variable c must contain the nonlinear inequality constraints and ceq must contain the -nonlinear equality constraints.</p> - <p class="para">By default, fmincon uses finite differences with order 2 formulas and -optimum step size in order to compute a numerical gradient of the -constraint function. -In order to use exact gradients, we must update the header of the -constraint function to : -<div class="programlisting"><table border="0" width="100%"><tr><td width="98%"><pre class="scilabcode"><span class="scilabopenclose">[</span><span class="scilabid">c</span><span class="scilabdefault">,</span><span class="scilabid">ceq</span><span class="scilabdefault">,</span><span class="scilabid">DC</span><span class="scilabdefault">,</span><span class="scilabid">DCeq</span><span class="scilabopenclose">]</span> <span class="scilaboperator">=</span> <span class="scilabid">confungrad</span><span class="scilabopenclose">(</span><span class="scilabid">x</span><span class="scilabopenclose">)</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> -where x is a n x 1 matrix of doubles, c is a nni x 1 matrix of doubles, -ceq is a nne x 1 matrix of doubles, DC is a n x nni matrix of doubles and -DCeq is a n x nne matrix of doubles. -On input, the variable x contains the current point and, on output, -the variable c must contain the nonlinear inequality constraint function value, -the variable ceq must contain the nonlinear equality constraint function value, -the variable DC must contain the Jacobian matrix of the nonlinear inequality constraints -and the variable DCeq must contain the Jacobian matrix of the nonlinear equality constraints. -The i-th nonlinear inequality constraint is associated to the i-th column of -the matrix DC, i.e, it is stored in DC(:,i) (same for DCeq). -Furthermore, we must enable the "GradObj" option with the statement : -<div class="programlisting"><table border="0" width="100%"><tr><td width="98%"><pre class="scilabcode"><span class="scilabid">options</span> <span class="scilaboperator">=</span> <a class="scilabmacro" href="optimset.html">optimset</a><span class="scilabopenclose">(</span><span class="scilabstring">"</span><span class="scilabstring">GradConstr</span><span class="scilabstring">"</span><span class="scilabdefault">,</span><span class="scilabstring">"</span><span class="scilabstring">on</span><span class="scilabstring">"</span><span class="scilabopenclose">)</span><span class="scilabdefault">;</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></p> - <p class="para">By default, fmincon uses a L-BFGS formula to compute an -approximation of the Hessian of the Lagrangian. -Notice that this is different from Matlab's fmincon, which -default is to use a BFGS.</p> - <p class="para">The exitflag variable allows to know the status of the optimization. -<ul class="itemizedlist"><li>exitflag=0 : Number of iterations exceeded options.MaxIter or number of function evaluations exceeded options.FunEvals.</li> -<li>exitflag=1 : First-order optimality measure was less than options.TolFun, and maximum constraint violation was less than options.TolCon.</li> -<li>exitflag=-1 : The output function terminated the algorithm.</li> -<li>exitflag=-2 : No feasible point was found.</li> -<li>exitflag=%nan : Other type of termination.</li></ul></p> - <p class="para">The output data structure contains detailed informations about the -optimization process. -It has type "struct" and contains the following fields. -<ul class="itemizedlist"><li>output.iterations: the number of iterations performed during the search</li> -<li>output.funcCount: the number of function evaluations during the search</li> -<li>output.stepsize: an empty matrix</li> -<li>output.algorithm : the string containing the name of the algorithm. In the current version, algorithm="ipopt".</li> -<li>output.firstorderopt: the max-norm of the first-order KKT conditions.</li> -<li>output.constrviolation: the max-norm of the constraint violation.</li> -<li>output.cgiterations: the number of preconditionned conjugate gradient steps. In the current version, cgiterations=0.</li> -<li>output.message: a string containing a message describing the status of the optimization.</li></ul></p> - <p class="para">The lambda data structure contains the Lagrange multipliers at the -end of optimization. -It has type "struct" and contains the following -fields. -<ul class="itemizedlist"><li>lambda.lower: the Lagrange multipliers for the lower bound constraints. In the current version, an empty matrix.</li> -<li>lambda.upper: the Lagrange multipliers for the upper bound constraints. In the current version, an empty matrix.</li> -<li>lambda.eqlin: the Lagrange multipliers for the linear equality constraints.</li> -<li>lambda.eqnonlin: the Lagrange multipliers for the nonlinear equality constraints.</li> -<li>lambda.ineqlin: the Lagrange multipliers for the linear inequality constraints.</li> -<li>lambda.ineqnonlin: the Lagrange multipliers for the nonlinear inequality constraints.</li></ul></p> - <p class="para">TODO : exitflag=2 : Change in x was less than options.TolX and maximum constraint violation was less than options.TolCon. -TODO : exitflag=-3 : Current point x went below options.ObjectiveLimit and maximum constraint violation was less than options.TolCon. -TODO : fill lambda.lower and lambda.upper consistently. See ticket #111 : http://forge.scilab.org/index.php/p/sci-ipopt/issues/111/ -TODO : test with A, b -TODO : test with Aeq, beq -TODO : test with ceq -TODO : avoid using global for ipopt_data -TODO : implement Display option -TODO : implement FinDiffType option -TODO : implement MaxFunEvals option -TODO : implement DerivativeCheck option -TODO : implement MaxIter option -TODO : implement OutputFcn option -TODO : implement PlotFcns option -TODO : implement TolFun option -TODO : implement TolCon option -TODO : implement TolX option -TODO : implement Hessian option -TODO : check that the hessian output argument is Hessian of f only -TODO : test all exitflag values</p> - <p class="para"></p></div> - -<div class="refsection"><h3 class="title">Examples</h3> - <div class="programlisting"><table border="0" width="100%"><tr><td width="98%"><pre class="scilabcode"><span class="scilabcomment">// A basic case :</span> -<span class="scilabcomment">// we provide only the objective function and the nonlinear constraint</span> -<span class="scilabcomment">// function : we let fmincon compute the gradients by numerical</span> -<span class="scilabcomment">// derivatives.</span> -<span class="scilabfkeyword">function</span> <span class="scilabinputoutputargs">f</span><span class="scilaboperator">=</span><span class="scilabfunctionid">objfun</span><span class="scilabopenclose">(</span><span class="scilabinputoutputargs">x</span><span class="scilabopenclose">)</span> -<span class="scilabinputoutputargs">f</span> <span class="scilaboperator">=</span> <a class="scilabcommand" href="scilab://exp">exp</a><span class="scilabopenclose">(</span><span class="scilabinputoutputargs">x</span><span class="scilabopenclose">(</span><span class="scilabnumber">1</span><span class="scilabopenclose">)</span><span class="scilabopenclose">)</span><span class="scilaboperator">*</span><span class="scilabopenclose">(</span><span class="scilabnumber">4</span><span class="scilaboperator">*</span><span class="scilabinputoutputargs">x</span><span class="scilabopenclose">(</span><span class="scilabnumber">1</span><span class="scilabopenclose">)</span><span class="scilaboperator">^</span><span class="scilabnumber">2</span> <span class="scilaboperator">+</span> <span class="scilabnumber">2</span><span class="scilaboperator">*</span><span class="scilabinputoutputargs">x</span><span class="scilabopenclose">(</span><span class="scilabnumber">2</span><span class="scilabopenclose">)</span><span class="scilaboperator">^</span><span class="scilabnumber">2</span> <span class="scilaboperator">+</span> <span class="scilabnumber">4</span><span class="scilaboperator">*</span><span class="scilabinputoutputargs">x</span><span class="scilabopenclose">(</span><span class="scilabnumber">1</span><span class="scilabopenclose">)</span><span class="scilaboperator">*</span><span class="scilabinputoutputargs">x</span><span class="scilabopenclose">(</span><span class="scilabnumber">2</span><span class="scilabopenclose">)</span> <span class="scilaboperator">+</span> <span class="scilabnumber">2</span><span class="scilaboperator">*</span><span class="scilabinputoutputargs">x</span><span class="scilabopenclose">(</span><span class="scilabnumber">2</span><span class="scilabopenclose">)</span> <span class="scilaboperator">+</span> <span class="scilabnumber">1</span><span class="scilabopenclose">)</span> -<span class="scilabfkeyword">endfunction</span> -<span class="scilabfkeyword">function</span> <span class="scilabopenclose">[</span><span class="scilabinputoutputargs">c</span><span class="scilabdefault">, </span><span class="scilabinputoutputargs">ceq</span><span class="scilabopenclose">]</span><span class="scilaboperator">=</span><span class="scilabfunctionid">confun</span><span class="scilabopenclose">(</span><span class="scilabinputoutputargs">x</span><span class="scilabopenclose">)</span> -<span class="scilabcomment">// Nonlinear inequality constraints</span> -<span class="scilabinputoutputargs">c</span> <span class="scilaboperator">=</span> <span class="scilabopenclose">[</span> -<span class="scilabnumber">1.5</span> <span class="scilaboperator">+</span> <span class="scilabinputoutputargs">x</span><span class="scilabopenclose">(</span><span class="scilabnumber">1</span><span class="scilabopenclose">)</span><span class="scilaboperator">*</span><span class="scilabinputoutputargs">x</span><span class="scilabopenclose">(</span><span class="scilabnumber">2</span><span class="scilabopenclose">)</span> <span class="scilaboperator">-</span> <span class="scilabinputoutputargs">x</span><span class="scilabopenclose">(</span><span class="scilabnumber">1</span><span class="scilabopenclose">)</span> <span class="scilaboperator">-</span> <span class="scilabinputoutputargs">x</span><span class="scilabopenclose">(</span><span class="scilabnumber">2</span><span class="scilabopenclose">)</span> -<span class="scilaboperator">-</span><span class="scilabinputoutputargs">x</span><span class="scilabopenclose">(</span><span class="scilabnumber">1</span><span class="scilabopenclose">)</span><span class="scilaboperator">*</span><span class="scilabinputoutputargs">x</span><span class="scilabopenclose">(</span><span class="scilabnumber">2</span><span class="scilabopenclose">)</span> <span class="scilaboperator">-</span> <span class="scilabnumber">10</span> -<span class="scilabopenclose">]</span> -<span class="scilabcomment">// Nonlinear equality constraints</span> -<span class="scilabinputoutputargs">ceq</span> <span class="scilaboperator">=</span> <span class="scilabopenclose">[</span><span class="scilabopenclose">]</span> -<span class="scilabfkeyword">endfunction</span> -<span class="scilabcomment">// The initial guess</span> -<span class="scilabid">x0</span> <span class="scilaboperator">=</span> <span class="scilabopenclose">[</span><span class="scilaboperator">-</span><span class="scilabnumber">1</span><span class="scilabdefault">,</span><span class="scilabnumber">1</span><span class="scilabopenclose">]</span><span class="scilabdefault">;</span> -<span class="scilabcomment">// The expected solution : only 4 digits are guaranteed</span> -<span class="scilabid">xopt</span> <span class="scilaboperator">=</span> <span class="scilabopenclose">[</span><span class="scilaboperator">-</span><span class="scilabnumber">9.547345885974547</span> <span class="scilabnumber">1.047408305349257</span><span class="scilabopenclose">]</span> -<span class="scilabid">fopt</span> <span class="scilaboperator">=</span> <span class="scilabnumber">0.023551460139148</span> -<span class="scilabcomment">// Run fmincon</span> -<span class="scilabopenclose">[</span><span class="scilabid">x</span><span class="scilabdefault">,</span><span class="scilabid">fval</span><span class="scilabdefault">,</span><span class="scilabid">exitflag</span><span class="scilabdefault">,</span><span class="scilabid">output</span><span class="scilabdefault">,</span><span class="scilabid">lambda</span><span class="scilabdefault">,</span><span class="scilabid">grad</span><span class="scilabdefault">,</span><span class="scilabid">hessian</span><span class="scilabopenclose">]</span> <span class="scilaboperator">=</span> <span class="scilabspecial">..</span> -<span class="scilabid">fmincon</span> <span class="scilabopenclose">(</span> <span class="scilabfunctionid">objfun</span><span class="scilabdefault">,</span><span class="scilabid">x0</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="scilabopenclose">[</span><span class="scilabopenclose">]</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="scilabopenclose">[</span><span class="scilabopenclose">]</span><span class="scilabdefault">,</span> <span class="scilabfunctionid">confun</span> <span class="scilabstring">)</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">Examples</h3> - <div class="programlisting"><table border="0" width="100%"><tr><td width="98%"><pre class="scilabcode"><span class="scilabcomment">// A case where we provide the gradient of the objective</span> -<span class="scilabcomment">// function and the Jacobian matrix of the constraints.</span> -<span class="scilabcomment">// The objective function and its gradient</span> -<span class="scilabfkeyword">function</span> <span class="scilabopenclose">[</span><span class="scilabinputoutputargs">f</span><span class="scilabdefault">, </span><span class="scilabinputoutputargs">G</span><span class="scilabopenclose">]</span><span class="scilaboperator">=</span><span class="scilabfunctionid">objfungrad</span><span class="scilabopenclose">(</span><span class="scilabinputoutputargs">x</span><span class="scilabopenclose">)</span> -<span class="scilabopenclose">[</span><span class="scilabid">lhs</span><span class="scilabdefault">,</span><span class="scilabid">rhs</span><span class="scilabopenclose">]</span><span class="scilaboperator">=</span><a class="scilabcommand" href="scilab://argn">argn</a><span class="scilabopenclose">(</span><span class="scilabopenclose">)</span> -<span class="scilabinputoutputargs">f</span> <span class="scilaboperator">=</span> <a class="scilabcommand" href="scilab://exp">exp</a><span class="scilabopenclose">(</span><span class="scilabinputoutputargs">x</span><span class="scilabopenclose">(</span><span class="scilabnumber">1</span><span class="scilabopenclose">)</span><span class="scilabopenclose">)</span><span class="scilaboperator">*</span><span class="scilabopenclose">(</span><span class="scilabnumber">4</span><span class="scilaboperator">*</span><span class="scilabinputoutputargs">x</span><span class="scilabopenclose">(</span><span class="scilabnumber">1</span><span class="scilabopenclose">)</span><span class="scilaboperator">^</span><span class="scilabnumber">2</span><span class="scilaboperator">+</span><span class="scilabnumber">2</span><span class="scilaboperator">*</span><span class="scilabinputoutputargs">x</span><span class="scilabopenclose">(</span><span class="scilabnumber">2</span><span class="scilabopenclose">)</span><span class="scilaboperator">^</span><span class="scilabnumber">2</span><span class="scilaboperator">+</span><span class="scilabnumber">4</span><span class="scilaboperator">*</span><span class="scilabinputoutputargs">x</span><span class="scilabopenclose">(</span><span class="scilabnumber">1</span><span class="scilabopenclose">)</span><span class="scilaboperator">*</span><span class="scilabinputoutputargs">x</span><span class="scilabopenclose">(</span><span class="scilabnumber">2</span><span class="scilabopenclose">)</span><span class="scilaboperator">+</span><span class="scilabnumber">2</span><span class="scilaboperator">*</span><span class="scilabinputoutputargs">x</span><span class="scilabopenclose">(</span><span class="scilabnumber">2</span><span class="scilabopenclose">)</span><span class="scilaboperator">+</span><span class="scilabnumber">1</span><span class="scilabopenclose">)</span> -<span class="scilabskeyword">if</span> <span class="scilabopenclose">(</span> <span class="scilabid">lhs</span> <span class="scilaboperator">></span> <span class="scilabnumber">1</span> <span class="scilabopenclose">)</span> <span class="scilabskeyword">then</span> -<span class="scilabinputoutputargs">G</span> <span class="scilaboperator">=</span> <span class="scilabopenclose">[</span> -<span class="scilabinputoutputargs">f</span> <span class="scilaboperator">+</span> <a class="scilabcommand" href="scilab://exp">exp</a><span class="scilabopenclose">(</span><span class="scilabinputoutputargs">x</span><span class="scilabopenclose">(</span><span class="scilabnumber">1</span><span class="scilabopenclose">)</span><span class="scilabopenclose">)</span> <span class="scilaboperator">*</span> <span class="scilabopenclose">(</span><span class="scilabnumber">8</span><span class="scilaboperator">*</span><span class="scilabinputoutputargs">x</span><span class="scilabopenclose">(</span><span class="scilabnumber">1</span><span class="scilabopenclose">)</span> <span class="scilaboperator">+</span> <span class="scilabnumber">4</span><span class="scilaboperator">*</span><span class="scilabinputoutputargs">x</span><span class="scilabopenclose">(</span><span class="scilabnumber">2</span><span class="scilabopenclose">)</span><span class="scilabopenclose">)</span> -<a class="scilabcommand" href="scilab://exp">exp</a><span class="scilabopenclose">(</span><span class="scilabinputoutputargs">x</span><span class="scilabopenclose">(</span><span class="scilabnumber">1</span><span class="scilabopenclose">)</span><span class="scilabopenclose">)</span><span class="scilaboperator">*</span><span class="scilabopenclose">(</span><span class="scilabnumber">4</span><span class="scilaboperator">*</span><span class="scilabinputoutputargs">x</span><span class="scilabopenclose">(</span><span class="scilabnumber">1</span><span class="scilabopenclose">)</span><span class="scilaboperator">+</span><span class="scilabnumber">4</span><span class="scilaboperator">*</span><span class="scilabinputoutputargs">x</span><span class="scilabopenclose">(</span><span class="scilabnumber">2</span><span class="scilabopenclose">)</span><span class="scilaboperator">+</span><span class="scilabnumber">2</span><span class="scilabopenclose">)</span> -<span class="scilabopenclose">]</span> -<span class="scilabskeyword">end</span> -<span class="scilabfkeyword">endfunction</span> -<span class="scilabcomment">// The nonlinear constraints and the Jacobian</span> -<span class="scilabcomment">// matrix of the constraints</span> -<span class="scilabfkeyword">function</span> <span class="scilabopenclose">[</span><span class="scilabinputoutputargs">c</span><span class="scilabdefault">, </span><span class="scilabinputoutputargs">ceq</span><span class="scilabdefault">, </span><span class="scilabinputoutputargs">DC</span><span class="scilabdefault">, </span><span class="scilabinputoutputargs">DCeq</span><span class="scilabopenclose">]</span><span class="scilaboperator">=</span><span class="scilabfunctionid">confungrad</span><span class="scilabopenclose">(</span><span class="scilabinputoutputargs">x</span><span class="scilabopenclose">)</span> -<span class="scilabcomment">// Inequality constraints</span> -<span class="scilabinputoutputargs">c</span><span class="scilabopenclose">(</span><span class="scilabnumber">1</span><span class="scilabopenclose">)</span> <span class="scilaboperator">=</span> <span class="scilabnumber">1.5</span> <span class="scilaboperator">+</span> <span class="scilabinputoutputargs">x</span><span class="scilabopenclose">(</span><span class="scilabnumber">1</span><span class="scilabopenclose">)</span> <span class="scilaboperator">*</span> <span class="scilabinputoutputargs">x</span><span class="scilabopenclose">(</span><span class="scilabnumber">2</span><span class="scilabopenclose">)</span> <span class="scilaboperator">-</span> <span class="scilabinputoutputargs">x</span><span class="scilabopenclose">(</span><span class="scilabnumber">1</span><span class="scilabopenclose">)</span> <span class="scilaboperator">-</span> <span class="scilabinputoutputargs">x</span><span class="scilabopenclose">(</span><span class="scilabnumber">2</span><span class="scilabopenclose">)</span> -<span class="scilabinputoutputargs">c</span><span class="scilabopenclose">(</span><span class="scilabnumber">2</span><span class="scilabopenclose">)</span> <span class="scilaboperator">=</span> <span class="scilaboperator">-</span><span class="scilabinputoutputargs">x</span><span class="scilabopenclose">(</span><span class="scilabnumber">1</span><span class="scilabopenclose">)</span> <span class="scilaboperator">*</span> <span class="scilabinputoutputargs">x</span><span class="scilabopenclose">(</span><span class="scilabnumber">2</span><span class="scilabopenclose">)</span><span class="scilaboperator">-</span><span class="scilabnumber">10</span> -<span class="scilabcomment">// No nonlinear equality constraints</span> -<span class="scilabinputoutputargs">ceq</span><span class="scilaboperator">=</span><span class="scilabopenclose">[</span><span class="scilabopenclose">]</span> -<span class="scilabopenclose">[</span><span class="scilabid">lhs</span><span class="scilabdefault">,</span><span class="scilabid">rhs</span><span class="scilabopenclose">]</span><span class="scilaboperator">=</span><a class="scilabcommand" href="scilab://argn">argn</a><span class="scilabopenclose">(</span><span class="scilabopenclose">)</span> -<span class="scilabskeyword">if</span> <span class="scilabopenclose">(</span> <span class="scilabid">lhs</span> <span class="scilaboperator">></span> <span class="scilabnumber">2</span> <span class="scilabopenclose">)</span> <span class="scilabskeyword">then</span> -<span class="scilabcomment">// DC(:,i) = gradient of the i-th constraint</span> -<span class="scilabcomment">// DC = [</span> -<span class="scilabcomment">// Dc1/Dx1 Dc2/Dx1</span> -<span class="scilabcomment">// Dc1/Dx2 Dc2/Dx2</span> -<span class="scilabcomment">// ]</span> -<span class="scilabinputoutputargs">DC</span><span class="scilaboperator">=</span> <span class="scilabopenclose">[</span> -<span class="scilabinputoutputargs">x</span><span class="scilabopenclose">(</span><span class="scilabnumber">2</span><span class="scilabopenclose">)</span><span class="scilaboperator">-</span><span class="scilabnumber">1</span><span class="scilabdefault">,</span> <span class="scilaboperator">-</span><span class="scilabinputoutputargs">x</span><span class="scilabopenclose">(</span><span class="scilabnumber">2</span><span class="scilabopenclose">)</span> -<span class="scilabinputoutputargs">x</span><span class="scilabopenclose">(</span><span class="scilabnumber">1</span><span class="scilabopenclose">)</span><span class="scilaboperator">-</span><span class="scilabnumber">1</span><span class="scilabdefault">,</span> <span class="scilaboperator">-</span><span class="scilabinputoutputargs">x</span><span class="scilabopenclose">(</span><span class="scilabnumber">1</span><span class="scilabopenclose">)</span> -<span class="scilabopenclose">]</span> -<span class="scilabinputoutputargs">DCeq</span> <span class="scilaboperator">=</span> <span class="scilabopenclose">[</span><span class="scilabopenclose">]</span> -<span class="scilabskeyword">end</span> -<span class="scilabfkeyword">endfunction</span> -<span class="scilabcomment">// Test with both gradient of objective and gradient of constraints</span> -<span class="scilabid">options</span> <span class="scilaboperator">=</span> <a class="scilabmacro" href="optimset.html">optimset</a><span class="scilabopenclose">(</span><span class="scilabstring">"</span><span class="scilabstring">GradObj</span><span class="scilabstring">"</span><span class="scilabdefault">,</span><span class="scilabstring">"</span><span class="scilabstring">on</span><span class="scilabstring">"</span><span class="scilabdefault">,</span><span class="scilabstring">"</span><span class="scilabstring">GradConstr</span><span class="scilabstring">"</span><span class="scilabdefault">,</span><span class="scilabstring">"</span><span class="scilabstring">on</span><span class="scilabstring">"</span><span class="scilabopenclose">)</span><span class="scilabdefault">;</span> -<span class="scilabcomment">// The initial guess</span> -<span class="scilabid">x0</span> <span class="scilaboperator">=</span> <span class="scilabopenclose">[</span><span class="scilaboperator">-</span><span class="scilabnumber">1</span><span class="scilabdefault">,</span><span class="scilabnumber">1</span><span class="scilabopenclose">]</span><span class="scilabdefault">;</span> -<span class="scilabcomment">// The expected solution : only 4 digits are guaranteed</span> -<span class="scilabid">xopt</span> <span class="scilaboperator">=</span> <span class="scilabopenclose">[</span><span class="scilaboperator">-</span><span class="scilabnumber">9.547345885974547</span> <span class="scilabnumber">1.047408305349257</span><span class="scilabopenclose">]</span> -<span class="scilabid">fopt</span> <span class="scilaboperator">=</span> <span class="scilabnumber">0.023551460139148</span> -<span class="scilabcomment">// Run fmincon</span> -<span class="scilabopenclose">[</span><span class="scilabid">x</span><span class="scilabdefault">,</span><span class="scilabid">fval</span><span class="scilabdefault">,</span><span class="scilabid">exitflag</span><span class="scilabdefault">,</span><span class="scilabid">output</span><span class="scilabopenclose">]</span> <span class="scilaboperator">=</span> <span class="scilabspecial">..</span> -<span class="scilabid">fmincon</span><span class="scilabopenclose">(</span><span class="scilabfunctionid">objfungrad</span><span class="scilabdefault">,</span><span class="scilabid">x0</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="scilabopenclose">[</span><span class="scilabopenclose">]</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="scilabopenclose">[</span><span class="scilabopenclose">]</span><span class="scilabdefault">,</span> <span class="scilabfunctionid">confungrad</span><span class="scilabdefault">,</span><span class="scilabid">options</span><span class="scilabopenclose">)</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">Examples</h3> - <div class="programlisting"><table border="0" width="100%"><tr><td width="98%"><pre class="scilabcode"><span class="scilabcomment">// A case where we set the bounds of the optimization.</span> -<span class="scilabcomment">// By default, the bounds are set to infinity.</span> -<span class="scilabfkeyword">function</span> <span class="scilabinputoutputargs">f</span><span class="scilaboperator">=</span><span class="scilabfunctionid">objfun</span><span class="scilabopenclose">(</span><span class="scilabinputoutputargs">x</span><span class="scilabopenclose">)</span> -<span class="scilabinputoutputargs">f</span> <span class="scilaboperator">=</span> <a class="scilabcommand" href="scilab://exp">exp</a><span class="scilabopenclose">(</span><span class="scilabinputoutputargs">x</span><span class="scilabopenclose">(</span><span class="scilabnumber">1</span><span class="scilabopenclose">)</span><span class="scilabopenclose">)</span><span class="scilaboperator">*</span><span class="scilabopenclose">(</span><span class="scilabnumber">4</span><span class="scilaboperator">*</span><span class="scilabinputoutputargs">x</span><span class="scilabopenclose">(</span><span class="scilabnumber">1</span><span class="scilabopenclose">)</span><span class="scilaboperator">^</span><span class="scilabnumber">2</span> <span class="scilaboperator">+</span> <span class="scilabnumber">2</span><span class="scilaboperator">*</span><span class="scilabinputoutputargs">x</span><span class="scilabopenclose">(</span><span class="scilabnumber">2</span><span class="scilabopenclose">)</span><span class="scilaboperator">^</span><span class="scilabnumber">2</span> <span class="scilaboperator">+</span> <span class="scilabnumber">4</span><span class="scilaboperator">*</span><span class="scilabinputoutputargs">x</span><span class="scilabopenclose">(</span><span class="scilabnumber">1</span><span class="scilabopenclose">)</span><span class="scilaboperator">*</span><span class="scilabinputoutputargs">x</span><span class="scilabopenclose">(</span><span class="scilabnumber">2</span><span class="scilabopenclose">)</span> <span class="scilaboperator">+</span> <span class="scilabnumber">2</span><span class="scilaboperator">*</span><span class="scilabinputoutputargs">x</span><span class="scilabopenclose">(</span><span class="scilabnumber">2</span><span class="scilabopenclose">)</span> <span class="scilaboperator">+</span> <span class="scilabnumber">1</span><span class="scilabopenclose">)</span> -<span class="scilabfkeyword">endfunction</span> -<span class="scilabfkeyword">function</span> <span class="scilabopenclose">[</span><span class="scilabinputoutputargs">c</span><span class="scilabdefault">, </span><span class="scilabinputoutputargs">ceq</span><span class="scilabopenclose">]</span><span class="scilaboperator">=</span><span class="scilabfunctionid">confun</span><span class="scilabopenclose">(</span><span class="scilabinputoutputargs">x</span><span class="scilabopenclose">)</span> -<span class="scilabcomment">// Nonlinear inequality constraints</span> -<span class="scilabinputoutputargs">c</span> <span class="scilaboperator">=</span> <span class="scilabopenclose">[</span> -<span class="scilabnumber">1.5</span> <span class="scilaboperator">+</span> <span class="scilabinputoutputargs">x</span><span class="scilabopenclose">(</span><span class="scilabnumber">1</span><span class="scilabopenclose">)</span><span class="scilaboperator">*</span><span class="scilabinputoutputargs">x</span><span class="scilabopenclose">(</span><span class="scilabnumber">2</span><span class="scilabopenclose">)</span> <span class="scilaboperator">-</span> <span class="scilabinputoutputargs">x</span><span class="scilabopenclose">(</span><span class="scilabnumber">1</span><span class="scilabopenclose">)</span> <span class="scilaboperator">-</span> <span class="scilabinputoutputargs">x</span><span class="scilabopenclose">(</span><span class="scilabnumber">2</span><span class="scilabopenclose">)</span> -<span class="scilaboperator">-</span><span class="scilabinputoutputargs">x</span><span class="scilabopenclose">(</span><span class="scilabnumber">1</span><span class="scilabopenclose">)</span><span class="scilaboperator">*</span><span class="scilabinputoutputargs">x</span><span class="scilabopenclose">(</span><span class="scilabnumber">2</span><span class="scilabopenclose">)</span> <span class="scilaboperator">-</span> <span class="scilabnumber">10</span> -<span class="scilabopenclose">]</span> -<span class="scilabcomment">// Nonlinear equality constraints</span> -<span class="scilabinputoutputargs">ceq</span> <span class="scilaboperator">=</span> <span class="scilabopenclose">[</span><span class="scilabopenclose">]</span> -<span class="scilabfkeyword">endfunction</span> -<span class="scilabcomment">// The initial guess</span> -<span class="scilabid">x0</span> <span class="scilaboperator">=</span> <span class="scilabopenclose">[</span><span class="scilaboperator">-</span><span class="scilabnumber">1</span><span class="scilabdefault">,</span><span class="scilabnumber">1</span><span class="scilabopenclose">]</span><span class="scilabdefault">;</span> -<span class="scilabcomment">// The expected solution</span> -<span class="scilabid">xopt</span> <span class="scilaboperator">=</span> <span class="scilabopenclose">[</span><span class="scilabnumber">0</span> <span class="scilabnumber">1.5</span><span class="scilabopenclose">]</span> -<span class="scilabid">fopt</span> <span class="scilaboperator">=</span> <span class="scilabnumber">8.5</span> -<span class="scilabcomment">// Make sure that x(1)</span><span class="scilabcomment">></span><span class="scilabcomment">=0, and x(2)</span><span class="scilabcomment">></span><span class="scilabcomment">=0</span> -<span class="scilabid">lb</span> <span class="scilaboperator">=</span> <span class="scilabopenclose">[</span><span class="scilabnumber">0</span><span class="scilabdefault">,</span><span class="scilabnumber">0</span><span class="scilabopenclose">]</span><span class="scilabdefault">;</span> -<span class="scilabid">ub</span> <span class="scilaboperator">=</span> <span class="scilabopenclose">[</span> <span class="scilabopenclose">]</span><span class="scilabdefault">;</span> -<span class="scilabcomment">// Run fmincon</span> -<span class="scilabopenclose">[</span><span class="scilabid">x</span><span class="scilabdefault">,</span><span class="scilabid">fval</span><span class="scilabopenclose">]</span> <span class="scilaboperator">=</span> <span class="scilabid">fmincon</span> <span class="scilabopenclose">(</span> <span class="scilabfunctionid">objfun</span> <span class="scilabdefault">,</span> <span class="scilabid">x0</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="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="scilabdefault">,</span><span class="scilabfunctionid">confun</span><span class="scilabopenclose">)</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">Michael Baudin, DIGITEO, 2010</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_ed3c614d9a2555a6802170ca29940f55.html"><< Fmincon Toolbox</a></span> - - </td> - <td width="40%" class="center"> - <span class="top"><a href="section_ed3c614d9a2555a6802170ca29940f55.html">Fmincon Toolbox</a></span> - - </td> - <td width="30%" class="next"> - <span class="next"><a href="optimget.html">optimget >></a></span> - - </td> - </tr></table> - <hr /> - </div> - </body> -</html> diff --git a/help/en_US/scilab_en_US_help/symphonymat.html b/help/en_US/scilab_en_US_help/symphonymat.html index c580508..fc60daf 100644 --- a/help/en_US/scilab_en_US_help/symphonymat.html +++ b/help/en_US/scilab_en_US_help/symphonymat.html @@ -37,25 +37,25 @@ <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> + <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">Parameters</h3> - <dl><dt><span class="term">f :</span> + <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">Linear inequality constraint matrix, specified as a matrix of double. A represents the linear coefficients in the constraints A*x ≤ b. A has size M-by-N, where M is the number of constraints and N is number of variables</p></dd></dt> + <dd><p class="para">Linear inequality constraint matrix, specified as a matrix of double. A represents the linear coefficients in the constraints A*x ≤ b. A has the size where columns equals to the number of variables.</p></dd></dt> <dt><span class="term">b :</span> - <dd><p class="para">Linear inequality constraint vector, specified as a vector of double. b represents the constant vector in the constraints A*x ≤ b. b has length M, where A is M-by-N</p></dd></dt> + <dd><p class="para">Linear inequality constraint vector, specified as a vector of double. b represents the constant vector in the constraints A*x ≤ b. b has size equals to the number of rows in A.</p></dd></dt> <dt><span class="term">Aeq :</span> - <dd><p class="para">Linear equality constraint matrix, specified as a matrix of double. Aeq represents the linear coefficients in the constraints Aeq*x = beq. Aeq has size Meq-by-N, where Meq is the number of constraints and N is number of variables</p></dd></dt> + <dd><p class="para">Linear equality constraint matrix, specified as a matrix of double. Aeq represents the linear coefficients in the constraints Aeq*x = beq. Aeq has the size where columns equals to the number of variables.</p></dd></dt> <dt><span class="term">beq :</span> - <dd><p class="para">Linear equality constraint vector, specified as a vector of double. beq represents the constant vector in the constraints Aeq*x = beq. beq has length Meq, where Aeq is Meq-by-N.</p></dd></dt> + <dd><p class="para">Linear equality constraint vector, specified as a vector of double. beq represents the constant vector in the constraints Aeq*x = beq. beq has size equals to the number of rows in Aeq.</p></dd></dt> <dt><span class="term">lb :</span> <dd><p class="para">Lower bounds, specified as a vector or array of double. lb represents the lower bounds elementwise in lb ≤ x ≤ ub.</p></dd></dt> <dt><span class="term">ub :</span> @@ -63,24 +63,24 @@ <dt><span class="term">options :</span> <dd><p class="para">a list containing the the parameters to be set.</p></dd></dt> <dt><span class="term">xopt :</span> - <dd><p class="para">a vector of double, the computed solution of the optimization problem</p></dd></dt> + <dd><p class="para">a vector of double, the computed solution of the optimization problem.</p></dd></dt> <dt><span class="term">fopt :</span> <dd><p class="para">a double, the function value at x</p></dd></dt> <dt><span class="term">status :</span> - <dd><p class="para">status flag from symphony.</p></dd></dt> + <dd><p class="para">status flag from symphony. 227 is optimal, 228 is Time limit exceeded, 230 is iteration limit exceeded.</p></dd></dt> <dt><span class="term">output :</span> - <dd><p class="para">The output data structure contains detailed informations about the optimization process. Right now it contains number of iteration.</p></dd></dt></dl></div> + <dd><p class="para">The output data structure contains detailed information about the optimization process. This version only contains number of iterations.</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 : -find the minimum or maximum of f(x) such that</p> - <p class="para"><span><img src='./_LaTeX_symphonymat.xml_1.png' style='position:relative;top:51px;width:216px;height:110px'/></span></p> - <p class="para">We are calling SYMPHONY written in C by gateway files for the actual computation.</p> +find the minimum or maximum of C'⋅x such that</p> + <p class="para"><span><img src='./_LaTeX_symphonymat.xml_1.png' style='position:relative;top:51px;width:212px;height:110px'/></span></p> + <p class="para">The routine calls SYMPHONY written in C by gateway files for the actual computation.</p> <p class="para"></p></div> <div class="refsection"><h3 class="title">Examples</h3> <div class="programlisting"><table border="0" width="100%"><tr><td width="98%"><pre class="scilabcode"><span class="scilabcomment">// Objective function</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">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">// 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> @@ -106,7 +106,7 @@ find the minimum or maximum of f(x) such that</p> <span class="scilabcomment">// st sum{j=1,...,n} r(i,j)x(j) </span><span class="scilabcomment"><</span><span class="scilabcomment">= b(i) i=1,...,m</span> <span class="scilabcomment">// x(j)=0 or 1</span> <span class="scilabcomment">// The function to be maximize i.e. P(j)</span> -<span class="scilabid">C</span> <span class="scilaboperator">=</span> <span class="scilaboperator">-</span><span class="scilabnumber">1</span><span class="scilaboperator">*</span><span class="scilabopenclose">[</span> <span class="scilabnumber">504</span> <span class="scilabnumber">803</span> <span class="scilabnumber">667</span> <span class="scilabnumber">1103</span> <span class="scilabnumber">834</span> <span class="scilabnumber">585</span> <span class="scilabnumber">811</span> <span class="scilabnumber">856</span> <span class="scilabnumber">690</span> <span class="scilabnumber">832</span> <span class="scilabnumber">846</span> <span class="scilabnumber">813</span> <span class="scilabnumber">868</span> <span class="scilabnumber">793</span> <span class="scilabspecial">..</span> +<span class="scilabid">c</span> <span class="scilaboperator">=</span> <span class="scilaboperator">-</span><span class="scilabnumber">1</span><span class="scilaboperator">*</span><span class="scilabopenclose">[</span> <span class="scilabnumber">504</span> <span class="scilabnumber">803</span> <span class="scilabnumber">667</span> <span class="scilabnumber">1103</span> <span class="scilabnumber">834</span> <span class="scilabnumber">585</span> <span class="scilabnumber">811</span> <span class="scilabnumber">856</span> <span class="scilabnumber">690</span> <span class="scilabnumber">832</span> <span class="scilabnumber">846</span> <span class="scilabnumber">813</span> <span class="scilabnumber">868</span> <span class="scilabnumber">793</span> <span class="scilabspecial">..</span> <span class="scilabnumber">825</span> <span class="scilabnumber">1002</span> <span class="scilabnumber">860</span> <span class="scilabnumber">615</span> <span class="scilabnumber">540</span> <span class="scilabnumber">797</span> <span class="scilabnumber">616</span> <span class="scilabnumber">660</span> <span class="scilabnumber">707</span> <span class="scilabnumber">866</span> <span class="scilabnumber">647</span> <span class="scilabnumber">746</span> <span class="scilabnumber">1006</span> <span class="scilabnumber">608</span> <span class="scilabspecial">..</span> <span class="scilabnumber">877</span> <span class="scilabnumber">900</span> <span class="scilabnumber">573</span> <span class="scilabnumber">788</span> <span class="scilabnumber">484</span> <span class="scilabnumber">853</span> <span class="scilabnumber">942</span> <span class="scilabnumber">630</span> <span class="scilabnumber">591</span> <span class="scilabnumber">630</span> <span class="scilabnumber">640</span> <span class="scilabnumber">1169</span> <span class="scilabnumber">932</span> <span class="scilabnumber">1034</span> <span class="scilabspecial">..</span> <span class="scilabnumber">957</span> <span class="scilabnumber">798</span> <span class="scilabnumber">669</span> <span class="scilabnumber">625</span> <span class="scilabnumber">467</span> <span class="scilabnumber">1051</span> <span class="scilabnumber">552</span> <span class="scilabnumber">717</span> <span class="scilabnumber">654</span> <span class="scilabnumber">388</span> <span class="scilabnumber">559</span> <span class="scilabnumber">555</span> <span class="scilabnumber">1104</span> <span class="scilabnumber">783</span> <span class="scilabspecial">..</span> @@ -155,7 +155,7 @@ find the minimum or maximum of f(x) such that</p> <span class="scilabnumber">483</span> <span class="scilabnumber">336</span> <span class="scilabnumber">765</span> <span class="scilabnumber">637</span> <span class="scilabnumber">981</span> <span class="scilabnumber">980</span> <span class="scilabnumber">202</span> <span class="scilabnumber">35</span> <span class="scilabnumber">594</span> <span class="scilabnumber">689</span> <span class="scilabnumber">602</span> <span class="scilabnumber">76</span> <span class="scilabnumber">767</span> <span class="scilabnumber">693</span> <span class="scilabspecial">..</span> <span class="scilabnumber">893</span> <span class="scilabnumber">160</span> <span class="scilabnumber">785</span> <span class="scilabnumber">311</span> <span class="scilabnumber">417</span> <span class="scilabnumber">748</span> <span class="scilabnumber">375</span> <span class="scilabnumber">362</span> <span class="scilabnumber">617</span> <span class="scilabnumber">553</span> <span class="scilabnumber">474</span> <span class="scilabnumber">915</span> <span class="scilabnumber">457</span> <span class="scilabnumber">261</span> <span class="scilabnumber">350</span> <span class="scilabnumber">635</span> <span class="scilabdefault">;</span> <span class="scilabopenclose">]</span><span class="scilabdefault">;</span> -<span class="scilabid">nbVar</span> <span class="scilaboperator">=</span> <a class="scilabcommand" href="scilab://size">size</a><span class="scilabopenclose">(</span><span class="scilabid">objCoef</span><span class="scilabdefault">,</span><span class="scilabnumber">1</span><span class="scilabopenclose">)</span> +<span class="scilabid">nbVar</span> <span class="scilaboperator">=</span> <a class="scilabcommand" href="scilab://size">size</a><span class="scilabopenclose">(</span><span class="scilabid">c</span><span class="scilabdefault">,</span><span class="scilabnumber">1</span><span class="scilabopenclose">)</span> <span class="scilabid">b</span><span class="scilaboperator">=</span><span class="scilabopenclose">[</span><span class="scilabnumber">11927</span> <span class="scilabnumber">13727</span> <span class="scilabnumber">11551</span> <span class="scilabnumber">13056</span> <span class="scilabnumber">13460</span> <span class="scilabopenclose">]</span><span class="scilabdefault">;</span> <span class="scilabcomment">// Lower Bound of variables</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="scilabid">nbVar</span><span class="scilabopenclose">)</span> @@ -175,7 +175,7 @@ find the minimum or maximum of f(x) such that</p> <span class="scilabcomment">// Optimal value</span> <span class="scilabid">fopt</span> <span class="scilaboperator">=</span> <span class="scilabopenclose">[</span> <span class="scilabnumber">24381</span> <span class="scilabopenclose">]</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="scilabdefault">,</span><span class="scilabid">options</span><span class="scilabopenclose">)</span><span class="scilabdefault">;</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> +<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="scilabdefault">,</span><span class="scilabid">options</span><span class="scilabopenclose">)</span><span class="scilabdefault">;</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> diff --git a/help/en_US/symphony.xml b/help/en_US/symphony.xml index 1f77555..c0caa8e 100644 --- a/help/en_US/symphony.xml +++ b/help/en_US/symphony.xml @@ -24,9 +24,9 @@ <refsynopsisdiv> <title>Calling Sequence</title> <synopsis> - xopt = symphony(nbVar,nbCon,objCoef,isInt,LB,UB,conMatrix,conLB,conUB) - xopt = symphony(nbVar,nbCon,objCoef,isInt,LB,UB,conMatrix,conLB,conUB,objSense) - xopt = symphony(nbVar,nbCon,objCoef,isInt,LB,UB,conMatrix,conLB,conUB,objSense,options) + xopt = symphony(nbVar,nbCon,c,isInt,lb,ub,A,conLB,conUB) + xopt = symphony(nbVar,nbCon,c,isInt,lb,ub,A,conLB,conUB,objSense) + xopt = symphony(nbVar,nbCon,c,isInt,lb,ub,A,conLB,conUB,objSense,options) [xopt,fopt,status,output] = symphony( ... ) </synopsis> @@ -39,15 +39,15 @@ <listitem><para> a double, number of variables.</para></listitem></varlistentry> <varlistentry><term>nbCon :</term> <listitem><para> a double, number of constraints.</para></listitem></varlistentry> - <varlistentry><term>objCoeff :</term> + <varlistentry><term>c :</term> <listitem><para> a vector of double, represents coefficients of the variables in the objective.</para></listitem></varlistentry> <varlistentry><term>isInt :</term> <listitem><para> a vector of boolean, represents wether a variable is constrained to be an integer.</para></listitem></varlistentry> - <varlistentry><term>LB :</term> + <varlistentry><term>lb :</term> <listitem><para> a vector of double, represents lower bounds of the variables.</para></listitem></varlistentry> - <varlistentry><term>UB :</term> + <varlistentry><term>ub :</term> <listitem><para> a vector of double, represents upper bounds of the variables.</para></listitem></varlistentry> - <varlistentry><term>conMatrix :</term> + <varlistentry><term>A :</term> <listitem><para> a matrix of double, represents matrix representing the constraint matrix.</para></listitem></varlistentry> <varlistentry><term>conLB :</term> <listitem><para> a vector of double, represents lower bounds of the constraints.</para></listitem></varlistentry> @@ -56,15 +56,15 @@ <varlistentry><term>objSense :</term> <listitem><para> The sense (maximization/minimization) of the objective. Use 1(sym_minimize ) or -1 (sym_maximize) here.</para></listitem></varlistentry> <varlistentry><term>options :</term> - <listitem><para> a a list containing the the parameters to be set.</para></listitem></varlistentry> + <listitem><para> a list containing the the parameters to be set.</para></listitem></varlistentry> <varlistentry><term>xopt :</term> <listitem><para> a vector of double, the computed solution of the optimization problem.</para></listitem></varlistentry> <varlistentry><term>fopt :</term> <listitem><para> a double, the function value at x.</para></listitem></varlistentry> <varlistentry><term>status :</term> - <listitem><para> status flag from symphony.</para></listitem></varlistentry> + <listitem><para> status flag from symphony. 227 is optimal, 228 is Time limit exceeded, 230 is iteration limit exceeded.</para></listitem></varlistentry> <varlistentry><term>output :</term> - <listitem><para> The output data structure contains detailed informations about the optimization process. Right now it contains number of iteration.</para></listitem></varlistentry> + <listitem><para> The output data structure contains detailed information about the optimization process. This version only contains number of iterations</para></listitem></varlistentry> </variablelist> </refsection> @@ -78,15 +78,15 @@ find the minimum or maximum of f(x) such that <latex> \begin{eqnarray} &\mbox{min}_{x} -& f^T*x \\ -& \text{subject to} & conLB \leq C*x \leq conUB \\ +& f^T⋅x \\ +& \text{subject to} & conLB \leq A⋅x \leq conUB \\ & & lb \leq x \leq ub \\ & & x_i \in \!\, \mathbb{Z}, i \in \!\, I \end{eqnarray} </latex> </para> <para> -We are calling SYMPHONY written in C by gateway files for the actual computation. +The routine calls SYMPHONY written in C by gateway files for the actual computation. </para> <para> </para> @@ -97,25 +97,25 @@ We are calling SYMPHONY written in C by gateway files for the actual computation <programlisting role="example"><![CDATA[ //A basic case : // Objective function -objCoef = [350*5,330*3,310*4,280*6,500,450,400,100]'; +c = [350*5,330*3,310*4,280*6,500,450,400,100]'; // Lower Bound of variable lb = repmat(0,8,1); // Upper Bound of variables ub = [repmat(1,4,1);repmat(%inf,4,1)]; // Constraint Matrix -conMatrix = [5,3,4,6,1,1,1,1; +A = [5,3,4,6,1,1,1,1; 5*0.05,3*0.04,4*0.05,6*0.03,0.08,0.07,0.06,0.03; 5*0.03,3*0.03,4*0.04,6*0.04,0.06,0.07,0.08,0.09;] -// Lower Bound of constrains +// Lower Bound of constraints conlb = [ 25; 1.25; 1.25] -// Upper Bound of constrains +// Upper Bound of constraints conub = [ 25; 1.25; 1.25] // Row Matrix for telling symphony that the is integer or not isInt = [repmat(%t,1,4) repmat(%f,1,4)]; xopt = [1 1 0 1 7.25 0 0.25 3.5] fopt = [8495] // Calling Symphony -[x,f,status,output] = symphony(8,3,c,isInt,lb,ub,conMatrix,conlb,conub,1) +[x,f,status,output] = symphony(8,3,c,isInt,lb,ub,A,conlb,conub,1) // Press ENTER to continue ]]></programlisting> @@ -134,7 +134,7 @@ fopt = [8495] // st sum{j=1,...,n} r(i,j)x(j) <= b(i) i=1,...,m // x(j)=0 or 1 // The function to be maximize i.e. P(j) -p = [ 504 803 667 1103 834 585 811 856 690 832 846 813 868 793 .. +c = [ 504 803 667 1103 834 585 811 856 690 832 846 813 868 793 .. 825 1002 860 615 540 797 616 660 707 866 647 746 1006 608 .. 877 900 573 788 484 853 942 630 591 630 640 1169 932 1034 .. 957 798 669 625 467 1051 552 717 654 388 559 555 1104 783 .. @@ -142,7 +142,7 @@ p = [ 504 803 667 1103 834 585 811 856 690 832 846 813 868 793 .. 510 671 575 740 510 675 996 636 826 1022 1140 654 909 799 .. 1162 653 814 625 599 476 767 954 906 904 649 873 565 853 1008 632]'; //Constraint Matrix -conMatrix = [ +A = [ //Constraint 1 42 41 523 215 819 551 69 193 582 375 367 478 162 898 .. 550 553 298 577 493 183 260 224 852 394 958 282 402 604 .. @@ -184,15 +184,15 @@ conMatrix = [ 483 336 765 637 981 980 202 35 594 689 602 76 767 693 .. 893 160 785 311 417 748 375 362 617 553 474 915 457 261 350 635 ; ]; -nbCon = size(conMatrix,1) -nbVar = size(conMatrix,2) +nbCon = size(A,1) +nbVar = size(A,2) // Lower Bound of variables lb = repmat(0,nbVar,1) // Upper Bound of variables ub = repmat(1,nbVar,1) // Row Matrix for telling symphony that the is integer or not isInt = repmat(%t,1,nbVar) -// Lower Bound of constrains +// Lower Bound of constraints conLB=repmat(0,nbCon,1); // Upper Bound of constraints conUB=[11927 13727 11551 13056 13460 ]'; @@ -205,7 +205,7 @@ xopt = [0 1 1 0 0 1 0 1 0 1 0 0 0 0 0 0 0 1 0 0 0 0 1 0 1 1 0 1 1 0 1 .. // Optimal value fopt = [ 24381 ] // Calling Symphony -[x,f,status,output] = symphony(nbVar,nbCon,p,isInt,lb,ub,conMatrix,conLB,conUB,-1,options); +[x,f,status,output] = symphony(nbVar,nbCon,c,isInt,lb,ub,A,conLB,conUB,-1,options); ]]></programlisting> </refsection> diff --git a/help/en_US/symphonymat.xml b/help/en_US/symphonymat.xml index 792eb15..cf95807 100644 --- a/help/en_US/symphonymat.xml +++ b/help/en_US/symphonymat.xml @@ -24,10 +24,10 @@ <refsynopsisdiv> <title>Calling Sequence</title> <synopsis> - xopt = symphonymat(C,intcon,A,b) - xopt = symphonymat(C,intcon,A,b,Aeq,beq) - xopt = symphonymat(C,intcon,A,b,Aeq,beq,lb,ub) - xopt = symphonymat(C,intcon,A,b,Aeq,beq,lb,ub,options) + xopt = symphonymat(c,intcon,A,b) + xopt = symphonymat(c,intcon,A,b,Aeq,beq) + xopt = symphonymat(c,intcon,A,b,Aeq,beq,lb,ub) + xopt = symphonymat(c,intcon,A,b,Aeq,beq,lb,ub,options) [xopt,fopt,status,output] = symphonymat( ... ) </synopsis> @@ -36,18 +36,18 @@ <refsection> <title>Parameters</title> <variablelist> - <varlistentry><term>f :</term> + <varlistentry><term>c :</term> <listitem><para> a vector of double, contains coefficients of the variables in the objective</para></listitem></varlistentry> <varlistentry><term>intcon :</term> <listitem><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.</para></listitem></varlistentry> <varlistentry><term>A :</term> - <listitem><para> Linear inequality constraint matrix, specified as a matrix of double. A represents the linear coefficients in the constraints A*x ≤ b. A has size M-by-N, where M is the number of constraints and N is number of variables</para></listitem></varlistentry> + <listitem><para> Linear inequality constraint matrix, specified as a matrix of double. A represents the linear coefficients in the constraints A*x ≤ b. A has the size where columns equals to the number of variables.</para></listitem></varlistentry> <varlistentry><term>b :</term> - <listitem><para> Linear inequality constraint vector, specified as a vector of double. b represents the constant vector in the constraints A*x ≤ b. b has length M, where A is M-by-N</para></listitem></varlistentry> + <listitem><para> Linear inequality constraint vector, specified as a vector of double. b represents the constant vector in the constraints A*x ≤ b. b has size equals to the number of rows in A.</para></listitem></varlistentry> <varlistentry><term>Aeq :</term> - <listitem><para> Linear equality constraint matrix, specified as a matrix of double. Aeq represents the linear coefficients in the constraints Aeq*x = beq. Aeq has size Meq-by-N, where Meq is the number of constraints and N is number of variables</para></listitem></varlistentry> + <listitem><para> Linear equality constraint matrix, specified as a matrix of double. Aeq represents the linear coefficients in the constraints Aeq*x = beq. Aeq has the size where columns equals to the number of variables.</para></listitem></varlistentry> <varlistentry><term>beq :</term> - <listitem><para> Linear equality constraint vector, specified as a vector of double. beq represents the constant vector in the constraints Aeq*x = beq. beq has length Meq, where Aeq is Meq-by-N.</para></listitem></varlistentry> + <listitem><para> Linear equality constraint vector, specified as a vector of double. beq represents the constant vector in the constraints Aeq*x = beq. beq has size equals to the number of rows in Aeq.</para></listitem></varlistentry> <varlistentry><term>lb :</term> <listitem><para> Lower bounds, specified as a vector or array of double. lb represents the lower bounds elementwise in lb ≤ x ≤ ub.</para></listitem></varlistentry> <varlistentry><term>ub :</term> @@ -55,13 +55,13 @@ <varlistentry><term>options :</term> <listitem><para> a list containing the the parameters to be set.</para></listitem></varlistentry> <varlistentry><term>xopt :</term> - <listitem><para> a vector of double, the computed solution of the optimization problem</para></listitem></varlistentry> + <listitem><para> a vector of double, the computed solution of the optimization problem.</para></listitem></varlistentry> <varlistentry><term>fopt :</term> <listitem><para> a double, the function value at x</para></listitem></varlistentry> <varlistentry><term>status :</term> - <listitem><para> status flag from symphony.</para></listitem></varlistentry> + <listitem><para> status flag from symphony. 227 is optimal, 228 is Time limit exceeded, 230 is iteration limit exceeded.</para></listitem></varlistentry> <varlistentry><term>output :</term> - <listitem><para> The output data structure contains detailed informations about the optimization process. Right now it contains number of iteration.</para></listitem></varlistentry> + <listitem><para> The output data structure contains detailed information about the optimization process. This version only contains number of iterations.</para></listitem></varlistentry> </variablelist> </refsection> @@ -69,22 +69,22 @@ <title>Description</title> <para> Search the minimum or maximum of a constrained mixed integer linear programming optimization problem specified by : -find the minimum or maximum of f(x) such that +find the minimum or maximum of C'⋅x such that </para> <para> <latex> \begin{eqnarray} &\mbox{min}_{x} -& C^T*x \\ -& \text{subject to} & A*x \leq b \\ -& & Aeq*x = beq \\ +& C^T⋅x \\ +& \text{subject to} & A⋅x \leq b \\ +& & Aeq⋅x = beq \\ & & lb \leq x \leq ub \\ & & x_i \in \!\, \mathbb{Z}, i \in \!\, I \end{eqnarray} </latex> </para> <para> -We are calling SYMPHONY written in C by gateway files for the actual computation. +The routine calls SYMPHONY written in C by gateway files for the actual computation. </para> <para> </para> @@ -94,7 +94,7 @@ We are calling SYMPHONY written in C by gateway files for the actual computation <title>Examples</title> <programlisting role="example"><![CDATA[ // Objective function -C = [350*5,330*3,310*4,280*6,500,450,400,100]'; +c = [350*5,330*3,310*4,280*6,500,450,400,100]'; // Lower Bound of variable lb = repmat(0,1,8); // Upper Bound of variables @@ -125,7 +125,7 @@ intcon = [1 2 3 4]; // st sum{j=1,...,n} r(i,j)x(j) <= b(i) i=1,...,m // x(j)=0 or 1 // The function to be maximize i.e. P(j) -C = -1*[ 504 803 667 1103 834 585 811 856 690 832 846 813 868 793 .. +c = -1*[ 504 803 667 1103 834 585 811 856 690 832 846 813 868 793 .. 825 1002 860 615 540 797 616 660 707 866 647 746 1006 608 .. 877 900 573 788 484 853 942 630 591 630 640 1169 932 1034 .. 957 798 669 625 467 1051 552 717 654 388 559 555 1104 783 .. @@ -174,7 +174,7 @@ A = [ //Constraint 1 483 336 765 637 981 980 202 35 594 689 602 76 767 693 .. 893 160 785 311 417 748 375 362 617 553 474 915 457 261 350 635 ; ]; -nbVar = size(objCoef,1) +nbVar = size(c,1) b=[11927 13727 11551 13056 13460 ]; // Lower Bound of variables lb = repmat(0,1,nbVar) @@ -194,7 +194,7 @@ xopt = [0 1 1 0 0 1 0 1 0 1 0 0 0 0 0 0 0 1 0 0 0 0 1 0 1 1 0 1 1 0 1 .. // Optimal value fopt = [ 24381 ] // Calling Symphony -[x,f,status,output] = symphonymat(C,intcon,A,b,[],[],lb,ub,options); +[x,f,status,output] = symphonymat(c,intcon,A,b,[],[],lb,ub,options); ]]></programlisting> </refsection> |