Commit 4f566419 authored by Erkka Rinne's avatar Erkka Rinne
Browse files

Remove clearing time series standard deviation data and setting autocorrelation to zero by default

Fixes #100
parent be53213c
...@@ -14,6 +14,7 @@ All notable changes to this project will be documented in this file. ...@@ -14,6 +14,7 @@ All notable changes to this project will be documented in this file.
### Fixed ### Fixed
- Removed hard-coded `elec grids` from *setVariableLimits* and *rampSched files* - Removed hard-coded `elec grids` from *setVariableLimits* and *rampSched files*
- Time series smooting not working at all (#100)
## [1.1] - 2019-04-17 ## [1.1] - 2019-04-17
### Added ### Added
......
...@@ -187,9 +187,6 @@ Parameters ...@@ -187,9 +187,6 @@ Parameters
p_tsMaxValue(*, node, timeseries) "Maximum allowed value of timeseries in grid/flow and node" p_tsMaxValue(*, node, timeseries) "Maximum allowed value of timeseries in grid/flow and node"
; ;
* Reset values for some parameters
Options clear = ts_influx_std, clear = ts_cf_std;
* --- Other time dependent parameters ----------------------------------------- * --- Other time dependent parameters -----------------------------------------
Parameters Parameters
p_storageValue(grid, node, t) "Value of stored something at the end of a time step" p_storageValue(grid, node, t) "Value of stored something at the end of a time step"
......
...@@ -574,11 +574,9 @@ loop( (nu(node, unit), restypeDirection(restype, up_down)), ...@@ -574,11 +574,9 @@ loop( (nu(node, unit), restypeDirection(restype, up_down)),
* --- Default values --------------------------------------------------------- * --- Default values ---------------------------------------------------------
* ============================================================================= * =============================================================================
loop(timeseries$(not sameas(timeseries, 'ts_cf')), loop(timeseries$(not sameas(timeseries, 'ts_cf')),
p_autocorrelation(gn, timeseries) = 0;
p_tsMinValue(gn, timeseries) = -Inf; p_tsMinValue(gn, timeseries) = -Inf;
p_tsMaxValue(gn, timeseries) = Inf; p_tsMaxValue(gn, timeseries) = Inf;
); );
p_autocorrelation(flowNode, 'ts_cf') = 0;
p_tsMinValue(flowNode, 'ts_cf') = 0; p_tsMinValue(flowNode, 'ts_cf') = 0;
p_tsMaxValue(flowNode, 'ts_cf') = 1; p_tsMaxValue(flowNode, 'ts_cf') = 1;
......
...@@ -452,6 +452,9 @@ This avoids a discontinuity `jump' after the initial sample. ...@@ -452,6 +452,9 @@ This avoids a discontinuity `jump' after the initial sample.
Transm. Distrib., vol. 12, no. 2, pp. 441 - 447, 2018. Transm. Distrib., vol. 12, no. 2, pp. 441 - 447, 2018.
$offtext $offtext
* Check that we have values for the autocorrelations
$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, first `t` not in it and `f` of the last `t` in it
...@@ -462,3 +465,4 @@ if(mSettings(mSolve, 'scenarios'), // Only do smooting if using long-term scena ...@@ -462,3 +465,4 @@ if(mSettings(mSolve, 'scenarios'), // Only do smooting if using long-term scena
$$batinclude 'inc/smoothing.gms' ts_cf $$batinclude 'inc/smoothing.gms' ts_cf
); );
); // END if('scenarios') ); // END if('scenarios')
$endif.autocorr
...@@ -18,6 +18,9 @@ $offtext ...@@ -18,6 +18,9 @@ $offtext
* Argument gives time series type * Argument gives time series type
$setargs timeseries $setargs timeseries
* Check that we have values for the standard deviation
$ifthen.std defined %timeseries%_std
* Select set linking nodes based on the time series type * Select set linking nodes based on the time series type
$ifthen %timeseries% == 'ts_cf' $ifthen %timeseries% == 'ts_cf'
$setlocal linking_set flowNode $setlocal linking_set flowNode
...@@ -49,3 +52,4 @@ $endif ...@@ -49,3 +52,4 @@ $endif
* power(p_autocorrelation(%linking_set%, '%timeseries%'), * power(p_autocorrelation(%linking_set%, '%timeseries%'),
abs(ord(t) - ord(t_))) abs(ord(t) - ord(t_)))
)); ));
$endif.std
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