Commit f3085dca authored by Topi Rasku's avatar Topi Rasku
Browse files

Diagnostic 'd_eff' and 'd_cop' now include +Eps to avoid inconsistent t-axes...

Diagnostic 'd_eff' and 'd_cop' now include +Eps to avoid inconsistent t-axes with GAMS plots. Minor readability changes.
parent d7570322
......@@ -168,18 +168,20 @@ tCounter = 1;
cc(counter)${ mInterval(mSolve, 'stepsPerInterval', counter) }
= yes;
currentForecastLength = min( mSettings(mSolve, 't_forecastLengthUnchanging'), // Unchanging forecast length would remain the same
mSettings(mSolve, 't_forecastLengthDecreasesFrom') - [mSettings(mSolve, 't_forecastJump') - {tForecastNext(mSolve) - tSolveFirst}] // While decreasing forecast length has a fixed horizon point and thus gets shorter
); // Smallest forecast horizon is selected
currentForecastLength
= min( mSettings(mSolve, 't_forecastLengthUnchanging'), // Unchanging forecast length would remain the same
mSettings(mSolve, 't_forecastLengthDecreasesFrom') - [mSettings(mSolve, 't_forecastJump') - {tForecastNext(mSolve) - tSolveFirst}] // While decreasing forecast length has a fixed horizon point and thus gets shorter
); // Smallest forecast horizon is selected
// Is there any case where t_forecastLength should be larger than t_horizon? Could happen if one doesn't want to join forecasts at the end of the solve horizon.
// If not, add a check for currentForecastLength <= mSettings(mSolve, 't_horizon')
// and change the line below to 'tSolveLast = ord(tSolve) + mSettings(mSolve, 't_horizon');'
tSolveLast = ord(tSolve) + max(currentForecastLength, min(mSettings(mSolve, 't_horizon'), smax(s, msEnd(mSolve, s)))); // tSolveLast: the end of the current solve
Option clear = t_current;
t_current(t_full(t))${ ord(t) >= tSolveFirst
and ord (t) <= tSolveLast
}
t_current(t_full(t))
${ ord(t) >= tSolveFirst
and ord (t) <= tSolveLast
}
= yes;
// Loop over the defined blocks of intervals
......
......@@ -496,7 +496,8 @@ d_cop(unit, ft_realizedNoReset(f, t))${ [ord(t) > mSettings(m, 't_start') + mSe
-r_gen(grid_, node_, unit, f, t)
) // END sum(gnu_input)
+ 1${not sum(gnu_input(grid_, node_, unit), -r_gen(grid_, node_, unit, f, t))}
];
]
+ Eps; // Eps to correct GAMS plotting (zeroes are not skipped)
// Estimated efficiency
d_eff(unit_fuel(unit), ft_realizedNoReset(f, t))$[ord(t) > mSettings(m, 't_start') + mSettings(m, 't_initializationPeriod')]
......@@ -507,7 +508,8 @@ d_eff(unit_fuel(unit), ft_realizedNoReset(f, t))$[ord(t) > mSettings(m, 't_start
+ r_fuelUse(fuel, unit, f, t)
) // END sum(uFuel)
+ 1${not sum(uFuel(unit, 'main', fuel), r_fuelUse(fuel, unit, f, t))}
];
]
+ Eps; // Eps to correct GAMS plotting (zeroes are not skipped)
$endif.diag
); // END loop(m)
......
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