a scenario run yields different results when run singly and in a loop of others Topic is solved

Problems with modeling
Post Reply
femibode
User
User
Posts: 8
Joined: 4 years ago

a scenario run yields different results when run singly and in a loop of others

Post by femibode »

Hi there

wondering if somebody can help me understand why a model scenario gives different results when ran singly and when run in a loop with other scenarios. For example, when I run it singly, my set up is as follow:

Code: Select all

Loop(scenario$(ord(scenario) lt 3 and ord(scenario) eq 2),

if(ord(scenario) eq 1,
* do something
);

if(ord(scenario) eq 2,
* do something
);

if(ord(scenario) eq 3,
* do something
);
);
and the result was "optimal solution".

But when I run it continuous as follow:

Code: Select all

loop(scenario$(ord(scenario) lt 3),

if(ord(scenario) eq 1,
* do something
);

if(ord(scenario) eq 2,
* do something
);

if(ord(scenario) eq 3,
* do something
);
);
I got different results. For scenario 2, the result was terminated by solver (** Feasible solution. The tolerances are minimal and there is no change in objective although the reduced gradient is greater than the tolerance.).

I have read a few materials that says it might be scaling, smooth formulations or stalling but am curious why different results.
Last edited by femibode 3 years ago, edited 1 time in total.
User avatar
bussieck
Moderator
Moderator
Posts: 1038
Joined: 7 years ago

Re: a scenario run yields different results when run singly and in a loop of others

Post by bussieck »

Your runs start from different starting points. In the first case scenarios 2 starts from the manually set starting point while in the second case case it starts from the optimal solution of scenario 1. For NLP (and sometimes for LP) this is a big difference.

-Michael
Post Reply