Sequence solve stages using one model instance

Problems with syntax of GAMS
Post Reply
zamry
User
User
Posts: 8
Joined: 2 years ago

Sequence solve stages using one model instance

Post by zamry »

Hello,

I'm solving large-scale power flow problems (NLPs) in GAMS. On average, a problem consists of 5 million variables in which the model generation time alone takes about 10 min. My strategy involves two solve stages: Stage 1: solve model X (converged in 50 min), Stage 2: re-solve model X with some variables fixed as integers (based on Stage 1 solution) and some variable bounds relaxed (converged in 1 min). What happen here is that the same model is generated twice for each solve stage. Model generation time for stage 2 becomes a performance bottleneck because generating the model takes so much longer than actually solving it. I would like to know if GAMS has any suggestions on speeding up model generation time, or using the same model instance for both solve stages. I have looked at GUSS but I'm not seeing its ability to fix variable levels (i.e. solution) and change variable bounds for the subsequent solve.

I have attached here a sample of gams code for the work flow that I intended to implement. I'm trying to access gams model instance through embedded python code block, but I'm not sure how to update variable bounds .lo/.up, and fixing a variable in the second solve stage, i.e. x.fx [stage2] = x.l [stage1]. Feedback and advice would be very much appreciated. TQ
transport_sequence_solve.gms
(3.11 KiB) Downloaded 115 times
Post Reply