ConicOptimization
✖
ConicOptimization
finds values of variables vars that minimize the linear objective f subject to conic constraints cons.
Details and Options




- Conic optimization is also known as mixed-integer conic optimization, linear conic optimization or linear conic programming.
- Conic optimization includes many other forms of optimization, including linear optimization, linear fractional optimization, quadratic optimization, second-order cone optimization, semidefinite optimization and geometric optimization.
- Conic optimization is a convex optimization problem that can be solved globally and efficiently with real, integer or complex variables.
- Conic optimization finds
that solves the primal problem:
-
minimize subject to constraints where - The set
should be a proper convex cone of dimension
. Common cone specifications for
and the sets corresponding to
(VectorGreaterEqual[{x,0},κj]) are:
-
{"NonNegativeCone", m} such that
{"NormCone", m} such that
{"SemidefiniteCone", m} symmetric positive semidefinite matrices "ExponentialCone" such that
"DualExponentialCone" such that
or
{"PowerCone",α} such that
{"DualPowerCone",α} such that
- Mixed-integer conic optimization finds
and
that solve the problem:
-
minimize subject to constraints where - When the objective function is real valued, ConicOptimization solves problems with
by internally converting to real variables
, where
and
.
- The variable specification vars should be a list with elements giving variables in one of the following forms:
-
v variable with name and dimensions inferred
v∈Reals real scalar variable v∈Integers integer scalar variable v∈Complexes complex scalar variable v∈ℛ vector variable restricted to the geometric region v∈Vectors[n,dom] vector variable in or
v∈Matrices[{m,n},dom] matrix variable in or
- The constraints cons can be specified by:
-
LessEqual scalar inequality GreaterEqual scalar inequality VectorLessEqual vector inequality VectorGreaterEqual vector inequality Equal scalar or vector equality Element convex domain or region element - With ConicOptimization[f,cons,vars], parameter equations of the form parval, where par is not in vars and val is numerical or an array with numerical values, may be included in the constraints to define parameters used in f or cons. »
- The primal minimization problem has a related maximization problem that is the Lagrangian dual problem. The dual maximum value is always less than or equal to the primal minimum value, so it provides a lower bound. The dual maximizer provides information about the primal problem, including sensitivity of the minimum value to changes in the constraints. »
- The conic optimization has a dual problem: »
-
maximize subject to constraints where and
is the dual cone to
- The possible solution properties "prop" include: »
-
"PrimalMinimizer" a list of variable values that minimizes "PrimalMinimizerRules" values for the variables vars={v1,…} that minimize "PrimalMinimizerVector" the vector that minimizes "PrimalMinimumValue" the minimum value "DualMaximizer" the vector that maximizes "DualMaximumValue" the dual maximum value "DualityGap" the difference between the dual and primal optimal values "Slack" vectors that convert inequality constraints to equality "ConstraintSensitivity" sensitivity of to constraint perturbations
"ObjectiveVector" the linear objective vector "ConicConstraints" the list of conic constraints in canonical form "ConicConstraintConeSpecifications" the list of specifications for the cones "ConicConstraintConeDimensions" the list of dimensions for the cones in the conic constraints "ConicConstraintAffineLists" the list of matrix, vector pairs for the affine transforms in the conic constraints {"prop1","prop2",…} several solution properties - The following options may be given:
-
MaxIterations Automatic maximum number of iterations to use Method Automatic the method to use PerformanceGoal $PerformanceGoal aspects of performance to try to optimize Tolerance Automatic the tolerance to use for internal comparisons - The option Method->method may be used to specify the method to use. Available methods include:
-
Automatic choose the method automatically "SCS" SCS splitting conic solver "CSDP" CSDP semidefinite optimization solver "DSDP" DSDP semidefinite optimization solver "MOSEK" commercial MOSEK convex optimization solver "Gurobi" commercial Gurobi linear and quadratic optimization solver "Xpress" commercial Xpress linear and quadratic optimization solver - Computations are limited to MachinePrecision.
Examples
open allclose allBasic Examples (3)Summary of the most common use cases
Minimize over a two-dimensional "NormCone":

https://wolfram.com/xid/0n4i0am3wky-iosq29

The optimal point is where is smallest within the region defined by the constraints:

https://wolfram.com/xid/0n4i0am3wky-24qbx

Minimize over the intersection of a triangle
and a disk
:

https://wolfram.com/xid/0n4i0am3wky-et7f8y

Visualize the location of the minimizing point:

https://wolfram.com/xid/0n4i0am3wky-cmy19j

Minimize subject to the constraint
:

https://wolfram.com/xid/0n4i0am3wky-fqxpl8

Scope (35)Survey of the scope of standard use cases
Basic Uses (11)
Minimize subject to constraints
:

https://wolfram.com/xid/0n4i0am3wky-edj208

Several linear inequality constraints can be expressed with VectorGreaterEqual:

https://wolfram.com/xid/0n4i0am3wky-pjuvi

Use v>=
or \[VectorGreaterEqual] to enter the vector inequality sign :

https://wolfram.com/xid/0n4i0am3wky-ivyhv5

An equivalent form using scalar inequalities:

https://wolfram.com/xid/0n4i0am3wky-ib8bsr


https://wolfram.com/xid/0n4i0am3wky-lu8fwi

The inequality may not be the same as
due to possible threading in
:

https://wolfram.com/xid/0n4i0am3wky-wfe84


