Solving Equality-Constrained Problems (nlpse03)


/*****************************************************************/
/*                                                               */
/*               S A S   S A M P L E   L I B R A R Y             */
/*                                                               */
/*    NAME: nlpse03                                              */
/*  TITLE: Solving Equality-Constrained Problems (nlpse03)       */
/* PRODUCT: OR                                                   */
/*  SYSTEM: ALL                                                  */
/*    KEYS: OR                                                   */
/*   PROCS: OPTMODEL                                             */
/*    DATA:                                                      */
/*                                                               */
/* SUPPORT:                             UPDATE:                  */
/*     REF:                                                      */
/*    MISC: Example 3 from the Nonlinear Programming Solver      */
/*          chapter of Mathematical Programming.                 */
/*                                                               */
/*****************************************************************/


proc optmodel;
   var x{1..5};

   minimize obj = prod {i in 1..5} x[i];

   con constr1: sum {i in 1..5} x[i]^2 = 10;
   con constr2: x[2] * x[3] - 5 * x[4] * x[5] = 0;
   con constr3: x[1]^3 + x[2]^3 = -1;

   /* starting point */
   x[1] = -2;
   x[2] =  1.5;
   x[3] =  2;
   x[4] = -1;
   x[5] = -1;

   solve with nlp / algorithm=ipdirect;
   print x;
quit;