diff options
Diffstat (limited to 'help/en_US/lsqnonneg.xml')
-rw-r--r-- | help/en_US/lsqnonneg.xml | 142 |
1 files changed, 102 insertions, 40 deletions
diff --git a/help/en_US/lsqnonneg.xml b/help/en_US/lsqnonneg.xml index a8d7a00..7d13b0c 100644 --- a/help/en_US/lsqnonneg.xml +++ b/help/en_US/lsqnonneg.xml @@ -25,31 +25,38 @@ <title>Calling Sequence</title> <synopsis> xopt = lsqnonneg(C,d) - xopt = lsqnonneg(C,d,param) + xopt = lsqnonneg(C,d,options) [xopt,resnorm,residual,exitflag,output,lambda] = lsqnonneg( ... ) </synopsis> </refsynopsisdiv> <refsection> - <title>Parameters</title> + <title>Input 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. 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. Number of elements in d is equal to the number of rows in C matrix.</para></listitem></varlistentry> + <varlistentry><term>C :</term> + <listitem><para>A matrix of doubles, representing the multiplier of x in the expression C⋅x - d. The 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, representing the additive constant term in the expression C⋅x - d. The number of elements in d is equal to the number of rows in C matrix.</para></listitem></varlistentry> + <varlistentry><term>options:</term> + <listitem><para> A list, containing the option for user to specify. See below for details.</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>resnorm :</term> - <listitem><para> a double, objective value returned as the scalar value norm(C⋅x-d)^2.</para></listitem></varlistentry> + <listitem><para> A double, containing the objective value returned as a scalar value norm(C⋅x-d)^2.</para></listitem></varlistentry> <varlistentry><term>residual :</term> - <listitem><para> a vector of double, solution residuals returned as the vector d-C⋅x.</para></listitem></varlistentry> + <listitem><para> A vector of doubles, containing the solution residuals, returned as a vector d-C⋅x.</para></listitem></varlistentry> <varlistentry><term>exitflag :</term> - <listitem><para> The exit status. See below for details.</para></listitem></varlistentry> + <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 structure consist of statistics about the optimization. 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 at the optimized point. See below for details.</para></listitem></varlistentry> </variablelist> </refsection> @@ -61,50 +68,57 @@ Solves nonnegative least-squares curve fitting problems specified by : <para> <latex> \begin{eqnarray} -&\mbox{min}_{x} -& 1/2||C⋅x - d||_2^2 \\ -& & x \geq 0 \\ +\hspace{1pt} &\mbox{min}_{x} +\hspace{1pt} & 1/2||C⋅x - d||_2^2 \\ +\hspace{1pt} & & x \geq 0 \\ \end{eqnarray} </latex> </para> <para> -The routine calls Ipopt for solving the nonnegative least-squares curve fitting problems, Ipopt is a library written in C++. +lsqlin calls Ipopt, an optimization library written in C++, to solve the nonnegative least-squares curve fitting problem. + </para> + <para> +The options should be defined as type "list" and consist of the following fields: +</para> + <para> +options= list("MaxIter", [---], "CpuTime", [---]); </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. <itemizedlist> -<listitem>Syntax : options= list("MaxIter", [---], "CpuTime", [---]);</listitem> -<listitem>MaxIter : a Scalar, containing the Maximum Number of Iteration that the solver should take.</listitem> -<listitem>CpuTime : a Scalar, containing the Maximum amount of CPU Time that the solver should take.</listitem> -<listitem>Default Values : options = list("MaxIter", [3000], "CpuTime", [600]);</listitem> +<listitem>MaxIter : A Scalar, specifying the maximum number of iterations that the solver should take.</listitem> +<listitem>CpuTime : A Scalar, specifying the maximum amount of CPU time in seconds that the solver should take.</listitem> </itemizedlist> </para> <para> -The exitflag allows to know the status of the optimization which is given back by Ipopt. + The default values for the various items are given as: + </para> + <para> +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 : Maximum Number of Iterations Exceeded. Output may not be optimal.</listitem> -<listitem>exitflag=2 : Maximum CPU Time exceeded. Output may not be optimal.</listitem> -<listitem>exitflag=3 : Stop at Tiny Step.</listitem> -<listitem>exitflag=4 : Solved To Acceptable Level.</listitem> -<listitem>exitflag=5 : Converged to a point of local infeasibility.</listitem> +<listitem> 0 : Optimal Solution Found </listitem> +<listitem> 1 : Maximum Number of Iterations Exceeded. Output may not be optimal.</listitem> +<listitem> 2 : Maximum amount of CPU Time exceeded. Output may not be optimal.</listitem> +<listitem> 3 : Stop at Tiny Step.</listitem> +<listitem> 4 : Solved To Acceptable Level.</listitem> +<listitem> 5 : Converged to a point of local infeasibility.</listitem> </itemizedlist> </para> <para> -For more details on exitflag see the ipopt documentation, go to http://www.coin-or.org/Ipopt/documentation/ +For more details on exitflag, see the Ipopt documentation which can be found on http://www.coin-or.org/Ipopt/documentation/ </para> - <para> -The output data structure contains detailed informations about the optimization process. -It has type "struct" and contains the following fields. + <para> +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. + <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. It has type "struct" and contains the following fields. <itemizedlist> <listitem>lambda.lower: The Lagrange multipliers for the lower bound constraints.</listitem> @@ -114,11 +128,35 @@ It has type "struct" and contains the following fields. <para> </para> </refsection> - +<para> +A few examples displaying the various functionalities of lsqnonneg 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> + We begin with a simple objective function. + </para> + <para> +<latex> +\begin{eqnarray} +\mbox{min}_{x} 1/2||C⋅x - d||_2^2 \\ +\end{eqnarray} +\\ +\text{Where C⋅x - d = }\:\begin{cases} +\begin{eqnarray} +x_{1} + x_{2} + x_{3} - 89\\ +x_{1} + x_{2} - 67\\ +x_{2} + x_{3} - 53\\ +x_{1} - 35\\ +x_{3} - 20 +\end{eqnarray} +\end{cases} +</latex> + </para> + <para> + </para> <programlisting role="example"><![CDATA[ -// A basic lsqnonneg problem +// Example 1: A basic lsqnonneg problem C = [1 1 1; 1 1 0; 0 1 1; @@ -134,6 +172,30 @@ d = [89; </refsection> <refsection> + <title>Example</title> + <para> + In this example, we further enhance the functionality of qpipopt by setting input options. This provides us with the ability to control the solver parameters such as the maximum number of solver iterations and the max. CPU time allowed for the computation. + </para> + <para> + </para> + <programlisting role="example"><![CDATA[ +// Example 2: A basic lsqnonneg problem with solver options. +C = [1 1 1; +1 1 0; +0 1 1; +1 0 0; +0 0 1] +d = [89; +67; +53; +35; +20;] +options = list("MaxIter", [5000], "CpuTime", [1000]); +[xopt,resnorm,residual,exitflag,output,lambda] = lsqnonneg(C,d,options) + ]]></programlisting> +</refsection> + +<refsection> <title>Authors</title> <simplelist type="vert"> <member>Harpreet Singh</member> |