https://wolfram.com/xid/0n4i0am3wky-cdrbb6

To avoid unintended threading in , use Inactive[Plus]:

https://wolfram.com/xid/0n4i0am3wky-i1qbdu

Use constant parameter equations to avoid unintended threading in :

https://wolfram.com/xid/0n4i0am3wky-dd18z3

https://wolfram.com/xid/0n4i0am3wky-69739j

VectorGreaterEqual represents a conic inequality with respect to the "NonNegativeCone":

https://wolfram.com/xid/0n4i0am3wky-c8jcv

To explicitly specify the dimension of the cone, use {"NonNegativeCone",n}:

https://wolfram.com/xid/0n4i0am3wky-ej00nr


https://wolfram.com/xid/0n4i0am3wky-bhykun

Minimize subject to the constraint
:

https://wolfram.com/xid/0n4i0am3wky-6o2li

Specify the constraint using a conic inequality with "NormCone":

https://wolfram.com/xid/0n4i0am3wky-n3a57


https://wolfram.com/xid/0n4i0am3wky-jmkzci

Minimize subject to the positive semidefinite matrix constraint
:

https://wolfram.com/xid/0n4i0am3wky-fyggwu


https://wolfram.com/xid/0n4i0am3wky-uepysl

Use a vector variable and Indexed[x,i] to specify individual components:

https://wolfram.com/xid/0n4i0am3wky-jj9bsv

Use Vectors[n] to specify the dimension of a vector variable when it is ambiguous:

https://wolfram.com/xid/0n4i0am3wky-9kphq



https://wolfram.com/xid/0n4i0am3wky-ev6iib

Specify non-negative constraints using NonNegativeReals ():

https://wolfram.com/xid/0n4i0am3wky-bsy75

An equivalent form using vector inequality :

https://wolfram.com/xid/0n4i0am3wky-uobom

Integer Variables (4)
Specify integer domain constraints using Integers:

https://wolfram.com/xid/0n4i0am3wky-xi06kw

Specify integer domain constraints on vector variables using Vectors[n,Integers]:

https://wolfram.com/xid/0n4i0am3wky-df5n5z

Specify non-negative integer domain constraints using NonNegativeIntegers ():

https://wolfram.com/xid/0n4i0am3wky-2eforb

Specify non-positive integer domain constraints using NonPositiveIntegers ():

https://wolfram.com/xid/0n4i0am3wky-f0btvc

Complex Variables (5)
Specify complex variables using Complexes:

https://wolfram.com/xid/0n4i0am3wky-g1eqo6

Minimize a real objective with complex variables and complex constraints
:

https://wolfram.com/xid/0n4i0am3wky-bzlu37

Let . Expanding out the constraints into real components gives the following:

https://wolfram.com/xid/0n4i0am3wky-ccbk3g


https://wolfram.com/xid/0n4i0am3wky-fo49g6

https://wolfram.com/xid/0n4i0am3wky-q13dq

Solve the problem with real-valued objective and complex variables and constraints:

https://wolfram.com/xid/0n4i0am3wky-d86vc6

Solve the same problem with real variables and constraints:

https://wolfram.com/xid/0n4i0am3wky-kyxjrh

Use a quadratic constraint with a Hermitian matrix
and real-valued variables:

https://wolfram.com/xid/0n4i0am3wky-iopcnw

Use a Hermitian matrix in a constraint
with complex variables:

https://wolfram.com/xid/0n4i0am3wky-ctjwv2


https://wolfram.com/xid/0n4i0am3wky-b753at

Use a linear matrix inequality constraint with Hermitian or real symmetric matrices:

https://wolfram.com/xid/0n4i0am3wky-1gsvl
The variables in linear matrix inequalities need to be real for the sum to remain Hermitian:

https://wolfram.com/xid/0n4i0am3wky-c15nwi

Primal Model Properties (4)
Minimize over the intersection of a triangle
and a disk
:

https://wolfram.com/xid/0n4i0am3wky-k0n6zq

https://wolfram.com/xid/0n4i0am3wky-cgj2sa

Get the primal minimizer as a vector:

https://wolfram.com/xid/0n4i0am3wky-bo4eb7


https://wolfram.com/xid/0n4i0am3wky-ltg9mo


https://wolfram.com/xid/0n4i0am3wky-cs0dy5


https://wolfram.com/xid/0n4i0am3wky-f6912r

https://wolfram.com/xid/0n4i0am3wky-ht2cq3

Extract the conic constraints:

https://wolfram.com/xid/0n4i0am3wky-ba9yyg

Extract the cone specification in the conic constraints:

https://wolfram.com/xid/0n4i0am3wky-ob29k

Extract the cone dimensions in the conic constraints:

https://wolfram.com/xid/0n4i0am3wky-b2b4x4

Extract the affine lists in the conic constraints:

https://wolfram.com/xid/0n4i0am3wky-drlh75

The slack for an inequality at the minimizer
is given by
:

https://wolfram.com/xid/0n4i0am3wky-d0c50e

https://wolfram.com/xid/0n4i0am3wky-neiop

Extract the minimizer and conic constraint affine lists:

https://wolfram.com/xid/0n4i0am3wky-ef05e0

Verify that the slack satisfies s={s0,…,sk} with aj.x*+bj-sj=0.

https://wolfram.com/xid/0n4i0am3wky-dgvo2

https://wolfram.com/xid/0n4i0am3wky-j9bnt

A conic optimization problem in standard form is defined by some authors as minimizing subject to
and
. To convert to standard form, for each conic constraint
, add a variable
and corresponding linear equality constraint
:

https://wolfram.com/xid/0n4i0am3wky-so9agm
Extract the objective vector, conic constraint affine lists and the conic specifications:

https://wolfram.com/xid/0n4i0am3wky-pxcwsc
The slack constraints are the same as
:

https://wolfram.com/xid/0n4i0am3wky-c251iy

Form the linear equality constraint :

https://wolfram.com/xid/0n4i0am3wky-75znpr
Solve the transformed standard form conic problem:

https://wolfram.com/xid/0n4i0am3wky-5ae8p8

The "Slack" property allows you to get the values of without doing the actual transformation:

https://wolfram.com/xid/0n4i0am3wky-fjbj23

Dual Model Properties (3)

https://wolfram.com/xid/0n4i0am3wky-gek79l

https://wolfram.com/xid/0n4i0am3wky-yqer6

The dual problem is to maximize subject to
:

https://wolfram.com/xid/0n4i0am3wky-fobwz9

The primal minimum value and the dual maximum value coincide because of strong duality:

https://wolfram.com/xid/0n4i0am3wky-f5hvud

That is the same as having a duality gap of zero. In general, at optimal points:

https://wolfram.com/xid/0n4i0am3wky-w7chou

Construct the dual problem using coefficients extracted from the primal problem:

https://wolfram.com/xid/0n4i0am3wky-ens6du

https://wolfram.com/xid/0n4i0am3wky-dit46x

Extract the objective vector and constraint affine lists:

https://wolfram.com/xid/0n4i0am3wky-n10sgn

https://wolfram.com/xid/0n4i0am3wky-dbs9rm
The dual problem is to maximize subject to
:

https://wolfram.com/xid/0n4i0am3wky-h97ptf

Get the dual maximum value and dual maximizer directly using solution properties:

https://wolfram.com/xid/0n4i0am3wky-bfgnnt

The "DualMaximizer" can be obtained with:

https://wolfram.com/xid/0n4i0am3wky-bp0963

The dual maximizer vector partitions match the number and dimensions of the dual cones:

https://wolfram.com/xid/0n4i0am3wky-bthcm2

Sensitivity Properties (3)
Find the change in optimal value due to constraint perturbations:

https://wolfram.com/xid/0n4i0am3wky-s825c

https://wolfram.com/xid/0n4i0am3wky-i41yqa

Compute the "ConstraintSensitivity":

https://wolfram.com/xid/0n4i0am3wky-mqmqjb

Consider new constraint where
is the perturbation:

https://wolfram.com/xid/0n4i0am3wky-ievzbf
The new optimal value can be estimated to be:

https://wolfram.com/xid/0n4i0am3wky-707kkc

Compare to directly solving the perturbed problem:

https://wolfram.com/xid/0n4i0am3wky-kfil4e

The optimal value changes according to the signs of the sensitivity elements:

https://wolfram.com/xid/0n4i0am3wky-cqzu8v

https://wolfram.com/xid/0n4i0am3wky-c3trny

At negative sensitivity element position, a positive perturbation will decrease the optimal value:

https://wolfram.com/xid/0n4i0am3wky-ta2re8

At positive sensitivity element position, a positive perturbation will increase the optimal value:

https://wolfram.com/xid/0n4i0am3wky-n3pm1x

The constraint sensitivity can also be obtained as the negative of the dual maximizer:

https://wolfram.com/xid/0n4i0am3wky-1l0hu


https://wolfram.com/xid/0n4i0am3wky-exgmqg

Supported Convex Cones (5)
"NonNegativeCone" (1)
Minimize over a regular nonagon:

https://wolfram.com/xid/0n4i0am3wky-b5310v

Show the minimizer on a plot of the objective function:

https://wolfram.com/xid/0n4i0am3wky-kqr09i

Show the cones used in the conic constraints:

https://wolfram.com/xid/0n4i0am3wky-hklbtr

"NormCone" (1)
"SemidefiniteCone" (1)
Minimize such that
is positive semidefinite:

https://wolfram.com/xid/0n4i0am3wky-dysqdc

Show the minimizer on a plot of the objective function:

https://wolfram.com/xid/0n4i0am3wky-d03jbw

Show the cones used in the conic constraints:

https://wolfram.com/xid/0n4i0am3wky-geg5cr

"ExponentialCone" (1)
Minimize subject to the constraints
:

https://wolfram.com/xid/0n4i0am3wky-c47gkb

Show the minimizer on a plot of the objective function:

https://wolfram.com/xid/0n4i0am3wky-ymp44

Show the cones used in the conic constraints:

https://wolfram.com/xid/0n4i0am3wky-ipma9

"PowerCone" (1)
Minimize over the 4-norm unit disk:

https://wolfram.com/xid/0n4i0am3wky-b10ae6

Show the minimizer on a plot of the objective function:

https://wolfram.com/xid/0n4i0am3wky-twp13

Show the cones used in the conic constraints:

https://wolfram.com/xid/0n4i0am3wky-62a4a

Options (11)Common values & functionality for each option
Method (8)
"SCS" uses a splitting conic solver method:

https://wolfram.com/xid/0n4i0am3wky-zah0y3

"CSDP" is an interior point method for semidefinite problems:

