Commit 305ce178 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 504bac9f
...@@ -4,6 +4,7 @@ All notable changes to this project will be documented in this file. ...@@ -4,6 +4,7 @@ All notable changes to this project will be documented in this file.
## 1.1.5 ## 1.1.5
### Fixed ### Fixed
- Long-term scenario data when using only one scenario - 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 ## 1.1.4
### Fixed ### Fixed
......
...@@ -457,10 +457,13 @@ $ifthen.autocorr defined p_autocorrelation ...@@ -457,10 +457,13 @@ $ifthen.autocorr defined p_autocorrelation
// Do smoothing // Do smoothing
if(mSettings(mSolve, 'scenarios'), // Only do smooting if using long-term scenarios 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__)) loop((ms_initial(mSolve, s_), t_, ft(f_, t__))
$[ord(t_) = msEnd(mSolve, s_) and mst_end(mSolve, s_, t__) $[ord(t_) = msEnd(mSolve, s_) + tSolveFirst - 1
and (mf_realization(mSolve, f_) xor mf_central(mSolve, f_))], 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_influx
$$batinclude 'inc/smoothing.gms' ts_cf $$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