BookmarkSubscribeRSS Feed
mallikadey
Calcite | Level 5

Hi,

I am trying to solve a non linear mix integer problem where the objective function is of (x-a)*(x^y) format. x is the decision variable and y and a are constants. there are multiple linear constraints. my question -

Can I use PROC OPTLSO with MPS data option and define the objective function in a FCMP procedure? I have tried this already, but getting this error - "FCMP function evaluation failed".

2 REPLIES 2
RobPratt
SAS Super FREQ

Yes, that is one approach.  Can you please share your code and data? 

sbxkoenk
SAS Super FREQ

Hello,

  

I would do it with PROC OPTMODEL, but you can do it with PROC OPTLSO:

proc optlso
   primalout = work.solution            /* opt solution */
   variables = opt_fl_o.variable_limits 
   /* variables= dataset with decision variable limits LB UB */
   objective = work.objdata
   lincon =work.lincondata     /* work.lincondata    OR _null_ */
   NLINCON=work.nonlincondata  /* work.nonlincondata OR _null_ */
   loglevel = 1 printlevel = 1 seed = 100
;
run;
%PUT &=_OROPTLSO_; /*variable that gives feedback about opt status*/

You get the ERROR

ERROR: FCMP function evaluation failed

when you forgot to include one or more decision variables in the decision variable limits dataset (where you specify lower and upper bounds).

 

You can also get this same ERROR

when you use (the variable name of) non-decision variables among the function arguments and within the formula's when defining the non-linear constraints. Remove your non-decision variable from the list of function arguments and pass on its (fixed scalar) value to the formula in the return statement by means of a macro variable (for example).

 

Good luck,

Koen

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 1021 views
  • 0 likes
  • 3 in conversation