Next: , Previous: , Up: Optimization   [Contents][Index]


25.2 Quadratic Programming

Octave can also solve Quadratic Programming problems, this is

min 0.5 x'*H*x + x'*q

subject to

     A*x = b
     lb <= x <= ub
     A_lb <= A_in*x <= A_ub
: [x, obj, info, lambda] = qp (x0, H)
: [x, obj, info, lambda] = qp (x0, H, q)
: [x, obj, info, lambda] = qp (x0, H, q, A, b)
: [x, obj, info, lambda] = qp (x0, H, q, A, b, lb, ub)
: [x, obj, info, lambda] = qp (x0, H, q, A, b, lb, ub, A_lb, A_in, A_ub)
: [x, obj, info, lambda] = qp (…, options)

Solve a quadratic program (QP).

Solve the quadratic program defined by

min 0.5 x'*H*x + x'*q
 x

subject to

A*x = b
lb <= x <= ub
A_lb <= A_in*x <= A_ub

using a null-space active-set method.

Any bound (A, b, lb, ub, A_lb, A_ub) may be set to the empty matrix ([]) if not present. If the initial guess is feasible the algorithm is faster.

options

An optional structure containing the following parameter(s) used to define the behavior of the solver. Missing elements in the structure take on default values, so you only need to set the elements that you wish to change from the default.

MaxIter (default: 200)

Maximum number of iterations.

info

Structure containing run-time information about the algorithm. The following fields are defined:

solveiter

The number of iterations required to find the solution.

info

An integer indicating the status of the solution.

0

The problem is feasible and convex. Global solution found.

1

The problem is not convex. Local solution found.

2

The problem is not convex and unbounded.

3

Maximum number of iterations reached.

6

The problem is infeasible.

: x = pqpnonneg (c, d)
: x = pqpnonneg (c, d, x0)
: [x, minval] = pqpnonneg (…)
: [x, minval, exitflag] = pqpnonneg (…)
: [x, minval, exitflag, output] = pqpnonneg (…)
: [x, minval, exitflag, output, lambda] = pqpnonneg (…)

Minimize 1/2*x'*c*x + d'*x subject to x >= 0.

c and d must be real, and c must be symmetric and positive definite.

x0 is an optional initial guess for x.

Outputs:

See also: optimset, lsqnonneg, qp.


Next: , Previous: , Up: Optimization   [Contents][Index]