RobustConvexOptimization
✖
RobustConvexOptimization
finds values of vars that give the minimum value of f for vars that satisfy the constraints vcons for all possible values of the parameters pars that satisfy the parametric constraints pcons.
Details and Options




- Robust optimization is also known as worst-case optimization.
- Robust optimization is typically used when solving an optimization problem under uncertainty represented by parameters with parameter constraints.
- Robust optimization gives the most conservative solution in the sense that the optimum given can be achieved for all possible parameter values.
- Robust optimization finds a robust minimizer
that solves the following problem:
-
minimize where - The robust minimizer
satisfies
for all
in the parameter set.
- The robust minimum value
satisfies
for all
in the parameter set.
- Linear equality constraints
or
may be included in pcons or vcons.
- RobustConvexOptimization[f,cons,vars,pars] can also be used. The constraints cons are automatically separated into purely parameter constraints
and variable constraints that may depend on parameters
. This form is compatible with ParametricConvexOptimization.
- A robust optimization problem is considered tractable if it can be cast into a form where it can be solved or approximated by convex optimization. Tractability depends on a combination of the type of variable constraints
and the type of parameter constraints
.
- The following combination of variable constraints and parameter constraints are considered tractable:
-
variable constraints parameter constraints - In general, the variable constraints
are transformed into conic constraints of the form
, where
is one of "NonNegativeCone" , "NormCone" or "SemidefiniteCone", and the dependence of
and
on the parameters should be affine.
- When the objective function
depends on parameters or is nonlinear, an additional variable
is introduced and the problem is transformed with the epigraph transformation to have objective
with an additional constraint
.
- The variable and parameters specifications vars and pars should each be a list with elements giving variables or parameters in one of the following forms:
-
v variable with inferred dimensions or scalar parameter with name 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 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 {"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 Methodmethod may be used to specify the method to use. Available methods include:
-
Automatic choose the method automatically "CuttingSet" use a cutting set method "PolyhedralApproximation" approximate "NormCone" constraints with a set of linear constraints "SCS" SCS (splitting conic solver) library "CSDP" CSDP (COIN semidefinite programming) library "DSDP" DSDP (semidefinite programming) library - Some robust optimization problems that are not tractable can be approximately be solved using cutting set methods.
Examples
open allclose allBasic Examples (2)Summary of the most common use cases
Find a robust minimizer for subject to constraints
:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-ipk9a9

The robust minimizer satisfies the constraints for all with
:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-dewemq

Find a robust minimizer for subject to the variable constraint
:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-1iapq

The robust minimizer is in the intersection (green) of the constraint sets for all α∈[-.5,.5]:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-fsoq98

Scope (29)Survey of the scope of standard use cases
Basic Uses (15)
Find a robust minimizer for subject to
for all
such that
:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-rsytsn

Find a robust minimizer for subject to
for all
in the interval
:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-ojllel

Find a robust minimizer for subject to
for all
such that
:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-rf6fpv

Find a robust minimizer for subject to
for all
such that
:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-bud2ta

Use alternate syntax without an explicit ForAll:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-1prc0

This syntax can be used directly in ParametricConvexOptimization to try particular values of :

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-ctwbkv


https://wolfram.com/xid/0mfesb0mgk61dk1g9u-dtmnqb

Use VectorLessEqual to express several LessEqual inequality constraints at once:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-l6v0jk

Use v<=
to enter the vector inequality in a compact form:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-3w7lfi

An equivalent form using scalar inequalities:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-dmhi1n

Use VectorGreaterEqual to express several GreaterEqual inequality constraints at once:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-smoqku

Use v>=
to enter the vector inequality in a compact form:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-k47ft7

Specify the constraints using a combination of scalar and vector inequalities:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-xkrkhz

An equivalent form using scalar inequalities:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-48dy03

Use vector variables and vector inequalities to specify the problem:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-gc98gk

Minimize the function subject to the constraint
for all
such that
:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-z62wt2
Use Indexed to access components of a vector variable, e.g. :

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-gudx1i

Use constant parameter equations to specify the coefficients of the objective and constraints:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-4qhte2

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-9kglun

Minimize the function subject to
for all
such that
:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-m9ud1a

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-g50i5k


Use Vectors[n,Reals] to specify the dimension of vector variables when needed:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-me75e5

Specify non-negative constraints using NonNegativeReals ():

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-merse2

An equivalent form using vector inequalities:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-s8fv6w

Specify non-positive constraints using NonPositiveReals ():

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-f7nj2x

Specify bounds using Interval:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-im5v8

Use Evaluate to ensure that the first argument in ForAll gets evaluated when parameters are grouped and assigned to a variable:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-ixmwx9

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-jyaxk6

Linear Variable Constraints (5)
Find a robust minimizer for subject to
for all
in the interval [0,2]:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-xv1u9n

Mathematically the constraint for all
in [0,2] implies that
. Thus the problem is equivalent to:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-9naham

Find a robust minimizer for subject to variable constraints
for all
such that they are constrained to intervals:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-xhi9r3

Visualize the minimizer and the variable constraint set for extreme values of . The set of
that is feasible for all possible values of the parameters
, shown in green, is the intersection of the parametric feasible regions:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-qmxz1e

Find a robust minimizer for subject to variable constraints
for all
such that they are constrained to intervals:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-xa3j5w

Visualize the minimizer, the variable constraint set for extreme values of the parameter and the feasible region (shown in green):

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-t252tu

Find a robust minimizer for subject to variable constraints
for all
such that
:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-1lpnq5

Visualize the minimizer, the variable constraint set for extreme values of the parameter and the feasible region (shown in green):

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-mttz2q

Find a robust minimizer for subject to variable constraints
for all
such that
:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-387s61

For extreme parameter values , find the range for
for which the matrix
is positive semidefinite:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-hy28vb

Visualize the minimizer and the feasible region (shown in green) formed by intersection of regions produced by varying :

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-ln7nbq

NormCone Variable Constraints (7)
Find a robust minimizer for over variable constraints
for all
such that
:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-ul9myi

Visualize the minimizer and the variable constraint set for extreme values of . The set of
that is feasible for all possible values of the parameters
is the intersection of all feasible regions (shown in green):

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-8u5uuf

Find a robust minimizer for over variable constraints
for all
such that
:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-k5i5wv

Visualize the minimizer, the variable constraint set for extreme values of the parameter and the feasible region (shown in green):

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-ejhp5p

Find a robust minimizer for over variable constraints
for all
such that
:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-xgxgc9

Visualize the minimizer, the variable constraint set for extreme values of and the feasible region (shown in green):

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-l8mbyu

Find a robust minimizer for over variable constraints
for all
such that
:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-hx0v42

Visualize the minimizer, the variable constraint set for extreme values of and the feasible region (shown in green):

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-jrldka

Find a robust minimizer for over variable constraints
for all
such that
:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-6mm3z

Find a robust minimizer for over variable constraints
for all
such that
:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-2b67bj

Visualize the minimizer, the variable constraint set for extreme values of and the feasible region (shown in green):

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-nl8dqv

Find a robust minimizer for over variable constraints
for all
such that
:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-q57w7z

Visualize the minimizer, the variable constraint set for extreme values of and the feasible region (shown in green):

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-o6qj9u

SemidefiniteCone Variable Constraints (2)
Find an approximate robust minimizer for subject to variable constraints
for all
such that
:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-ydq0c6


Visualize the minimizer, the variable constraint set for extreme values of the parameter and the feasible region (shown in green):

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-to6xqn

Find an approximate robust minimizer for subject to variable constraints
for all
such that
:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-mstd5s


Visualize the minimizer, the variable constraint set for extreme values of the parameter and the feasible region (shown in green):

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-f2hgar

Options (3)Common values & functionality for each option
Method (2)
Use Method"CuttingSet" to solve problems whose robust counterparts are not tractable:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-kltdbj


https://wolfram.com/xid/0mfesb0mgk61dk1g9u-bxkoz5

Visualize the minimizer and the variable constraint set for two extreme values of the parameter along with the feasible region (shown in green):

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-7eghht

Use Method"PolyhedralApproximation" to linearize "NormCone" constraints. This enables approximate solution problems with otherwise intractable robust counterparts:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-basd9x



https://wolfram.com/xid/0mfesb0mgk61dk1g9u-9zlmw

Visualize the minimizer and the variable constraint set for two extreme values of the parameter:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-v0anoq

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

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-0i2hy9
The exact value for this problem can be found by setting :

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-nfx3uw

Compute the error at different Tolerance settings:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-87p30g

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

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-e1i3sy

Applications (14)Sample problems that can be solved with this function
Geometry Problems (2)
Find the center and radius
of the smallest circle that encloses a set of subcircles:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-xq737g
The subcircles are represented by points that are the centers of uncertainty disks:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-mzo9nc
The objective is to minimize the radius subject to the constraints
:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-ybpeir
The center and radius of the disk are:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-zwdx8o


https://wolfram.com/xid/0mfesb0mgk61dk1g9u-wgukj5

Find the minimum distance between two disks of radius and centered at
and
such that the uncertainties are modeled as an ellipsoid
:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-lp93oa
Let and
be the points associated with disks 1 and 2. The objective is to minimize the
subject to
:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-lvrfub

The minimum distance between the two disks with center and radius uncertainties is:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-jgou7c

Visualize the positions of the two points, along with some extreme cases of the uncertainty disks:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-dbn71m

Data-Fitting Problems (3)
Find a robust linear fit to data with response subject to interval uncertainty:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-dzrsr3

The objective is to minimize the error between the input and output subject to the interval uncertainty :

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-ivli5y
Find slope m and intercept b for a robust fit y=m x+b:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-mgtr62

Compare with a simple least-squares fit of the data:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-izu1n1

Find fit models for 100 possible realizations of the uncertainty:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-68kr7
Show the envelope of the fit models with the robust fit (black), the simple fit (green) and the data:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-xcrdq

Fit a cubic curve to discrete data whose output contains interval uncertainty :

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-itnybw

Construct the input matrix using DesignMatrix:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-gg22cb
The objective is to minimize the error between the input and output subject to the interval uncertainty :

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-ie25c1
Find the coefficients associated with each of the bases:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-hqp3w0

Find fit models for 100 possible realizations of the uncertainty:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-es5be1
Show the envelope of the fit models with the robust fit (black) and the data:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-g1umys

Compare the robust fit (black) and the average model (red) to the exact solution without noise:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-z2rqy0

The robust fit will tend to have a higher error than the average model:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-y54un3

Fit a cubic curve to discrete data whose instance of measurement (input) is in the uncertain range :

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-cgltch
Find the coefficients subject to interval uncertainty on the input matrix:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-fkpxs

Show the robust fit with an envelope generated from random instances of the input noise:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-bmbdsv

Compare the robust fit (black) and the average model (red) to the exact solution without noise:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-55npdb

Manufacturing Problems (3)
Find the optimal mix of two drugs for a company to manufacture to maximize profit given uncertainty in extracting the active agents from two different raw materials
. The revenue per unit of drugs is:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-euvtk0
The company can only store 1000 kg of raw materials:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-9kg39m
It requires 90 to 100 hours of manpower to manufacture the two drugs. The company has only 2000 hours of manpower available:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-wllhoz
It requires 40 to 50 hours of equipment time to manufacture the two drugs. The company has only 800 hours of equipment time available:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-8ofe16
The operational costs for manufacturing the two drugs are 700 and 800, respectively. The raw material costs per kilogram are 100 and 199.9, respectively:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-nf13w2
The company has a total budget of $100,000:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-2wp8ud
The company must manufacture some units of drugs, and therefore must buy some raw materials:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-m9ndma
The amounts of active agent extracted from the two raw materials are g/kg and
g/kg of raw materials, respectively. The two drugs need 0.5 g/unit and 0.6 g/unit of active agent, respectively:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-i8eoiq
The objective is to maximize revenue while minimizing purchasing and operational costs:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-hmodhe

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-uvs16j

The profit, taking the uncertainties into account, is:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-fjsils

Construct a parametric function for the problem:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-pahjtl

Without the active agent fluctuations in the raw materials, the second raw material is preferred:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-fstue8

The profit without the uncertainties is:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-52rfhw

Taking uncertainties into account, there will be at most a 6% reduction in profit:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-x0rh9j

The robust solution corresponds to the worst-case scenario of the least amount of active agent being extracted from the raw materials:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-jijc7s

To see the advantage of using the robust solution, generate a parametric function with the raw materials and the active agent uncertainty as parameters:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-nu7vrx
If the raw materials are purchased using the nominal result, i.e. , then the profit may decrease by 21% depending on the amount of active agent that can be extracted from the raw material:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-qd2tap

If the raw materials are purchased using robust result, i.e. , then the profit may decrease by at most 6%:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-jc4uno

Plot the profit as a function of the active agent that can be extracted from the second raw material:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-zms74n

Find the mix of products to manufacture that maximizes the profits of a company where there is some uncertainty in the manufacturing inputs. The company makes three products. Under ideal conditions, the revenue per unit, cost per unit and maximum capacity are given by:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-gjon8
Each product is made using four machines. The time a machine spends on each product is:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-0idtbv

Due to market fluctuations, the revenue generated by each unit of product may decrease by $5:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-lzedzp
Accounting for machine downtime, the manufacturing capacity may decrease by 5 units per product:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-059ige
Each machine can run at most 2400 minutes per week. If a machine is not operational, then it takes at most 120 minutes to return it to working condition:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-d7tano
The cost for repairing any of the four machines increases the cost of each product by $5 per unit:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-gy5pjg
The profit equals revenue minus cost times the number of units for product
:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-9o83ol
Gather all the variable constraints:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-zcjto7
Gather all the parameter constraints:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-65fa4
Gather all the parameter specifications:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-k2fu9b
The objective is to maximize the profit. The optimal product mix is given by:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-5zegw5

Construct a parametric function for varying the various parameters:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-cmk5yz

The best-case scenario would involve no revenue decrease or machine downtime and is given by:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-o0b3vd

The worst-case scenario corresponds to the result obtained by RobustConvexOptimization:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-14q97k

Find the mix of products to manufacture that maximizes the profits of a company that sells three products subject to price and supply fluctuation:
The revenue per unit accounting for price fluctuation of per unit is:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-ghbka4
The factory is only open for 100 days. Ideally, it takes 2, 4 or 5 days to make each unit but, due to unexpected delays, the manufacturing time might increase by a day:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-20mm46
Each product contains gold and tin. The total gold and tin available are and
units, respectively:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-7p0fa0
The company incurs a setup cost for each product if that product is manufactured:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-yvqi09
Because of the relatively high setup costs, it may be desirable not to manufacture some of the products at all. Let be a decision variable such that
if product
is manufactured, and otherwise
. The limit
ensures that if
is 0, so is
, without limiting the size of
more than other constraints do:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-tr8b66
The objective is to maximize the profit:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-vsofqx
Collect all the variable constraints:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-c1mduc
Collect the parameter constraints:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-dqhmqz
Collect the parameter specifications:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-w2xv7z

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-ps33f8

Construct a parametric function for varying the various parameters:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-yf40ms

The result matches the worst-case scenario, which is given by:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-chnoam

Structural Optimization Problems (1)
Find the shape of a hanging chain formed by spring links under a vertical load at the end of each link where both the stiffness and equilibrium lengths of the springs are subject to manufacturing uncertainty. The objective is to find the link positions
:

The potential energy due to gravity is , where
is the vertical load at each end and
is gravity:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-8ligz6
The potential energy due to the tension in the spring link due to stretching is , where
is the stretch in spring link
,
is the uncertain stiffness of the spring and
is the ideal stiffness of the spring. Using
, the energy is transformed to
:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-h7n9i
An additional constraint must be added due to the transformation:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-w78a1d
The ends of the linked chain are clamped at positions (0,0) and (2,-1):

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-m7m43f
Each link has to satisfy the condition , where
is the resting length of each spring subject to uncertainty
:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-hmrhn4
The design constant parameters are:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-kwcdyh
The final objective function is the sum of gravity and spring potential energy that must be minimized:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-7vxyp0
Find the end points of each of the spring links:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-5er6z4

Visualize the shape of the resulting spring chain:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-0cc5ab

The stretch is greatest for the links near the ends of the link chain. Link 12 has the least elongation:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-7g1st3

Portfolio Optimization (2)
Find the best combination of six stocks to invest in out of a possible 20 candidate stocks subject to market volatility, so as to maximize return while minimizing risk when there is uncertainty in the mean returns. The expected return values for stock
and the covariance between the stocks
are:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-6cs95
Due to market fluctuations, the average return value of each stock is subject to an uncertainty :

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-tc1akk
Let be the percentage of total investment made in stock
. The return is given by
:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-js1z6k

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-m5i4r3
Let be a decision vector such that if
, then that stock is bought. Six stocks have to be chosen:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-rg9ln8
The percentage of investment must be greater than 0 and must add to 1:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-4dpqgq
Find the optimal combination of stocks that minimizes the risk and maximizes return:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-p2svb6

The safest optimal combination of stocks is:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-mmk8n4

The percentages of investment to put into the respective stocks are:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-0xgdrs

The safe risks and returns are:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-qje2od

Construct a parametric function for varying the various parameters:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-cdx8h1

The safest optimal stock combination gives the smallest risk and return compared to optimal stocks with random instances of uncertainties:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-8vpaqm

Find the distribution of capital to invest in six stocks to maximize return while minimizing risk when there is uncertainty in both the mean returns and covariance. The expected return values for stock
and the covariance between the stocks
are:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-47e6i1
Due to market fluctuations, the return value of each stock is subject to an uncertainty :

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-jjzd3d
Let be the percentage of total investment made in stock
. The return is given by
:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-rzeu0
The covariance is extracted from a finite dataset and is also subject to uncertainties :

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-i0mtce
The risk is given by , and
is a risk-aversion parameter:

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

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-o5t1ib
The percentage of investment must be greater than 0 and must add to 1:

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

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-xzsdsv
Increasing the risk-aversion parameter leads to stock diversification to reduce the risk:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-iigozs

Facility Location Problems (1)
A company wants to open a new factory. The factory needs raw materials from five warehouses. The transportation cost per unit distance, which varies between , between the new factory and warehouses is:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-vsz0v5
Let be the distance between factory and warehouses
The objective is to minimize
:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-bk8fhk
The five warehouses are located at:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-s5sjna
The new factory must be located such that
:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-myyasl
Find the optimal distances between the new factory and the warehouses:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-ddlxlo

The new factory location is closer to the warehouses, where the transportation costs are higher:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-unh4b5

Classification Problems (2)
Find a line that separates two groups of points
and
where
are interval uncertainties:

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

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-3enn5d
The objective is to minimize , which gives twice the thickness between
and
:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-22le9t


https://wolfram.com/xid/0mfesb0mgk61dk1g9u-1kqc24

Visualize the classifier subject along with the box uncertainty for each point:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-37n7t1

Increasing the box uncertainty will lead to an infeasible classifier:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-mbwsnv


Visualizing the sets with the increased uncertainties shows that the two sets have some points whose uncertainty boxes overlap:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-8xyz1f

Find a quadratic polynomial that separates two groups of 3D points and
where
are interval uncertainties:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-1sukvn

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

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

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-vhhexe
Find the separating polynomial by minimizing :

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-m71n3f

The polynomial separating the two groups of points is:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-zjpn1j

Plot the polynomial separating the two datasets:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-uplfrg

Possible Issues (1)Common pitfalls and unexpected behavior
Certain problems will fail because the first argument in ForAll is not evaluated:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-l3l78

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-wm1lkb


Use Evaluate to ensure that the first argument in ForAll gets evaluated:

https://wolfram.com/xid/0mfesb0mgk61dk1g9u-k0988t

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