https://wolfram.com/xid/0n4i0am3wky-d6m06w

"DSDP" is an alternative interior point method for semidefinite problems:

https://wolfram.com/xid/0n4i0am3wky-f2x17u

"IPOPT" is an interior point method for nonlinear problems:

https://wolfram.com/xid/0n4i0am3wky-f5btsf

Different methods have different default tolerances, which affects the accuracy and precision:

https://wolfram.com/xid/0n4i0am3wky-73rp7
Compute exact and approximate solutions:

https://wolfram.com/xid/0n4i0am3wky-ck8mlf

https://wolfram.com/xid/0n4i0am3wky-fltgk5

https://wolfram.com/xid/0n4i0am3wky-drob0i

https://wolfram.com/xid/0n4i0am3wky-bmlerf

https://wolfram.com/xid/0n4i0am3wky-e25su7
"SCS" has a default tolerance of :

https://wolfram.com/xid/0n4i0am3wky-70r9f

"CSDP", "DSDP" and "IPOPT" have default tolerances of :

https://wolfram.com/xid/0n4i0am3wky-bejajo


https://wolfram.com/xid/0n4i0am3wky-ugib


https://wolfram.com/xid/0n4i0am3wky-bitksp

When method "SCS" is specified, it is called with the SCS library default tolerance of 10-3:

https://wolfram.com/xid/0n4i0am3wky-hekt3l

With default options, this problem is solved by method "SCS" with tolerance 10-6:

https://wolfram.com/xid/0n4i0am3wky-ei1f1


https://wolfram.com/xid/0n4i0am3wky-h5vmmf

Use methods "CSDP" or "DSDP" for up to semidefinite constraints:

https://wolfram.com/xid/0n4i0am3wky-v4mgs

https://wolfram.com/xid/0n4i0am3wky-c32gq5

https://wolfram.com/xid/0n4i0am3wky-kdi4ev
Solve the problem using method "CSDP":

https://wolfram.com/xid/0n4i0am3wky-2s4oil

Solve the problem using method "DSDP":

https://wolfram.com/xid/0n4i0am3wky-be9hsi

Use method "IPOPT" to obtain accurate solutions when "CSDP" and "DSDP" are not applicable:

https://wolfram.com/xid/0n4i0am3wky-es1m2h

https://wolfram.com/xid/0n4i0am3wky-fbxo8
"IPOPT" produces more accurate results than "SCS" but is typically slower:

https://wolfram.com/xid/0n4i0am3wky-jvpj3v

Compare timing with method "SCS":

https://wolfram.com/xid/0n4i0am3wky-34lvbn

PerformanceGoal (1)
The default value of the option PerformanceGoal is $PerformanceGoal:

https://wolfram.com/xid/0n4i0am3wky-ehn5oy

Use PerformanceGoal"Quality" to get a more accurate result:

https://wolfram.com/xid/0n4i0am3wky-dgovrf


https://wolfram.com/xid/0n4i0am3wky-hqvof9

Use PerformanceGoal"Speed" to get a result faster, but at the cost of quality:

https://wolfram.com/xid/0n4i0am3wky-bxnhor

https://wolfram.com/xid/0n4i0am3wky-gibk5q


https://wolfram.com/xid/0n4i0am3wky-i5or46

The "Speed" goal gives a less accurate result:

https://wolfram.com/xid/0n4i0am3wky-ev4vd2

Tolerance (2)
A smaller Tolerance setting gives a more precise result:

https://wolfram.com/xid/0n4i0am3wky-ed5tm
Compute the exact minimum value with Minimize:

https://wolfram.com/xid/0n4i0am3wky-fg7x7y

Compute the error in the minimum value with different Tolerance settings:

https://wolfram.com/xid/0n4i0am3wky-nrbx9s

Visualize the change in minimum value error with respect to tolerance:

https://wolfram.com/xid/0n4i0am3wky-lrb7st

A smaller Tolerance setting gives a more precise answer, but may take longer to compute:

https://wolfram.com/xid/0n4i0am3wky-ce2zt8
A smaller tolerance takes longer:

https://wolfram.com/xid/0n4i0am3wky-bs1gyt


https://wolfram.com/xid/0n4i0am3wky-lzaad9

The tighter tolerance gives a more precise answer:

https://wolfram.com/xid/0n4i0am3wky-4ge5q0

Applications (29)Sample problems that can be solved with this function
Basic Modeling Transformations (13)
Maximize subject to
. Solve a maximization problem by negating the objective function:

https://wolfram.com/xid/0n4i0am3wky-7aogom

Negate the primal minimum value to get the corresponding maximal value:

https://wolfram.com/xid/0n4i0am3wky-9hulab

Minimize over a disk centered at
with radius
. Convert the objective
into a linear function
with the additional constraint
, which is equivalent to
:

https://wolfram.com/xid/0n4i0am3wky-gq211e

The disk constraint can also be represented using Norm:

https://wolfram.com/xid/0n4i0am3wky-7ooqgs

Minimize over a regular pentagon. Convert the objective into a linear function using
and the additional constraints
:

https://wolfram.com/xid/0n4i0am3wky-ddg3l8

Minimize . Using auxiliary variable
, the objective is transformed to minimize
subject to the constraint
:

https://wolfram.com/xid/0n4i0am3wky-tl1r0t

https://wolfram.com/xid/0n4i0am3wky-8bn7f1

