comment about XP SP3
[scilab.git] / scilab / modules / optimization / help / en_US / qld.xml
1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" version="5.0-subset Scilab" xml:lang="en" xml:id="qld">
3   <info>
4     <pubdate>$LastChangedDate$</pubdate>
5   </info>
6   <refnamediv>
7     <refname>qld</refname>
8     <refpurpose> linear quadratic programming solver</refpurpose>
9   </refnamediv>
10   <refsynopsisdiv>
11     <title>Calling Sequence</title>
12     <synopsis>[x,lagr]=qld(Q,p,C,b,ci,cs,me [,tol])
13 [x,lagr,info]=qld(Q,p,C,b,ci,cs,me [,tol])</synopsis>
14   </refsynopsisdiv>
15   <refsection>
16     <title>Parameters</title>
17     <variablelist>
18       <varlistentry>
19         <term>Q</term>
20         <listitem>
21           <para>real positive definite symmetric matrix (dimension <literal>n x n</literal>).</para>
22         </listitem>
23       </varlistentry>
24       <varlistentry>
25         <term>p</term>
26         <listitem>
27           <para>real (column) vector (dimension <literal> n</literal>)</para>
28         </listitem>
29       </varlistentry>
30       <varlistentry>
31         <term>C</term>
32         <listitem>
33           <para>real matrix (dimension <literal> (me + md) x n</literal>) </para>
34         </listitem>
35       </varlistentry>
36       <varlistentry>
37         <term>b</term>
38         <listitem>
39           <para>RHS column vector (dimension <literal> (me + md)</literal>)</para>
40         </listitem>
41       </varlistentry>
42       <varlistentry>
43         <term>ci</term>
44         <listitem>
45           <para>column vector of lower-bounds (dimension <literal>n</literal>). If
46             there are no lower bound constraints, put <literal>ci = []</literal>. If
47             some components of <literal>x</literal> are bounded from below, set the
48             other (unconstrained) values of <literal>ci</literal> to a very  large
49             negative  number (e.g. <literal>ci(j) =
50               -number_properties('huge')</literal>.</para>
51         </listitem>
52       </varlistentry>
53       <varlistentry>
54         <term>cs</term>
55         <listitem>
56           <para>column vector of upper-bounds. (Same remarks as above).</para>
57         </listitem>
58       </varlistentry>
59       <varlistentry>
60         <term>me</term>
61         <listitem>
62           <para>number of equality constraints (i.e. <literal>C(1:me,:)*x = b(1:me)</literal>)</para>
63         </listitem>
64       </varlistentry>
65       <varlistentry>
66         <term>tol</term>
67         <listitem>
68           <para>:Floatting point number, required prĂ©cision.</para>
69         </listitem>
70       </varlistentry>
71       <varlistentry>
72         <term>x</term>
73         <listitem>
74           <para>optimal solution found.</para>
75         </listitem>
76       </varlistentry>
77       <varlistentry>
78         <term>lagr</term>
79         <listitem>
80           <para>vector of Lagrange multipliers.  If lower and upper-bounds
81             <literal>ci,cs</literal> are provided, <literal>lagr</literal> has  <literal>n +
82               me + md</literal> components and <literal>lagr(1:n)</literal> is the
83             Lagrange  vector associated with the bound constraints and
84             <literal>lagr (n+1 : n + me + md)</literal> is the Lagrange vector
85             associated  with the linear constraints. (If an upper-bound
86             (resp. lower-bound) constraint <literal>i</literal> is active
87             <literal>lagr(i)</literal> is &gt; 0 (resp. &lt;0). If no bounds are
88             provided, <literal>lagr</literal> has only <literal>me + md</literal>
89             components.</para>
90         </listitem>
91       </varlistentry>
92       <varlistentry>
93         <term>info</term>
94         <listitem>
95           <para>integer, return the execution status instead of sending
96           errors.</para>
97           <para>info==1 : Too many iterations needed</para>
98           <para>info==2 : Accuracy insufficient to statisfy convergence criterion</para>
99           <para>info==5 : Length of working array is too short</para>
100           <para>info==10: The constraints are inconsistent</para>
101         </listitem>
102       </varlistentry>
103     </variablelist>
104   </refsection>
105   <refsection>
106     <title>Description</title>
107     <para>Minimize <literal> 0.5*x'*Q*x + p'*x</literal></para>
108     <para>under the constraints</para>
109     <programlisting><![CDATA[
110
111  C(j,:) x = b(j),  j=1,...,me
112  C(j,:) x <= b(j), j=me+1,...,me+md
113  ci <= x <= cs
114    
115     ]]></programlisting>
116     <para>This function requires  <literal>Q</literal> to be positive definite, if it is
117       not the case, one may use the <link linkend="quapro">quapro</link> function.</para>
118   </refsection>
119   <refsection>
120     <title>Examples</title>
121     <programlisting role="example"><![CDATA[
122
123 //Find x in R^6 such that:
124 //C1*x = b1 (3 equality constraints i.e me=3)
125 C1= [1,-1,1,0,3,1;
126     -1,0,-3,-4,5,6;
127      2,5,3,0,1,0];
128 b1=[1;2;3];
129 //C2*x <= b2 (2 inequality constraints)
130 C2=[0,1,0,1,2,-1;
131     -1,0,2,1,1,0];
132 b2=[-1;2.5];
133 //with  x between ci and cs:
134 ci=[-1000;-10000;0;-1000;-1000;-1000];cs=[10000;100;1.5;100;100;1000];
135 //and minimize 0.5*x'*Q*x + p'*x with
136 p=[1;2;3;4;5;6]; Q=eye(6,6);
137 //No initial point is given;
138 C=[C1;C2] ; //
139 b=[b1;b2] ;  //
140 me=3;
141 [x,lagr]=qld(Q,p,C,b,ci,cs,me)
142 //Only linear constraints (1 to 4) are active (lagr(1:6)=0):
143  
144   ]]></programlisting>
145   </refsection>
146   <refsection>
147     <title>See Also</title>
148     <simplelist type="inline">
149       <member>
150         <link linkend="quapro">quapro</link>
151       </member>
152       <member>
153         <link linkend="optim">optim</link>
154       </member>
155     </simplelist>
156   </refsection>
157   <refsection>
158     <title>Authors</title>
159     <variablelist>
160       <varlistentry>
161         <term>K.Schittkowski</term>
162         <listitem>
163           <para>, University of Bayreuth, Germany</para>
164         </listitem>
165       </varlistentry>
166       <varlistentry>
167         <term> A.L. Tits and J.L. Zhou</term>
168         <listitem>
169           <para> , University of Maryland</para>
170         </listitem>
171       </varlistentry>
172     </variablelist>
173   </refsection>
174   <refsection>
175     <title>Used Functions</title>
176     <para>ql0001.f in routines/optim directory</para>
177   </refsection>
178 </refentry>