Commit 1941e334 authored by Erkka Rinne's avatar Erkka Rinne
Browse files

If solver did not complete normally check model status

parent efa0f9ba
......@@ -133,6 +133,12 @@ $include '%input_dir%/modelsInit.gms'
* === Simulation ==============================================================
// Macro for checking solve status (1 = normal completion)
$macro checkSolveStatus(mdl) \
if(mdl.solveStat > 1 and (mdl.modelStat <> 1 or mdl.modelStat <> 8), \
execError = execError + 1 \
)
$include 'inc/3a_periodicInit.gms' // Initialize modelling loop
loop(modelSolves(mSolve, tSolve)$(execError = 0),
solveCount = solveCount + 1;
......
......@@ -5,6 +5,7 @@ All notable changes to this project will be documented in this file.
### Added
- Dynamic generation portfolios aka pathway modelling aka multi-year simulations with discounted costs enabled
- Reserve activation duration and reactivation time included (in state constraints)
- Raise execution error if solver did not finish normally
### Changed
- Static inertia requirement can be fulfilled by both rotational inertia of machines and certain reserve products
......
......@@ -51,18 +51,21 @@ $offtext
schedule.holdfixed = 1; // Enable holdfixed, which makes the GAMS compiler convert fixed variables into parameters for the solver.
schedule.OptFile = 1;
solve schedule using mip minimizing v_obj;
checkSolveStatus(schedule);
); // END IF SCHEDULE
if (mSolve('building'),
building.holdfixed = 1;
building.OptFile = 1;
solve building using mip minimizing v_obj;
checkSolveStatus(building);
); // END IF BUILDING
if (mSolve('invest'),
invest.holdfixed = 1; // Enable holdfixed, which makes the GAMS compiler convert fixed variables into parameters for the solver.
invest.OptFile = 1;
solve invest using mip minimizing v_obj;
checkSolveStatus(invest);
); // END IF INVEST
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment