Commit 6c2d6a1d authored by Topi Rasku's avatar Topi Rasku
Browse files

Removing *dtt* due to performance issues and replacing it with more efficient *dt_active*.

parent 82ed6d06
......@@ -110,7 +110,7 @@ Parameters
dt(t) "Displacement needed to reach the previous time interval (in time steps)"
dt_circular(t) "Circular t displacement if the time series data is not long enough to cover the model horizon"
dt_next(t) "Displacement needed to reach the next time interval (in time steps)"
dtt(t, t) "Displacement needed to reach any previous time interval (in time steps)"
dt_active(t) "Displacement needed to reach the previous active time interval (in time steps)"
dt_toStartup(unit, t) "Displacement from the current time interval to the time interval where the unit was started up in case online variable changes from 0 to 1 (in time steps)"
dt_toShutdown(unit, t) "Displacement from the current time interval to the time interval where the shutdown phase began in case generation becomes 0 (in time steps)"
dt_starttypeUnitCounter(starttype, unit, counter) "Displacement needed to account for starttype constraints (in time steps)"
......
......@@ -601,16 +601,8 @@ loop(uft_online(unit, f, t)${ p_u_shutdownTimeIntervals(unit) },
* --- Displacements for start-up and shutdown decisions -----------------------
* -----------------------------------------------------------------------------
// Form a temporary clone of the t_active set
Option clear = tt;
tt(t_active(t)) = yes;
// Calculate dtt: displacement needed to reach any previous time interval
// (needed to calculate dt_toStartup and dt_toShutdown)
Option clear = dtt;
dtt(t_active(t), tt(t_))
${ ord(t_) <= ord(t) }
= ord(t_) - ord(t);
// Calculate the time displacement to reach the preceding active time step from any current time step
dt_active(t_current(t)) = smax(t_active(t_)${ord(t_) <= ord(t)}, ord(t_)) - ord(t);
* --- Start-up decisions ------------------------------------------------------
......@@ -618,13 +610,8 @@ dtt(t_active(t), tt(t_))
// displacement needed to reach the time interval where the unit was started up
Option clear = dt_toStartup;
loop(runUpCounter(unit, 'c000'), // Loop over units with meaningful run-ups
loop(t_active(t),
dt_toStartup(unit, tt(t_)) // tt still used as a clone of t_active (see above)
${ dtt(t_, t) > - p_u_runUpTimeIntervalsCeil(unit)
and dtt(t_, t+dt(t)) <= - p_u_runUpTimeIntervalsCeil(unit)
}
= dtt(t_, t+dt(t));
); // END loop(t_active)
dt_toStartup(unit, t_active(t))
= - p_u_runUpTimeIntervalsCeil(unit) + dt_active(t - p_u_runUpTimeIntervalsCeil(unit));
); // END loop(runUpCounter)
* --- Shutdown decisions ------------------------------------------------------
......@@ -634,13 +621,8 @@ loop(runUpCounter(unit, 'c000'), // Loop over units with meaningful run-ups
// the shutdown decisions was made
Option clear = dt_toShutdown;
loop(shutdownCounter(unit, 'c000'), // Loop over units with meaningful shutdowns
loop(t_active(t),
dt_toShutdown(unit, tt(t_)) // tt still used as a clone of t_active (see above)
${ dtt(t_, t) > - p_u_shutdownTimeIntervalsCeil(unit)
and dtt(t_, t+dt(t)) <= -p_u_shutdownTimeIntervalsCeil(unit)
}
= dtt(t_, t+dt(t));
); // END loop(t_active)
dt_toShutdown(unit, t_active(t))
= - p_u_shutdownTimeIntervalsCeil(unit) + dt_active(t - p_u_shutdownTimeIntervalsCeil(unit))
); // END loop(runUpCounter)
* --- Historical Unit LP and MIP information ----------------------------------
......
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