Commit 39d8a173 authored by Topi Rasku's avatar Topi Rasku
Browse files

Added a new optional model setting 'dataLength', which allows for explicitly...

Added a new optional model setting 'dataLength', which allows for explicitly determining the desired length of data used before 'dt_circular' starts recycling it.
Changed the calculation of maximum data length to find the largest 'ord(t)' with defined data instead of the old counting of found values.
Removed an unused scalar 'stepsPerInterval'.
parent cc25b9ef
......@@ -52,7 +52,8 @@ Sets
// Features
t_trajectoryHorizon, // Length of the horizon when start-up and shutdown trajectories are considered (in time steps)
t_initializationPeriod // Number of time steps in the beginning of the simulation which are solved but the results of which are not stored
t_initializationPeriod, // Number of time steps in the beginning of the simulation which are solved but the results of which are not stored
dataLength // The maximum number of time steps in any input data time series (recommended for correctly circulating data)
/
// Solve info
......
......@@ -23,9 +23,7 @@ Scalars
tSolveLast "counter for the last t in the solve"
tCounter "counter for t" /0/
lastCounter "last member in use of the general counter"
ts_length "Length of time series (t)"
continueLoop "Helper to stop the looping early"
* stepsPerInterval "Length of the interval to be calculated, considering end of modelling period" // redundant
currentForecastLength "Length of the forecast in the curren solve, minimum of unchanging and decreasing forecast lengths"
count "General counter"
count_lambda, count_lambda2 "Counter for lambdas"
......
......@@ -100,25 +100,27 @@ $offtext
);
);
// Calculate the length of the time series data (based on realized forecast)
loop(gn(grid, node),
tmp = max(sum((mf_realization(m, f), t)${ ts_influx(grid, node, f, t) }, 1), tmp); // Find the maximum length of the given influx time series
loop(param_gnBoundaryTypes,
tmp = max(sum((mf_realization(m, f), t)${ ts_node(grid, node, param_gnBoundaryTypes, f, t) }, 1), tmp); // Find the maximum length of the given node time series
); // END loop(param_gnBoundaryTypes)
); // END loop(gn)
// Determine maximum data length, if not provided in the model definition file.
if(mSettings(m, 'dataLength'),
tmp = max(mSettings(m, 'dataLength') + 1, tmp); // 'dataLength' increased by one to account for t000000 in ord(t)
else
// Calculate the length of the time series data (based on realized forecast)
loop((gn(grid, node), mf_realization(m, f)),
tmp = max(smax(t_full(t), ord(t)${ts_influx(grid, node, f, t)}), tmp); // Find the maximum ord(t) given in influx time series
loop(param_gnBoundaryTypes,
tmp = max(smax(t_full(t), ord(t)${ts_node(grid, node, param_gnBoundaryTypes, f, t)}), tmp); // Find the maximum ord(t) given in node time series
); // END loop(param_gnBoundaryTypes)
); // END loop(gn,f_realization)
); // END if(mSettings(dataLength))
); // END loop(m)
* --- Calculate Time Series Length and Circular Time Displacement -------------
// Maximum time series length based on 'tmp' calculated in the above loop.
ts_length = tmp;
// Circular displacement of time index for data loop
dt_circular(t_full(t))${ ord(t) > ts_length }
= - ts_length
* floor(ord(t) / ts_length);
dt_circular(t_full(t))${ ord(t) > tmp }
= - (tmp - 1) // (tmp - 1) used in order to not circulate initial values at t000000
* floor(ord(t) / (tmp));
* =============================================================================
* --- Initialize Unit Efficiency Approximations -------------------------------
......
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