Fluorite | Level 6

## Nonlinear Programming Algorithms in Optmodel vs Excel Nonlinear GRG

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?

1 ACCEPTED SOLUTION

Accepted Solutions
SAS Super FREQ

## Re: Nonlinear Programming Algorithms in Optmodel vs Excel Nonlinear GRG

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.

5 REPLIES 5
SAS Super FREQ

## Re: Nonlinear Programming Algorithms in Optmodel vs Excel Nonlinear GRG

Fluorite | Level 6

## Re: Nonlinear Programming Algorithms in Optmodel vs Excel Nonlinear GRG

I am sharing it in the attachment of the message.

Fluorite | Level 6

## Re: Nonlinear Programming Algorithms in Optmodel vs Excel Nonlinear GRG

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.

SAS Super FREQ

## Re: Nonlinear Programming Algorithms in Optmodel vs Excel Nonlinear GRG

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.

Fluorite | Level 6

## Re: Nonlinear Programming Algorithms in Optmodel vs Excel Nonlinear GRG

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.

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