MCP in a loop results in infeasible solutions

Problems with modeling
Post Reply
ryanpent
User
User
Posts: 3
Joined: 11 months ago

MCP in a loop results in infeasible solutions

Post by ryanpent »

Hello,
I am trying to solve multiple iterations of an MCP model where I adjust a single parameter in the model. To do so, I wrote a loop statement that goes through a set of scenarios "i", changes the particular parameter, solves the model, and then stores values as reference parameters(using a similar method in therisk.gms loop from the McCarl gams [url]guidehttps://www.gams.com/mccarlGuide/programs_with_ ... ements.htm[/url]). My problem is that many of the parameter scenarios result in locally infeasible solutions, but are feasible when solved with the same parameters outside of the loop. Does this occur because of the PATH solver working from previous solutions when there is multiple solves in the same loop? Is there a way that I can "reset" the model so that it can start without the previous solution and give results similar to when I manually input the parameters outside of the loop? I tried using option solveopt = replace and clear within the loop, but it had no effect. Any help on this issue would be greatly appreciated.

Best,
Ryan
Attachments
mcp_gams_loop_problem.gms
(8.6 KiB) Downloaded 56 times
User avatar
bussieck
Moderator
Moderator
Posts: 1043
Joined: 7 years ago

Re: MCP in a loop results in infeasible solutions

Post by bussieck »

Usually, solvers react to bRatio (see https://www.gams.com/latest/docs/UG_Gam ... MSAObratio) but this does not help here. I unloaded an initial solution via "execute_unload 'startpoint';" just before the loop and inside the loop I did a "execute_loadpoint 'startpoint';" to have all solves starting from the same starting point. With this little trick I could convince PATH to solve all 10 model instances.

Code: Select all

execute_unload 'startpoint';

loop(i,
    Risk_Aversion(sResources) = Risk_Loop(i);
*    Risk_Aversion(sResources) = 1.1 - ord(i)*0.1;
*   Risk_Aversion(sResources) = .1;

    execute_loadpoint 'startpoint';
*    EIR_Market_RTLMP_Great_Than_K.bratio = 0;
    solve EIR_Market_RTLMP_Great_Than_K using mcp;
-Michael
ryanpent
User
User
Posts: 3
Joined: 11 months ago

Re: MCP in a loop results in infeasible solutions

Post by ryanpent »

Michael,
Thank you very much! My workaround was to manually clear all the variable solutions using option clear VarName after the solves in the loop, but this is a much quicker method.
Best,
Ryan
Post Reply