Decrease calculation time through already plausible starting point

Problems with modeling
Post Reply
mielke
User
User
Posts: 8
Joined: 6 years ago

Decrease calculation time through already plausible starting point

Post by mielke »

Dear all


In solving a fairly simple linear model with cplex, with high time and space resolution, the running of simulations appears to become a very time-consuming operation.
Is it possible to reduce calculation time by using the solution of your previous simulation as a starting point for the new simulation? Usually, I only change one parameter so that the new solution should not be too far off from the previous one.

Thanks in advance!


Michiel
User avatar
Renger
Posts: 639
Joined: 7 years ago

Re: Decrease calculation time through already plausible starting point

Post by Renger »

Hi Michael
If you add a solve statement after the first solve, it will use the previous solve as starting point.
THere is another option: take a look at savepoint in the manual.
Cheers
Renger
____________________________________
Enjoy modeling even more: Read my blog on modeling at The lazy economist
mielke
User
User
Posts: 8
Joined: 6 years ago

Re: Decrease calculation time through already plausible starting point

Post by mielke »

Hey Renger


Thanks for your reply!
However, I'm having some trouble understanding where the additional value of the savepoint is, as this just stores the resulting variables in an output .gdx file? At the end of every solve, the results are currently already stored into the file 'output.gdx'. Would it then be sufficient to include the following lines of code (the first part is the original loding in of parameters):

$gdxin input
$load <parameters>
$gdxin

$gdxin output
$load <optimal variables from previous solution>
$gdxin

Thanks!


Michiel
User avatar
Renger
Posts: 639
Joined: 7 years ago

Re: Decrease calculation time through already plausible starting point

Post by Renger »

You can use execute_loadpoint and savepoint without having to write all the variables, etc. It stores all the information including the marginals (they can be non-zero).
If no arguments besides the name of the GDX file are given, all variables and equations that match variables and equations of the calling GAMS programs will be merged with the GDX level and marginal values. Bounds, scales and priorities will remain unchanged
Cheers
Renger
____________________________________
Enjoy modeling even more: Read my blog on modeling at The lazy economist
Post Reply