Minimize subject to
. Using two auxiliary variables
, transform the problem to minimize
subject to
:

https://wolfram.com/xid/0n4i0am3wky-epm9dz

Minimize . Using auxiliary variable
, convert the problem to minimize
subject to the constraints
:

https://wolfram.com/xid/0n4i0am3wky-dk3i33

https://wolfram.com/xid/0n4i0am3wky-l7qq1n

Minimize subject to
, where
is a nondecreasing function, by instead minimizing
. The primal minimizer
will remain the same for both problems. Consider minimizing
subject to
:

https://wolfram.com/xid/0n4i0am3wky-l7wv9y

https://wolfram.com/xid/0n4i0am3wky-llr50x

The true minimum value can be obtained by applying to the minimum value of
:

https://wolfram.com/xid/0n4i0am3wky-fztpat

Minimize over a disk centered at
with radius
Using the auxiliary variable
, the objective is transformed to minimizing
with the additional constraint
:

https://wolfram.com/xid/0n4i0am3wky-iig1sf

The constraint is equivalent to the exponential cone constraint
iff
:

https://wolfram.com/xid/0n4i0am3wky-gykj1j

Minimize over a disk centered at
with radius
. Using auxiliary variable
, convert the problem to minimize
subject to the constraint
:

https://wolfram.com/xid/0n4i0am3wky-ced5ad

The constraint is equivalent to
. This can be represented using "PowerCone" by
:

https://wolfram.com/xid/0n4i0am3wky-bcf2qy


https://wolfram.com/xid/0n4i0am3wky-eh6hiq
Using auxiliary variable , convert the problem to minimize
subject to the constraint
:

https://wolfram.com/xid/0n4i0am3wky-fkf7og

This can be represented using "PowerCone" constraints. Since iff
, bounding
with
where
gives
:

https://wolfram.com/xid/0n4i0am3wky-ccqwit

Find that minimizes the largest eigenvalue of a symmetric matrix that depends linearly on the decision variables
,
. The problem can be formulated as linear matrix inequality since
is equivalent to
, where
is the
eigenvalue of
. Define the linear matrix function
:

https://wolfram.com/xid/0n4i0am3wky-gijetd

https://wolfram.com/xid/0n4i0am3wky-cfsdrn

A real symmetric matrix can be diagonalized with an orthogonal matrix
so
. Hence
iff
. Since any
, taking
,
, hence
iff
. Numerically simulate to show that these formulations are equivalent:

https://wolfram.com/xid/0n4i0am3wky-bxagk3


https://wolfram.com/xid/0n4i0am3wky-l9zvaw

https://wolfram.com/xid/0n4i0am3wky-bai8wg


https://wolfram.com/xid/0n4i0am3wky-4xe7n

Run a Monte Carlo simulation to check the plausibility of the result:

https://wolfram.com/xid/0n4i0am3wky-c3z8kg

Minimize subject to
, assuming
when
. Using the auxiliary variable
, the objective is to minimize
such that
:

https://wolfram.com/xid/0n4i0am3wky-f9iak7

https://wolfram.com/xid/0n4i0am3wky-pxo8p

A Schur complement condition says that if , a block matrix
iff
. Therefore
iff
. Use Inactive Plus for constructing the constraints to avoid threading:

https://wolfram.com/xid/0n4i0am3wky-ctx6t

For quadratic sets , which include ellipsoids, quadratic cones and paraboloids, determine whether
, where
are symmetric matrices,
are vectors and
scalars:

https://wolfram.com/xid/0n4i0am3wky-lahmkn

https://wolfram.com/xid/0n4i0am3wky-cyznvq

Assuming that the sets i are full dimensional, the S-procedure says that iff there exists some non-negative number
such that
Visually see that there exists a non-negative
:

https://wolfram.com/xid/0n4i0am3wky-tvxzei


https://wolfram.com/xid/0n4i0am3wky-b7jg0b

Data-Fitting Problems (5)
Minimize subject to the constraints
:

https://wolfram.com/xid/0n4i0am3wky-sqawoj
Using auxiliary variable , the transformed objective is to minimize
subject to
:

https://wolfram.com/xid/0n4i0am3wky-yitrad

Fit a cubic curve to discrete data such that the first and last points of the data lie on the curve:

https://wolfram.com/xid/0n4i0am3wky-znbwtk
Construct the matrix using DesignMatrix:

https://wolfram.com/xid/0n4i0am3wky-7u326f
Define the constraint so that the first and last points must lie on the curve:

https://wolfram.com/xid/0n4i0am3wky-6h1xyq
Find the coefficients by minimizing
. Using auxiliary variable
, the transformed objective is to minimize
subject to
:

https://wolfram.com/xid/0n4i0am3wky-4jv0wc


https://wolfram.com/xid/0n4i0am3wky-elazro

Find a robust fit to nonlinear discrete data by minimizing :

https://wolfram.com/xid/0n4i0am3wky-5edia8
Fit the data using the bases . The interpolating function will be
:

https://wolfram.com/xid/0n4i0am3wky-0el18p
Since , using auxiliary variables
. The problem is transformed to minimize
subject to the constraints
:

https://wolfram.com/xid/0n4i0am3wky-x5ovt2

https://wolfram.com/xid/0n4i0am3wky-smzt60

Compare interpolating function with reference function:

https://wolfram.com/xid/0n4i0am3wky-c1na99

