<< quadprog FOSSEE_Optimization_Toolbox quadprogmat >>

FOSSEE_Optimization_Toolbox >> FOSSEE_Optimization_Toolbox > quadprogCLP

quadprogCLP

Solves a quadratic optimization problem with linear constraints.

Syntax

xopt = quadprogCLP(H,f,A,b)
xopt = quadprogCLP(H,f,A,b,Aeq,beq)
xopt = quadprogCLP(H,f,A,b,Aeq,beq,lb,ub)
[xopt,fopt,exitflag,output,lamda] = quadprogCLP( ... )

Input Parameters

H :

A symmetric matrix of doubles, represents coefficients of quadratic terms in the objective function.

f :

A vector of doubles, represents coefficients of the linear terms in the objective function

A :

A matrix of doubles, containing the coefficients of linear inequality constraints. It has size 'm x n' where 'm' is the number of linear inequality constraints, and 'n' is the number of decision variables.

b :

A vector of doubles, related to 'A' and containing the right hand sides of the linear inequality constraints.

Aeq :

A matrix of doubles, containing the coefficients of linear equality constraints. It has size 'm1 x n' where 'm1' is the number of linear equality constraints, and 'n' is the number of decision variables.

beq :

A vector of doubles, related to 'Aeq' and containing the right hand sides of the linear equality constraints.

lb :

A vector of doubles, containing lower bounds of the decision variables. The default value is 0.

ub :

A vector of doubles, containing upper bounds of the decision variables. The default value is %inf.

Outputs

xopt :

A vector of doubles, the computed solution of the optimization problem.

fopt :

A double, the value of the objective function at xopt.

exitflag :

The exit status. See below for details.

iterations :

Total number of iterations performed by the solver.

output :

A structure containing the statistics obtained from the solver.

lambda :

A structure containing Lagrange multipliers at the solution of problem.

Description

Search the minimum of a constrained quadratic optimization problem specified by:

\begin{eqnarray}
\hspace{1pt} \mbox{min}_{x} \frac{1}{2}⋅x^T⋅H⋅x + f^T⋅x  \\
\end{eqnarray}
\\\text{Subjected to:}\\
\begin{eqnarray}
\hspace{70pt} A\cdot x &\leq b \\
\hspace{70pt} A_{eq}\cdot x &= b_{eq} \\
\hspace{70pt} lb \leq x &\leq ub \\
\end{eqnarray}

The routine calls CLP for solving the quadratic problem, CLP is a library written in C++ and available from Coin-OR.

The exitflag allows to know the status of the optimization which is given back by CLP.

For more details on exitflag see the CLP documentation, go to https://coin-or.github.io/Clp/

Example

//Example 1:
//Ref : example 14 :
//https://www.me.utexas.edu/~jensen/ORMM/supplements/methods/nlpmethod/S2_quadratic.pdf
// min. -8*x1*x1 -16*x2*x2 + x1 + 4*x2
// such that
//    x1 + x2 <= 5,
//    x1 <= 3,
//    x1 >= 0,
//    x2 >= 0
H = [2 0
0 8];
f = [-8; -16];
A = [1 1;1 0];
b = [5;3];
lb = [0; 0];
ub = [%inf; %inf];
[xopt,fopt,exitflag,output,lambda] = quadprogCLP(H,f,A,b,[],[],lb,ub)
// Press ENTER to continue

Example

//Example 2:
//Find x in R^6 such that:
Aeq= [1,-1,1,0,3,1;
-1,0,-3,-4,5,6;
2,5,3,0,1,0];
beq=[1; 2; 3];
A= [0,1,0,1,2,-1;
-1,0,2,1,1,0];
b = [-1; 2.5];
lb=[-1000; -10000; 0; -1000; -1000; -1000];
ub=[10000; 100; 1.5; 100; 100; 1000];
//and minimize 0.5*x'*H*x + f'*x with
f=[1; 2; 3; 4; 5; 6]; H=eye(6,6);
[xopt,fopt,exitflag,output,lambda]=quadprogCLP(H,f,A,b,Aeq,beq,lb,ub)

Example

//Example 3:
//Solving Linear Programming Problem
// min -x0 - x1
// subject to
//    x0+2x1 <= 3
//  2x0+x1 <= 3
f = [-1;-1];
A = [1,2;2,1];
b = [3;3];
[xopt,fopt] = quadprogCLP([],f,A,b);

Authors


Report an issue
<< quadprog FOSSEE_Optimization_Toolbox quadprogmat >>