BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
sametunver
Fluorite | Level 6

Hello everyone,

 

I have an OR model where I am trying to minimize the cost. I solved this model without any problem using Excel solver. I also solved the same model in SAS EG using the optmodel procedure with different algorithms. But the results I get on both platforms are different and those in Optmodel are unacceptably higher.

 

I'm sure my model's constraints, variables, and target function are correct. Therefore, how should I proceed so that I can reach the result I obtained in Excel?

 

Thanks in advance.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
RobPratt
SAS Super FREQ

When I run your code with SAS/OR 15.2, I get the following:

NOTE: Optimal.
NOTE: Objective = 1152546.48.

Your objective is nonconvex minimization, so I recommend using the MULTISTART option to avoid getting stuck in a local minimum:

   solve with nlp / multistart;

The resulting objective value matches the previous value, but you can see that multiple local optima were found:

NOTE: The Multistart algorithm generated 4800 sample points.
NOTE: 2 distinct local optima were found.
NOTE: The best objective value found by local solver = 1152546.4807.
NOTE: The solution found by local solver with objective = 1152546.4807 was returned.

Also, the large upper bounds of 999999999 are not recommended.

 

View solution in original post

5 REPLIES 5
RobPratt
SAS Super FREQ
Can you please share your data and code?
sametunver
Fluorite | Level 6

I am sharing it in the attachment of the message.

sametunver
Fluorite | Level 6

For example, when I solve the above problem using Excel GRG, I get the result 1152758, while in the optmodel this value is 1167858. There is a difference of approximately 15100 units and this is far outside my tolerance.

RobPratt
SAS Super FREQ

When I run your code with SAS/OR 15.2, I get the following:

NOTE: Optimal.
NOTE: Objective = 1152546.48.

Your objective is nonconvex minimization, so I recommend using the MULTISTART option to avoid getting stuck in a local minimum:

   solve with nlp / multistart;

The resulting objective value matches the previous value, but you can see that multiple local optima were found:

NOTE: The Multistart algorithm generated 4800 sample points.
NOTE: 2 distinct local optima were found.
NOTE: The best objective value found by local solver = 1152546.4807.
NOTE: The solution found by local solver with objective = 1152546.4807 was returned.

Also, the large upper bounds of 999999999 are not recommended.

 

sametunver
Fluorite | Level 6

Firstly, thank you. I am currently using SAS/OR version 15.1. However, I have reached the result 1152546.4807, which you also found, by increasing the 'opttol' value from the Solver options.

solve with nlp / opttol = 0.000000000001;

Thanks again.

sas-innovate-white.png

Missed SAS Innovate in Orlando?

Catch the best of SAS Innovate 2025 — anytime, anywhere. Stream powerful keynotes, real-world demos, and game-changing insights from the world’s leading data and AI minds.

 

Register now

Discussion stats
  • 5 replies
  • 2273 views
  • 2 likes
  • 2 in conversation