Represent a given polynomial in terms of sum-of-squares polynomial
:

https://wolfram.com/xid/0n4i0am3wky-38ildp
The objective is to find such that
, where
is a vector of monomials:

https://wolfram.com/xid/0n4i0am3wky-sdlyvv
Construct the symmetric matrix :

https://wolfram.com/xid/0n4i0am3wky-g4rofr
Find the polynomial coefficients of and
and make sure they are equal:

https://wolfram.com/xid/0n4i0am3wky-5u259f


https://wolfram.com/xid/0n4i0am3wky-n40txk

The quadratic term , where
is a lower-triangular matrix obtained from the Cholesky decomposition of
:

https://wolfram.com/xid/0n4i0am3wky-82j1q

Compare the sum-of-squares polynomial to the given polynomial:

https://wolfram.com/xid/0n4i0am3wky-1s4mjs

Find an regularized fit to complex data by minimizing
for a complex
:

https://wolfram.com/xid/0n4i0am3wky-cyinhk
Construct the matrix using DesignMatrix, for the basis
:

https://wolfram.com/xid/0n4i0am3wky-kn9a90

https://wolfram.com/xid/0n4i0am3wky-equr80

Let be the fit defined as a function of the real and imaginary components of
:

https://wolfram.com/xid/0n4i0am3wky-od26r
Visualize the result for the real component of :

https://wolfram.com/xid/0n4i0am3wky-i8tg0b

Visualize the results for the imaginary component of :

https://wolfram.com/xid/0n4i0am3wky-f8d31g

Geometry Problems (5)
Find the minimum distance between two disks of radius 1 centered at and
. Let
be a point on disk 1. Let
be a point on disk 2. The objective is to minimize
. Using auxiliary variable
, the transformed objective is to minimize
subject to
:

https://wolfram.com/xid/0n4i0am3wky-x0rc5a

Visualize the position of the two points:

https://wolfram.com/xid/0n4i0am3wky-u44093

The auxiliary variable gives the distance between the points:

https://wolfram.com/xid/0n4i0am3wky-p9wkco

Find the radius and center
of a minimal enclosing ball that encompasses a given region:

https://wolfram.com/xid/0n4i0am3wky-1xi3kb
Minimize the radius subject to the constraints
:

https://wolfram.com/xid/0n4i0am3wky-fmr9yi

https://wolfram.com/xid/0n4i0am3wky-van10s


https://wolfram.com/xid/0n4i0am3wky-uhd7v9

The minimal enclosing ball can be found efficiently using BoundingRegion:

https://wolfram.com/xid/0n4i0am3wky-1dvvd5

Find the plane that separates two non-intersecting convex polygons:

https://wolfram.com/xid/0n4i0am3wky-7ctwad
Let be a point on
. Let
be a point on
. The objective is to minimize
. Using auxiliary variable
, the transformed objective is to minimize
subject to
:

https://wolfram.com/xid/0n4i0am3wky-4weo41

According to the separating hyperplane theorem, the dual associated with the constraint will give the normal of the hyperplane:

https://wolfram.com/xid/0n4i0am3wky-vfw3g3
The dual associated with the "NormCone" is:

https://wolfram.com/xid/0n4i0am3wky-bkxqb6

The hyperplane is constructed as:

https://wolfram.com/xid/0n4i0am3wky-du7d7

Visualize the plane separating the two polygons:

https://wolfram.com/xid/0n4i0am3wky-i1pki2

Find the maximum area ellipse parametrized as that can be fitted into a convex polygon:

https://wolfram.com/xid/0n4i0am3wky-3tg2i1
Each segment of the convex polygon can be represented as intersections of half-planes . Extract the linear inequalities:

https://wolfram.com/xid/0n4i0am3wky-vq06yg
Applying the parametrization to the half-planes gives . The term
. Thus, the constraints are
:

https://wolfram.com/xid/0n4i0am3wky-8qvwem
Minimizing the area is equivalent to minimizing , which is equivalent to minimizing
:

https://wolfram.com/xid/0n4i0am3wky-ixiqu4

Convert the parameterized ellipse into the explicit form as :

https://wolfram.com/xid/0n4i0am3wky-ndd737


https://wolfram.com/xid/0n4i0am3wky-uhg6ug

Find the analytic center of a convex polygon. The analytic center is a point that maximizes the product of distances to the constraints:

https://wolfram.com/xid/0n4i0am3wky-b4h1vk
Each segment of the convex polygon can be represented as intersections of half-planes . Extract the linear inequalities:

https://wolfram.com/xid/0n4i0am3wky-pfce4d
The objective is to maximize . Taking
and negating the objective, the transformed objective is
:

https://wolfram.com/xid/0n4i0am3wky-8uh8pi
Using auxiliary variable , the transformed objective is
subject to the constraint
:

https://wolfram.com/xid/0n4i0am3wky-i6xstb

Visualize the location of the center:

https://wolfram.com/xid/0n4i0am3wky-o16bx1

Classification Problems (3)
Find a line that separates two groups of points
and
:

https://wolfram.com/xid/0n4i0am3wky-mq8mpw
For separation, set 1 must satisfy and set 2 must satisfy
:

https://wolfram.com/xid/0n4i0am3wky-wz5f21
The objective is to minimize , which gives twice the thickness between
and
. Using the auxiliary variable
, the objective function is transformed to the constraint
:

