summaryrefslogtreecommitdiff
path: root/help/en_US/linprog.xml
diff options
context:
space:
mode:
authorGeorgey2017-07-05 11:44:38 +0530
committerGeorgey2017-07-05 11:44:38 +0530
commit6aa3bf99dbd4187c83167dec18ebe974421d57bc (patch)
tree1a95c77b8c1e817b85593fdf4322627026244b07 /help/en_US/linprog.xml
parent0d5c6b0fad393ac40d086cffea064c624be4589a (diff)
downloadsymphony-6aa3bf99dbd4187c83167dec18ebe974421d57bc.tar.gz
symphony-6aa3bf99dbd4187c83167dec18ebe974421d57bc.tar.bz2
symphony-6aa3bf99dbd4187c83167dec18ebe974421d57bc.zip
Updated help folder
Diffstat (limited to 'help/en_US/linprog.xml')
-rw-r--r--help/en_US/linprog.xml237
1 files changed, 181 insertions, 56 deletions
diff --git a/help/en_US/linprog.xml b/help/en_US/linprog.xml
index c293b7e..88fe15a 100644
--- a/help/en_US/linprog.xml
+++ b/help/en_US/linprog.xml
@@ -35,92 +35,112 @@
</synopsis>
</refsynopsisdiv>
-<refsection>
- <title>Parameters</title>
+ <refsection>
+ <title>Input Parameters</title>
<variablelist>
<varlistentry><term>c :</term>
- <listitem><para> a vector of double, contains coefficients of the variables in the objective</para></listitem></varlistentry>
+ <listitem><para> A vector of doubles, containing the coefficients of the variables in the objective function.</para></listitem></varlistentry>
<varlistentry><term>A :</term>
- <listitem><para> a matrix of double, represents the linear coefficients in the inequality constraints A⋅x ≤ b.</para></listitem></varlistentry>
+ <listitem><para> A matrix of doubles, containing the coefficients of linear inequality constraints of size (m X n) where 'm' is the number of linear inequality constraints.</para></listitem></varlistentry>
<varlistentry><term>b :</term>
- <listitem><para> a vector of double, represents the linear coefficients in the inequality constraints A⋅x ≤ b.</para></listitem></varlistentry>
+ <listitem><para> A vector of doubles, related to 'A' and containing the the Right hand side equation of the linear inequality constraints of size (m X 1).</para></listitem></varlistentry>
<varlistentry><term>Aeq :</term>
- <listitem><para> a matrix of double, represents the linear coefficients in the equality constraints Aeq⋅x = beq.</para></listitem></varlistentry>
+ <listitem><para> A matrix of doubles, containing the coefficients of linear equality constraints of size (m1 X n) where 'm1' is the number of linear equality constraints.</para></listitem></varlistentry>
<varlistentry><term>beq :</term>
- <listitem><para> a vector of double, represents the linear coefficients in the equality constraints Aeq⋅x = beq.</para></listitem></varlistentry>
+ <listitem><para> A vector of doubles, related to 'Aeq' and containing the the Right hand side equation of the linear equality constraints of size (m1 X 1).</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>
+ <listitem><para> A vector of doubles, containing the lower bounds of the variables of size (1 X n) or (n X 1) where 'n' is the number of variables.</para></listitem></varlistentry>
<varlistentry><term>ub :</term>
- <listitem><para> Upper bounds, specified as a vector or array of double. ub represents the upper bounds elementwise in lb ≤ x ≤ ub.</para></listitem></varlistentry>
+ <listitem><para> A vector of doubles, containing the upper bounds of the variables of size (1 X n) or (n X 1) where 'n' is the number of variables.</para></listitem></varlistentry>
<varlistentry><term>options :</term>
- <listitem><para> a list containing the parameters to be set.</para></listitem></varlistentry>
+ <listitem><para> A list, containing the option for user to specify. See below for details.</para></listitem></varlistentry>
<varlistentry><term>file :</term>
- <listitem><para> a string describing the path to the mps file.</para></listitem></varlistentry>
+ <listitem><para> A string describing the path to the mps file.</para></listitem></varlistentry>
+ </variablelist>
+</refsection>
+<refsection>
+<title> Outputs</title>
+ <variablelist>
<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 doubles, containing the computed solution of the optimization problem.</para></listitem></varlistentry>
<varlistentry><term>fopt :</term>
- <listitem><para> a double, the value of the function at x.</para></listitem></varlistentry>
- <varlistentry><term>status :</term>
- <listitem><para> status flag returned from symphony. See below for details.</para></listitem></varlistentry>
+ <listitem><para> A double, containing the the function value at x.</para></listitem></varlistentry>
+ <varlistentry><term>exitflaf :</term>
+ <listitem><para> An integer, containing the flag which denotes the reason for termination of algorithm. See below for details.</para></listitem></varlistentry>
<varlistentry><term>output :</term>
- <listitem><para> The output data structure contains detailed information about the optimization process. See below for details.</para></listitem></varlistentry>
+ <listitem><para> A structure, containing the information about the optimization. See below for details.</para></listitem></varlistentry>
<varlistentry><term>lambda :</term>
- <listitem><para> The structure consist of the Lagrange multipliers at the solution of problem. See below for details.</para></listitem></varlistentry>
+ <listitem><para> A structure, containing the Lagrange multipliers of lower bound, upper bound and constraints at the optimized point. See below for details.</para></listitem></varlistentry>
</variablelist>
</refsection>
+
+
<refsection>
<title>Description</title>
<para>
-OSI-CLP is used for solving the linear programming problems, OSI-CLP is a library written in C++.
Search the minimum of a constrained linear programming problem specified by :
</para>
<para>
<latex>
\begin{eqnarray}
-&amp;\mbox{min}_{x}
-&amp; c^T⋅x \\
-&amp; \text{subject to} &amp; A⋅x \leq b \\
-&amp; &amp; Aeq⋅x = beq \\
-&amp; &amp; lb \leq x \leq ub \\
+\hspace{10pt} &amp;\mbox{min}_{x}
+\hspace{10pt} &amp; c^T⋅x \\
+\hspace{10pt} &amp; \text{Subjected to:} &amp; A⋅x \leq b \\
+\end{eqnarray}\\
+\begin{eqnarray}
+\hspace{115pt} &amp; Aeq⋅x = beq \\
+\hspace{115pt} &amp; lb \leq x \leq ub \\
\end{eqnarray}
</latex>
+</para>
+ <para>
+OSI-CLP, an optimization library written in C++, is used for solving the linear programming problems.
+
+ </para>
+<para>
+<title>Options</title>
+The options allow the user to set various parameters of the Optimization problem. The syntax for the options is given by:
</para>
<para>
-The routine calls Clp for solving the linear programming problem, Clp is a library written in C++.
+options= list("MaxIter", [---], "CpuTime", [---], "GradObj", ---, "Hessian", ---, "GradCon", ---);
</para>
<para>
-The options allows the user to set various parameters of the Optimization problem.
-It should be defined as type "list" and contains the following fields. In the current version it only contains maxiter.
+The options should be defined as type "list" and consist of the following fields:
<itemizedlist>
-<listitem>Syntax : options= list("MaxIter", [---]);</listitem>
-<listitem>MaxIter : a Scalar, containing the Maximum Number of Iteration that the solver should take.</listitem>
-<listitem>Default Values : options = list("MaxIter", [3000]);</listitem>
+<listitem>MaxIter : A Scalar, specifying the Maximum Number of iterations that the solver should take.</listitem>
</itemizedlist>
+</para>
+<para>
+The default values for the various items are given as:
</para>
<para>
-The exitflag allows to know the status of the optimization which is given back by CLP.
+options = list("MaxIter", [3000], "CpuTime", [600]);
+ </para>
+
+ <para>
+The exitflag allows the user to know the status of the optimization which is returned by Ipopt. The values it can take and what they indicate is described below:
<itemizedlist>
-<listitem>exitflag=0 : Optimal Solution Found </listitem>
-<listitem>exitflag=1 : Primal Infeasible </listitem>
-<listitem>exitflag=2 : Dual Infeasible</listitem>
-<listitem>exitflag=3 : Maximum Number of Iterations Exceeded. Output may not be optimal.</listitem>
-<listitem>exitflag=4 : Solution Abandoned</listitem>
-<listitem>exitflag=5 : Primal objective limit reached.</listitem>
-<listitem>exitflag=6 : Dual objective limit reached.</listitem>
+<listitem>0 : Optimal Solution Found </listitem>
+<listitem>1 : Primal Infeasible </listitem>
+<listitem>2 : Dual Infeasible</listitem>
+<listitem>3 : Maximum Number of Iterations Exceeded. Output may not be optimal.</listitem>
+<listitem>4 : Solution Abandoned</listitem>
+<listitem>5 : Primal objective limit reached.</listitem>
+<listitem>6 : Dual objective limit reached.</listitem>
</itemizedlist>
</para>
+
<para>
-The output data structure contains detailed informations about the optimization process.
-It has type "struct" and contains the following fields.
+The output data structure contains detailed information about the optimization process.
+It is of type "struct" and contains the following fields.
<itemizedlist>
-<listitem>output.iterations: The number of iterations performed during the search</listitem>
+<listitem>output.Iterations: The number of iterations performed.</listitem>
<listitem>output.constrviolation: The max-norm of the constraint violation.</listitem>
</itemizedlist>
</para>
<para>
-The lambda data structure contains the Lagrange multipliers at the end
-of optimization. In the current version the values are returned only when the the solution is optimal.
+The lambda data structure contains the Lagrange multipliers at the end of optimization. In the current version the values are returned only when the the solution is optimal.
It has type "struct" and contains the following fields.
<itemizedlist>
<listitem>lambda.lower: The Lagrange multipliers for variable lower bounds.</listitem>
@@ -130,13 +150,41 @@ It has type "struct" and contains the following fields.
</para>
<para>
</para>
+
</refsection>
+<para>
+A few examples displaying the various functionalities of linprog have been provided below. You will find a series of problems and the appropriate code snippets to solve them.
+ </para>
<refsection>
- <title>Examples</title>
+ <title>Example</title>
+ <para>
+ Here we solve a simple objective function, subjected to six linear inequality constraints.
+ </para>
+ <para>
+Find x in R^2 such that it minimizes:
+ </para>
+ <para>
+<latex>
+\begin{eqnarray}
+\mbox{min}_{x}\ f(x) = -x_{1} - \dfrac{x_{2}}{3} \\
+\end{eqnarray}
+\text{Subjected to:}\\
+\begin{eqnarray}
+\hspace{1pt} &amp;x_{1} + x_{2}&amp;\leq 2\\
+\hspace{1pt} &amp;x_{1} + \dfrac{x_{2}}{4}&amp;\leq 1\\
+\hspace{1pt} &amp;x_{1} - x_{2}&amp;\leq 2\\
+\hspace{1pt} &amp;-\dfrac{x_{1}}{4} - x_{2}&amp;\leq 1\\
+\hspace{1pt} &amp;-x_{1} - x_{2}&amp;\leq -1\\
+\hspace{1pt} &amp;-x_{1} + x_{2}&amp;\leq 2\\
+\end{eqnarray}
+</latex>
+ </para>
+ <para>
+
+ </para>
<programlisting role="example"><![CDATA[
-//Optimal problems
-//Linear program, linear inequality constraints
+//Example 1: Linear program, linear inequality constraints
c=[-1,-1/3]'
A=[1,1;1,1/4;1,-1;-1/4,-1;-1,-1;-1,1]
b=[2,1,2,1,-1,2]
@@ -147,9 +195,22 @@ b=[2,1,2,1,-1,2]
</refsection>
<refsection>
- <title>Examples</title>
+ <title>Example</title>
+<para>
+Here we build up on the previous example by adding linear equality constraints.
+We add the following constraints to the problem specified above:
+ </para>
+ <para>
+<latex>
+\begin{eqnarray}
+\hspace{1pt} &amp;x_{1} + \dfrac{x_{2}}{4}&amp;= 1/2
+\end{eqnarray}
+</latex>
+ </para>
+<para>
+</para>
<programlisting role="example"><![CDATA[
-//Linear program with Linear Inequalities and Equalities`
+//Example 2: Linear program with Linear Inequalities and Equalities`
c=[-1,-1/3]'
A=[1,1;1,1/4;1,-1;-1/4,-1;-1,-1;-1,1]
b=[2,1,2,1,-1,2]
@@ -162,9 +223,22 @@ beq=[1/2]
</refsection>
<refsection>
- <title>Examples</title>
+ <title>Example</title>
+<para>
+In this example, we proceed to add the upper and lower bounds to the objective function.
+ </para>
+ <para>
+<latex>
+\begin{eqnarray}
+-1 &amp;\leq x_{1} &amp;\leq 1.5\\
+-0.5 &amp;\leq x_{2} &amp;\leq 1.25
+\end{eqnarray}
+</latex>
+ </para>
+<para>
+</para>
<programlisting role="example"><![CDATA[
-//Linear program with all constraint types
+//Example 3: Linear program with all constraint types
c=[-1,-1/3]'
A=[1,1;1,1/4;1,-1;-1/4,-1;-1,-1;-1,1]
b=[2,1,2,1,-1,2]
@@ -177,11 +251,34 @@ ub=[1.5,1.25]
]]></programlisting>
</refsection>
-
<refsection>
- <title>Examples</title>
- <programlisting role="example"><![CDATA[
-//Primal Infeasible Problem
+<title>Example</title>
+
+ <para>
+Primal Infeasible Problems: Find x in R^3 such that it minimizes:
+ </para>
+ <para>
+<latex>
+\begin{eqnarray}
+mbox{min}_{x}\ f(x) = x_{1} - x_{2} \- x_{3}\\
+\end{eqnarray}
+\\\text{Subjected to:}\\
+\begin{eqnarray}
+\hspace{70pt} &amp;x_{1} + 2x_{2} - x{3}&amp;\leq -4\\
+\hspace{70pt} &amp;x_{1} + 4x_{2} + 3x{3}&amp;= 10\\
+\hspace{70pt} &amp;x_{1} + x_{2}&amp;= 100\\
+\end{eqnarray}
+\\
+\begin{eqnarray}
+\hspace{135pt}0 &amp;\leq x_{1} &amp;\leq \infty\\
+\hspace{135pt}0 &amp;\leq x_{2} &amp;\leq \infty\\
+\hspace{135pt}0 &amp;\leq x_{3} &amp;\leq \infty
+\end{eqnarray}
+</latex>
+ </para>
+ <para>
+ </para> <programlisting role="example"><![CDATA[
+//Example 4: Primal Infeasible Problem
c=[-1,-1,-1]'
A=[1,2,-1]
b=[-4]
@@ -196,9 +293,33 @@ ub=[%inf,%inf,%inf]
</refsection>
<refsection>
- <title>Examples</title>
+ <title>Example</title>
+
+ <para>
+Unbounded Problems: Find x in R^3 such that it minimizes:
+ </para>
+ <para>
+<latex>
+\begin{eqnarray}
+mbox{min}_{x}\ f(x) = x_{1} - x_{2} \- x_{3}\\
+\end{eqnarray}
+\\\text{Subjected to:}\\
+\begin{eqnarray}
+\hspace{70pt} &amp;-x_{1} - x_{2} + 4x{3}&amp;\leq -8\\
+\hspace{70pt} &amp;x_{1} + x_{2} + 4x{3}&amp;\leq 5\\
+\end{eqnarray}
+\\
+\begin{eqnarray}
+\hspace{115pt}-\infty &amp;\leq x_{1} &amp;\leq \infty\\
+\hspace{115pt}-\infty &amp;\leq x_{2} &amp;\leq \infty\\
+\hspace{115pt}-\infty &amp;\leq x_{3} &amp;\leq \infty
+\end{eqnarray}
+</latex>
+ </para>
+ <para>
+ </para>
<programlisting role="example"><![CDATA[
-//Dual Infeasible Problem
+//Example 5: Unbounded Problem
c=[3,5,-7]'
A=[-1,-1,4;1,1,4]
b=[-8,5]
@@ -213,7 +334,7 @@ ub=[%inf,%inf,%inf]
</refsection>
<refsection>
- <title>Examples</title>
+ <title>Example</title>
<programlisting role="example"><![CDATA[
filepath = get_absolute_file_path('linprog.dem.sce');
filepath = filepath + "exmip1.mps"
@@ -221,6 +342,10 @@ filepath = filepath + "exmip1.mps"
]]></programlisting>
</refsection>
+
+
+
+
<refsection>
<title>Authors</title>
<simplelist type="vert">