Matlab
Setup
QOCO is initialized by creating a QOCO object as follows
solver = qoco
The problem is specified in the setup phase by running
settings.verbose = 1 # Can modify any settings prior to setup.
solver.setup(n, m, p, P, c, A, b, G, h, l, nsoc, q, settings)
The arguments c
, b
and q
are Matlab arrays, and P
, A
, and G
are Matlab matrices. The matrix P
can be either complete or just the upper triangular part, but QOCO will only use the upper triangular part.
If you do not have equality constraints, pass in []
for A
and b
. Pass in []
for G
and h
if you do not have inequality or second-order cone constraints, and pass in []
for q
and 0
for nsoc
if you do not have second-order cone constraints.
The struct settings
specifies the solver settings. If no settings struct is given to the setup
function, the default settings will be used. The allowed parameters are defined in settings.
Solve
results = solver.solve()
The results
struct contains the following
Member |
Description |
---|---|
|
Primal solution |
|
Slack variable for conic constraints |
|
Dual solution for equality constraints |
|
Dual solution for conic constraints |
|
Solve status see exitflags |
|
Objective value |
|
Number of iterations |
|
Setup time in seconds |
|
Solve time in seconds |
|
Primal residual |
|
Dual residual |
|
Duality gap |