diff options
Diffstat (limited to 'help/en_US/qpipopt.xml')
-rw-r--r-- | help/en_US/qpipopt.xml | 45 |
1 files changed, 21 insertions, 24 deletions
diff --git a/help/en_US/qpipopt.xml b/help/en_US/qpipopt.xml index d93f758..144fe18 100644 --- a/help/en_US/qpipopt.xml +++ b/help/en_US/qpipopt.xml @@ -38,7 +38,7 @@ <varlistentry><term>nbCon :</term> <listitem><para> a 1 x 1 matrix of doubles, number of constraints</para></listitem></varlistentry> <varlistentry><term>Q :</term> - <listitem><para> a n x n matrix of doubles, where n is number of variables, represents coefficients of quadratic in the quadratic problem.</para></listitem></varlistentry> + <listitem><para> a n x n symmetric matrix of doubles, where n is number of variables, represents coefficients of quadratic in the quadratic problem.</para></listitem></varlistentry> <varlistentry><term>p :</term> <listitem><para> a 1 x n matrix of doubles, where n is number of variables, represents coefficients of linear in the quadratic problem</para></listitem></varlistentry> <varlistentry><term>LB :</term> @@ -91,19 +91,17 @@ 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; -1,0,-3,-4,5,6; 2,5,3,0,1,0 0,1,0,1,2,-1; -1,0,2,1,1,0]; -conLB=[1 2 3 -%inf -%inf]'; -conUB = [1 2 3 -1 2.5]'; -//with x between ci and cs: -lb=[-1000 -10000 0 -1000 -1000 -1000]; -ub=[10000 100 1.5 100 100 1000]; +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); +p=[1; 2; 3; 4; 5; 6]; Q=eye(6,6); nbVar = 6; nbCon = 5; [xopt,fopt,exitflag,output,lambda]=qpipopt(nbVar,nbCon,Q,p,lb,ub,conMatrix,conLB,conUB) @@ -114,23 +112,22 @@ nbCon = 5; <refsection> <title>Examples</title> <programlisting role="example"><![CDATA[ -//min. -8*x1 -16*x2 + x1^2 + 4* x2^2 -// such that -// x1 + x2 <= 5, -// x1 <= 3, -// x1 >= 0, -// x2 >= 0 -conMatrix= [1 1]; -conLB=[-%inf]; -conUB = [5]; -//with x between ci and cs: -lb=[0,0]; -ub=[3,%inf]; -//and minimize 0.5*x'*Q*x + p'*x with -p=[-8,-16]; -Q=[1,0;0,4]; +//Find the value of x that minimize following function +// f(x) = 0.5*x1^2 + x2^2 - x1*x2 - 2*x1 - 6*x2 +// Subject to: +// x1 + x2 ≤ 2 +// –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]; +conUB = [2; 2; 3]; +conLB = [-%inf; -%inf; -%inf]; +lb = [0; 0]; +ub = [%inf; %inf]; nbVar = 2; -nbCon = 1; +nbCon = 3; [xopt,fopt,exitflag,output,lambda] = qpipopt(nbVar,nbCon,Q,p,lb,ub,conMatrix,conLB,conUB) ]]></programlisting> |