https://wolfram.com/xid/0n4i0am3wky-upuqr3


https://wolfram.com/xid/0n4i0am3wky-mm9axc


https://wolfram.com/xid/0n4i0am3wky-qddxuk

Find a quadratic polynomial that separates two groups of 3D points and
:

https://wolfram.com/xid/0n4i0am3wky-0kz712

Construct the quadratic polynomial data matrices for the two sets using DesignMatrix:

https://wolfram.com/xid/0n4i0am3wky-r437k9
For separation, set 1 must satisfy and set 2 must satisfy
:

https://wolfram.com/xid/0n4i0am3wky-602x47
Find the separating polynomial by minimizing . Using auxiliary variable
, the transformed objective is to minimize
with the additional constraint
:

https://wolfram.com/xid/0n4i0am3wky-6b5j15

The polynomial separating the two groups of points is:

https://wolfram.com/xid/0n4i0am3wky-1vrepp

Plot the polynomial separating the two datasets:

https://wolfram.com/xid/0n4i0am3wky-v2nioo

Separate a given set of points into different groups. This is done by finding the centers
for each group by minimizing
, where
is a given local kernel and
is a given penalty parameter:

https://wolfram.com/xid/0n4i0am3wky-60v0lc
The kernel is a
-nearest neighbor (
) function such that
, else
. For this problem,
nearest neighbors are selected:

https://wolfram.com/xid/0n4i0am3wky-g6kx82
Using the auxiliary variable , the objective is transformed to minimize
subject to the constraint
:

https://wolfram.com/xid/0n4i0am3wky-laqneu

https://wolfram.com/xid/0n4i0am3wky-w4r7vu
For each data point there exists a corresponding center. Data belonging to the same group will have the same center value:

https://wolfram.com/xid/0n4i0am3wky-vr6xsn

Extract and plot the grouped points:

https://wolfram.com/xid/0n4i0am3wky-lhj5hi

Optimal Control Problems (1)

https://wolfram.com/xid/0n4i0am3wky-cht3cu
The minimizing function integral can be approximated using the trapezoidal rule. The discretized objective function will be subject to additional constraints
:

https://wolfram.com/xid/0n4i0am3wky-7tms3f
The time derivative in is discretized using finite differences:

https://wolfram.com/xid/0n4i0am3wky-no40t5
The initial condition constraints can be specified using Indexed:

https://wolfram.com/xid/0n4i0am3wky-6j23oq
Using auxiliary variable , the objective is transformed to minimize
subject to
:

https://wolfram.com/xid/0n4i0am3wky-mq52up
Convert the discretized result into InterpolatingFunction:

https://wolfram.com/xid/0n4i0am3wky-b8y59x

https://wolfram.com/xid/0n4i0am3wky-rvuj4l

Plot the state variables. The state variables try and track the function :

https://wolfram.com/xid/0n4i0am3wky-c4p6y2

Facility Location Problems (1)
Find the positions of various cell towers and the range
needed to serve clients located at
:

https://wolfram.com/xid/0n4i0am3wky-432sb2
Each cell tower consumes power proportional to its range, which is given by . The objective is to minimize the power consumption:

https://wolfram.com/xid/0n4i0am3wky-qnmsp6
Let be a decision variable indicating that
if client
is covered by cell tower
:

https://wolfram.com/xid/0n4i0am3wky-yup7tp
Each cell tower must be located such that its range covers some of the clients:

https://wolfram.com/xid/0n4i0am3wky-nw7y9g
Each cell tower can cover multiple clients:

https://wolfram.com/xid/0n4i0am3wky-nb1u4e
Each cell tower has a minimum and maximum coverage:

https://wolfram.com/xid/0n4i0am3wky-lbqs1t

https://wolfram.com/xid/0n4i0am3wky-kz0tgg
Find the cell tower positions and their ranges:

https://wolfram.com/xid/0n4i0am3wky-yw4vx6

Extract cell tower position and range:

https://wolfram.com/xid/0n4i0am3wky-yangc4
Visualize the position and range of the towers with respect to client locations:

https://wolfram.com/xid/0n4i0am3wky-7bdoho

Portfolio Optimization (1)
Find the distribution of capital to invest in six stocks to maximize return while minimizing risk:

https://wolfram.com/xid/0n4i0am3wky-kut0cq
The return is given by , where
is a vector of expected return value of each individual stock:

https://wolfram.com/xid/0n4i0am3wky-2z1lpt
The risk is given by ;
is a risk-aversion parameter and
:

https://wolfram.com/xid/0n4i0am3wky-get9k6
The objective is to maximize return while minimizing risk for a specified risk-aversion parameter:

https://wolfram.com/xid/0n4i0am3wky-61n2dz
The effect on market prices of stocks due to the buying and selling of stocks is modeled by , which is modeled by a power cone using the epigraph transformation:

https://wolfram.com/xid/0n4i0am3wky-1k0oif
The weights must all be greater than 0 and the weights plus market impact costs must add to 1:

https://wolfram.com/xid/0n4i0am3wky-vgdxhc
Compute the returns and corresponding risk for a range of risk-aversion parameters:

https://wolfram.com/xid/0n4i0am3wky-4zi5kn
The optimal over a range of
gives an upper-bound envelope on the tradeoff between return and risk:

https://wolfram.com/xid/0n4i0am3wky-3deaei

Compute the weights for a specified number of risk-aversion parameters:

