Operations Research topics: SAS/OR,
SAS Optimization, and SAS Simulation Studio

OPTMODEL - Fix stement

Accepted Solution Solved
Reply
New Contributor
Posts: 3
Accepted Solution

OPTMODEL - Fix stement

Could anyone please explain what difference does a fix statement make in the optmodel procedure?

 

Thanks in advance.


Accepted Solutions
Solution
‎03-09-2017 03:33 AM
Super Contributor
Posts: 334

Re: OPTMODEL - Fix stement

Initial value vs. actually fixed value. Compare results.

Proc optmodel;
var x;
x=2;
con con: x<=10;
max obj=x;
solve;
put x=;
quit;

Proc optmodel;
var x;
fix x=2;
con con: x<=10;
max obj=x;
solve;
put x=;
quit;

View solution in original post


All Replies
Super Contributor
Posts: 334

Re: OPTMODEL - Fix stement

It sets/fixes a variable to a certain value.

 

Exactly as in:

 

 proc optmodel;
      var x{1..10};
      fix x = 0;
      fix x[10] = 1;

 

From: http://support.sas.com/documentation/cdl/en/ormpug/66851/HTML/default/viewer.htm#ormpug_optmodel_syn...

New Contributor
Posts: 3

Re: OPTMODEL - Fix stement

Thanks for the reply.

 

But, what's the diffrence between the following two programs?

 

1)

Proc optmodel;

var x;

x=2;

put x=;

quit;

 

2)

Proc optmodel;

var x;

fix x=2;

put x=;

quit;

Solution
‎03-09-2017 03:33 AM
Super Contributor
Posts: 334

Re: OPTMODEL - Fix stement

Initial value vs. actually fixed value. Compare results.

Proc optmodel;
var x;
x=2;
con con: x<=10;
max obj=x;
solve;
put x=;
quit;

Proc optmodel;
var x;
fix x=2;
con con: x<=10;
max obj=x;
solve;
put x=;
quit;
New Contributor
Posts: 3

Re: OPTMODEL - Fix stement

It now explains. Thanks a lot.

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 143 views
  • 1 like
  • 2 in conversation