$TITLE NLP Example (simple) 3
$OFFUPPER
*
*
* Ref:  From C&O666 notes 
*         Regularity condition and multiplier rule fail. GAMS fails.
*
*---------------------------------------------------------------------

 SETS     J         index      / J1 * J2 / ;

 VARIABLES
      X(J)   unknowns
      Z      optimal value  ;


 EQUATIONS 
    COST   define objective function
    CONSTR1 single constraint nonlinear  ;
 
 COST..  Z =E= X('J1')**2 + X('J2')**2;
 CONSTR1 .. X('J2')**2  + (1-X('J1'))**3 =E= 0 ;

MODEL NLP3 /ALL/;

 SOLVE NLP3  MINIMIZING Z USING NLP;

