9cbca5bf8fca9dd1d2bebabff79638f96af96fdf
[scilab.git] / scilab / modules / optimization / help / en_US / qpsolve.xml
1 <?xml version="1.0" encoding="ISO-8859-1"?><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="qpsolve"><info><pubdate>March 2008</pubdate></info><refnamediv><refname>qpsolve</refname><refpurpose> linear quadratic programming solver</refpurpose></refnamediv>
2   
3   
4   
5   
6   
7   <refsynopsisdiv><title>Calling Sequence</title><synopsis>[x [,iact [,iter [,f]]]]=qpsolve(Q,p,C,b,ci,cs,me)</synopsis></refsynopsisdiv>
8   <refsection><title>Parameters</title><variablelist><varlistentry><term>Q</term><listitem><para>real positive definite symmetric matrix (dimension <literal>n x n</literal>).</para></listitem></varlistentry><varlistentry><term>p</term><listitem><para>real (column) vector (dimension <literal> n</literal>)</para></listitem></varlistentry><varlistentry><term>C</term><listitem><para>real matrix (dimension <literal> (me + md) x
9           n</literal>). This matrix may be stored as either a dense
10           matrix either a sparse one. </para></listitem></varlistentry><varlistentry><term>b</term><listitem><para>RHS column vector (dimension <literal> (me + md)</literal>)</para></listitem></varlistentry><varlistentry><term>ci</term><listitem><para>column vector of lower-bounds (dimension <literal>n</literal>). If
11             there are no lower bound constraints, put <literal>ci = []</literal>. If
12             some components of <literal>x</literal> are bounded from below, set the
13             other (unconstrained) values of <literal>ci</literal> to a very  large
14             negative  number (e.g. <literal>ci(j) =
15               -number_properties('huge')</literal>.</para></listitem></varlistentry><varlistentry><term>cs</term><listitem><para>column vector of upper-bounds. (Same remarks as above).</para></listitem></varlistentry><varlistentry><term>me</term><listitem><para>number of equality constraints (i.e. <literal>C(1:me,:)*x = b(1:me)</literal>)</para></listitem></varlistentry><varlistentry><term>x</term><listitem><para>optimal solution found.</para></listitem></varlistentry><varlistentry><term>iact</term><listitem><para>vector, indicator of active constraints. The first non
16           zero entries give the index of the active constraints</para></listitem></varlistentry><varlistentry><term>iter</term><listitem><para>. 2x1 vector, first component gives the number of "main" 
17         iterations, the second one says how many constraints were
18         deleted after they became active.</para></listitem></varlistentry></variablelist></refsection>
19   <refsection><title>Description</title><para>Minimize <literal> 0.5*x'*Q*x + p'*x</literal></para><para>under the constraints</para><programlisting><![CDATA[
20
21  C(j,:) x = b(j),  j=1,...,me
22  C(j,:) x <= b(j), j=me+1,...,me+md
23  ci <= x <= cs
24    
25     ]]></programlisting><para>This function requires  <literal>Q</literal> to be positive definite, if it is
26       not the case, one may use the <link linkend="quapro">quapro</link> function.</para></refsection>
27   <refsection><title>Examples</title><programlisting role="example"><![CDATA[
28
29 //Find x in R^6 such that:
30 //C1*x = b1 (3 equality constraints i.e me=3)
31 C1= [1,-1,1,0,3,1;
32     -1,0,-3,-4,5,6;
33      2,5,3,0,1,0];
34 b1=[1;2;3];
35 //C2*x <= b2 (2 inequality constraints)
36 C2=[0,1,0,1,2,-1;
37     -1,0,2,1,1,0];
38 b2=[-1;2.5];
39 //with  x between ci and cs:
40 ci=[-1000;-10000;0;-1000;-1000;-1000];cs=[10000;100;1.5;100;100;1000];
41 //and minimize 0.5*x'*Q*x + p'*x with
42 p=[1;2;3;4;5;6]; Q=eye(6,6);
43 //No initial point is given;
44 C=[C1;C2] ; //
45 b=[b1;b2] ;  //
46 me=3;
47 [x,iact,iter,f]=qpsolve(Q,p,C,b,ci,cs,me)
48 //Only linear constraints (1 to 4) are active 
49  
50   ]]></programlisting></refsection>
51   <refsection><title>See Also</title><simplelist type="inline">
52     <member>
53       <link linkend="quapro">quapro</link>
54     </member>
55     <member>
56       <link linkend="optim">optim</link>
57     </member>
58     <member>
59       <link linkend="qp_solve">qp_solve</link>
60     </member>
61   </simplelist></refsection>
62   <refsection><title>Authors</title><variablelist><varlistentry><term>S. Steer</term><listitem><para>, INRIA (Scilab interface)</para></listitem></varlistentry><varlistentry><term>Berwin A. Turlach</term><listitem><para>,School of Mathematics and
63     Statistics (M019), The University of Western Australia, Crawley,
64     AUSTRALIA (solver code)</para></listitem></varlistentry></variablelist></refsection>
65   <refsection><title>Used Functions</title><para>qpgen1.f (also named QP.solve.f) developped by Berwin A. Turlach according to the Goldfarb/Idnani algorithm</para></refsection>
66
67 </refentry>