The Conic Optimization Solver

Getting Started: Conic Optimization Solver

The example in this section illustrates how you can use the OPTMODEL procedure to solve conic optimization problems. Suppose you want to solve the following second-order cone problem:

StartLayout 1st Row 1st Column min 2nd Column 5 x 1 plus x 4 plus x 5 plus x 6 2nd Row 1st Column subject to 2nd Column minus 3 x 3 plus x 4 plus x 5 greater than or equals 0 3rd Row 1st Column Blank 2nd Column x 3 minus 0.1 x 5 minus 0.25 x 6 greater than or equals 0 4th Row 1st Column Blank 2nd Column x 4 plus x 5 plus x 6 greater than or equals 2 5th Row 1st Column Blank 2nd Column x 2 equals 0.5 6th Row 1st Column Blank 2nd Column 2 x 1 x 2 greater than or equals x 3 squared plus x 4 squared 7th Row 1st Column Blank 2nd Column x 1 comma x 2 comma x 4 greater than or equals 0 8th Row 1st Column Blank 2nd Column 0.2 less than or equals x 3 less than or equals 1 9th Row 1st Column Blank 2nd Column 0 less than or equals x 5 comma x 6 less than or equals 1 EndLayout

The fifth constraint is a rotated second-order cone that is defined on the variables x 1, x 2, x 3, and x 4. This cone constraint together with the fourth constraint transforms the following general nonlinear constraint into a second-order cone programming formulation:

x 1 greater than or equals x 3 squared plus x 4 squared

You can use the following statements to call the OPTMODEL procedure to solve this SOCP problem:

/* getting started example for conic solver */
proc optmodel;
   /* declare variables */
   var x {1..6} >= 0;

   /* objective function */
   min Z = 5*x[1] + x[4] + x[5] + x[6];

   /* linear constraints */
   con c1: -3*x[3] + x[4] + x[5] >= 0;
   con c2: x[3] - 0.1*x[5] - 0.25*x[6] >= 0;
   con c3: x[4] + x[5] + x[6] >= 2;
   con c4: x[2] = 0.5;

   /* rotated second-order cone constraint */
   con cone: rsoc(x[1], x[2], x[3] x[4]);

   /* bounds on variables */
   x[3].lb = 0.2;
   x[3].ub = 1;
   for{i in 5..6} x[i].ub = 1;

   /* specify conic solver */
   solve with conic;

   /* print optimal primal solution and dual cone solution */
   print x x.dcone;
quit;

The output and optimal solution are displayed in Figure 1. The dual cone values are returned in each variable.dcone suffix.

Figure 1: Summaries and Optimal Solution

The OPTMODEL Procedure

Problem Summary
Objective SenseMinimization
Objective FunctionZ
Objective TypeLinear
  
Number of Variables6
Bounded Above0
Bounded Below3
Bounded Below and Above3
Free0
Fixed0
  
Number of Constraints5
Linear LE (<=)0
Linear EQ (=)1
Linear GE (>=)3
Linear Range0
Rotated Second-Order Cone1

Solution Summary
SolverConic
AlgorithmInterior Point
Objective FunctionZ
Solution StatusOptimal
Objective Value2.576470543
  
Primal Infeasibility2.7662483E-8
Dual Infeasibility0
Bound Infeasibility0
Duality Gap4.6776548E-8
Complementarity6.4866402E-8
  
Iterations8
Presolve Time0.00
Solution Time0.00

[1]xx.DCONE
10.1152945.00000
20.5000001.15348
30.329415-3.29488
40.082341-0.82372
51.000000.
60.917659.


The iteration log that displays problem statistics, the progress of the solution, and the optimal objective value is shown in Figure 2.

Figure 2: Log

 
NOTE: Problem generation will use 4 threads.                                    
NOTE: The problem has 6 variables (0 free, 0 fixed).                            
NOTE: The problem has 4 linear constraints (0 LE, 1 EQ, 3 GE, 0 range).         
NOTE: The problem has 10 linear constraint coefficients.                        
NOTE: The problem has 0 nonlinear constraints (0 LE, 0 EQ, 0 GE, 0 range).      
NOTE: The problem has 1 predicate constraints.                                  
NOTE: The conic presolver value AUTOMATIC is applied.                           
NOTE: The conic presolver removed 0 variables and 1 constraints.                
NOTE: The conic presolver removed 1 constraint coefficients.                    
NOTE: The presolved problem has 6 variables, 4 constraints, and 11 constraint   
      coefficients.                                                             
NOTE: The presolved problem has 1 second-order cone constraints.                
NOTE: The conic solver is called.                                               
NOTE: The Interior Point algorithm is used.                                     
NOTE: The deterministic parallel mode is enabled.                               
NOTE: The Interior Point algorithm is using up to 4 threads.                    
                                        Primal       Bound        Dual          
      Iter  Complement Duality Gap      Infeas      Infeas      Infeas   Time   
         0  1.2000E+01  6.3355E+00  1.1554E+00  9.5998E-01  9.9645E-01      0   
         1  6.2502E+00  2.3692E+00  4.3206E-01  3.5899E-01  3.7262E-01      0   
         2  1.9365E+00  6.9667E-01  1.7791E-01  1.4782E-01  1.5344E-01      0   
         3  2.1123E-01  8.1739E-02  3.4021E-02  2.8266E-02  2.9340E-02      0   
         4  5.8675E-02  2.5400E-02  1.1679E-02  9.7038E-03  1.0072E-02      0   
         5  4.5766E-03  2.0031E-03  9.3971E-04  7.8077E-04  8.1043E-04      0   
         6  2.0916E-04  9.2153E-05  4.3295E-05  3.5972E-05  3.7339E-05      0   
         7  1.6809E-05  7.4083E-06  3.4809E-06  2.8921E-06  3.0020E-06      0   
         8  2.2432E-07  9.8865E-08  4.6453E-08  3.8596E-08  4.0062E-08      0   
NOTE: Optimal.                                                                  
NOTE: Objective = 2.576470543.                                                  
NOTE: The Interior Point solve time is 0.00 seconds.                            
 
 


Last updated: June 22, 2026