Could anyone please explain what difference does a fix statement make in the optmodel procedure?
Thanks in advance.
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;
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;
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;
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;
It now explains. Thanks a lot.
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
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.