https://wolfram.com/xid/0n4i0am3wky-scqccb
By accounting for the market costs, a diversified portfolio can be obtained for low risk aversion, but when the risk aversion is high, the market impact cost dominates, due to purchasing a less diversified stock:

https://wolfram.com/xid/0n4i0am3wky-18xvc1

Properties & Relations (8)Properties of the function, and connections to other functions
ConicOptimization gives the global minimum of the objective function:

https://wolfram.com/xid/0n4i0am3wky-0ub28

Plot the objective function with the minimum value over the feasible region:

https://wolfram.com/xid/0n4i0am3wky-bse6f8

Minimize gives global exact results for conic problems:

https://wolfram.com/xid/0n4i0am3wky-cnyenu


https://wolfram.com/xid/0n4i0am3wky-b0ncag

NMinimize can be used to obtain approximate results using global methods:

https://wolfram.com/xid/0n4i0am3wky-wz6g7

FindMinimum can be used to obtain approximate results using local methods:

https://wolfram.com/xid/0n4i0am3wky-gp4lfs

SemidefiniteOptimization is a special case of ConicOptimization:

https://wolfram.com/xid/0n4i0am3wky-nekvhj


https://wolfram.com/xid/0n4i0am3wky-fpdc8i

SecondOrderConeOptimization is a special case of ConicOptimization:

https://wolfram.com/xid/0n4i0am3wky-3lfku


https://wolfram.com/xid/0n4i0am3wky-h7ek9w

QuadraticOptimization is a special case of ConicOptimization:

https://wolfram.com/xid/0n4i0am3wky-jjgpir

https://wolfram.com/xid/0n4i0am3wky-z5w02s

Use auxiliary variable and minimize
with additional constraint
:

https://wolfram.com/xid/0n4i0am3wky-4odka

LinearOptimization is a special case of ConicOptimization:

https://wolfram.com/xid/0n4i0am3wky-bxnkc


https://wolfram.com/xid/0n4i0am3wky-b002ld

Possible Issues (6)Common pitfalls and unexpected behavior
The constraints at the optimal point are expected to be satisfied up to some tolerance:

https://wolfram.com/xid/0n4i0am3wky-fi6klz


https://wolfram.com/xid/0n4i0am3wky-e6hesg


https://wolfram.com/xid/0n4i0am3wky-4tew5

The constraint violation can often be controlled with the Tolerance option:

https://wolfram.com/xid/0n4i0am3wky-cp80hs


https://wolfram.com/xid/0n4i0am3wky-kusvei

The minimum value of an empty set or infeasible problem is defined to be :

https://wolfram.com/xid/0n4i0am3wky-breti6


The minimizer is Indeterminate:

https://wolfram.com/xid/0n4i0am3wky-uacgr


The minimum value for an unbounded set or unbounded problem is :

https://wolfram.com/xid/0n4i0am3wky-iqfpj3


The minimizer is Indeterminate:

https://wolfram.com/xid/0n4i0am3wky-bc0yq0


Badly scaled problems can produce results with large error:

https://wolfram.com/xid/0n4i0am3wky-bllvu7


https://wolfram.com/xid/0n4i0am3wky-b5r4r1

After scaling by 10-10, this is mathematically equivalent to the following problem:

https://wolfram.com/xid/0n4i0am3wky-fgo7qy

Any result for ,
within ±10-6 of 5*10-10 will fall within the tolerance of 10-6 and when scaled back can produce an error of up to:

https://wolfram.com/xid/0n4i0am3wky-bti399

You could solve the preceding scaled problem or try to tighten the default tolerance:

https://wolfram.com/xid/0n4i0am3wky-fxm84v

Dual related solution properties for mixed-integer problems may not be available:

https://wolfram.com/xid/0n4i0am3wky-4qteew

Constraints with complex values need to be specified using vector inequalities:

https://wolfram.com/xid/0n4i0am3wky-gw60b6

Just using Less will not work even when both sides are real in theory:

https://wolfram.com/xid/0n4i0am3wky-btpkne


Wolfram Research (2019), ConicOptimization, Wolfram Language function, https://reference.wolfram.com/language/ref/ConicOptimization.html (updated 2020).
Text
Wolfram Research (2019), ConicOptimization, Wolfram Language function, https://reference.wolfram.com/language/ref/ConicOptimization.html (updated 2020).
Wolfram Research (2019), ConicOptimization, Wolfram Language function, https://reference.wolfram.com/language/ref/ConicOptimization.html (updated 2020).
CMS
Wolfram Language. 2019. "ConicOptimization." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2020. https://reference.wolfram.com/language/ref/ConicOptimization.html.
Wolfram Language. 2019. "ConicOptimization." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2020. https://reference.wolfram.com/language/ref/ConicOptimization.html.
APA
Wolfram Language. (2019). ConicOptimization. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ConicOptimization.html
Wolfram Language. (2019). ConicOptimization. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ConicOptimization.html
BibTeX
@misc{reference.wolfram_2025_conicoptimization, author="Wolfram Research", title="{ConicOptimization}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/ConicOptimization.html}", note=[Accessed: 29-March-2025
]}
BibLaTeX
@online{reference.wolfram_2025_conicoptimization, organization={Wolfram Research}, title={ConicOptimization}, year={2020}, url={https://reference.wolfram.com/language/ref/ConicOptimization.html}, note=[Accessed: 29-March-2025
]}