## proc optmodel min/max abs function

Occasional Contributor
Posts: 9

# proc optmodel min/max abs function

Say I have multiple decision variables x1,x2,x3, x4. Is there a simple way to set x4=max(x1,x2,x3), or x4=abs(x1) using MIP? I know CPLEX can do this by using maxl and abs functions. I suppose SAS/OR can do the same thing?

SAS Employee
Posts: 519

## Re: proc optmodel min/max abs function

[ Edited ]

For the NLP solver, you can use the MAX and ABS functions with variables as arguments. In that case, PROC OPTMODEL recognizes the nondifferentiability and uses numeric derivatives instead. But no automatic linearization is performed.

If you just want to assign x4 to a value, outside of a solver call rather than as a constraint, the syntax you provided is perfectly legal.

Occasional Contributor
Posts: 9

## Re: proc optmodel min/max abs function

Thanks! I really hope the next version of SAS/OR can integrate those functions in the mixed integer programming solver.

Contributor
Posts: 33

## Re: proc optmodel min/max abs function

I hope the NLP solver in PROC OPTMODEL can handle integer decision variables in the future so that no linearization is needed.

SAS Employee
Posts: 519

## Re: proc optmodel min/max abs function

Direct support for mixed integer nonlinear problems in PROC OPTMODEL is on our road map.  Until then, you might consider using PROC OPTLSO:

http://support.sas.com/documentation/cdl/en/orlsoug/68155/HTML/default/viewer.htm#orlsoug_hplso_toc....

Also, you can model some nonlinearity with integer variables in PROC OPTMODEL by using the ELEMENT predicate in the CLP solver:

http://support.sas.com/documentation/cdl/en/ormpug/68156/HTML/default/viewer.htm#ormpug_clpsolver_ex...

Contributor
Posts: 33

## Re: proc optmodel min/max abs function

Thank you much, Rob.

Discussion stats
• 5 replies
• 520 views
• 1 like
• 3 in conversation