Page 1 of 1

Year to Year Solve for Multiyear problem

Posted: Fri Jun 22, 2018 8:52 pm
by alamince
Hello,

I am solving a multi-year MINLP problem. I would like to solve the problem from year to year. That is, I would like to solve the problem for one year at a time in a way that GAMS should use previous year's solution to solve the next year problem. For example, once the program solves for year 1, then it should use the solution of year 1 to solve the problem for year 2 and so on. How can I do it in a single run?

Thanks,

Al-Amin

Re: Year to Year Solve for Multiyear problem

Posted: Mon Jul 02, 2018 1:09 pm
by Renger
Hi
You could use a loop over all years (You might have to rewrite the model equations, so that the time is not part of the model anymore)

Code: Select all

set t /2018*2050/

 * Define the model parameters for each year
table myyearlyvalues(t,*);
     capa   ...
2018  10
2019   11
;

loop(t,

   mymodelparameter = myyearlyvalues(t, "capa");
   ...
   solve mymodel
* Adjust the start values (if necessary for the next year)
mymodelstart = X.L;
);
Gams will, in most cases, use the solution of the previous solve as a starting point for the next solve.

Hope this helps
Cheers
Renger