Commit cf88c949 authored by Erkka Rinne's avatar Erkka Rinne
Browse files

Fix a bug in long-term scenario smoothing

Parameter `msEnd` was not used with `tSolveFirst` causing wrong values
in later solves.
parent cdcc28f7
......@@ -49,6 +49,7 @@ All notable changes to this project will be documented in this file.
## 1.1.5 - 2020-11-28
### Fixed
- Long-term scenario data when using only one scenario
- Bug with scenario smooting which caused wrong values on later than first solve
## 1.1.4 - 2019-11-02
......@@ -510,10 +510,13 @@ $ifthen.autocorr defined p_autocorrelation
// Do smoothing
if(mSettings(mSolve, 'scenarios'), // Only do smooting if using long-term scenarios
// Select the initial sample, first `t` not in it and `f` of the last `t` in it
// Select the initial sample, the last time in it (t_)
// and the forecast (f_) of the last simulated time step (t__) in it
loop((ms_initial(mSolve, s_), t_, ft(f_, t__))
$[ord(t_) = msEnd(mSolve, s_) and mst_end(mSolve, s_, t__)
and (mf_realization(mSolve, f_) xor mf_central(mSolve, f_))],
$[ord(t_) = msEnd(mSolve, s_) + tSolveFirst - 1
and mst_end(mSolve, s_, t__)
and (mf_realization(mSolve, f_) xor mf_central(mSolve, f_))
$$batinclude 'inc/smoothing.gms' ts_influx
$$batinclude 'inc/smoothing.gms' ts_cf
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