Simulation Utilities
NEMStorageUnderUncertainty.calculate_actual_revenue
— Methodcalculate_actual_revenue(
sim_results::DataFrames.DataFrame,
actual_price_data::DataFrames.DataFrame,
τ::Float64
) -> Any
Summary
Calculates actual revenue and adds it as a column to sim_results
.
- Revenue is calculated for
binding
decisions non binding
decisions havemissing
revenue
Arguments:
sim_results
: DataFrame of simulation resultsactual_price_data
: DataFrame with actual price data
(with SETTLEMENTDATE
column and prices covering simulation period)
tau
: Interval length in hours
Returns
sim_results
with revenue
column.
Methods
calculate_actual_revenue(sim_results, actual_price_data, τ)
defined at /home/runner/work/NEMStorageUnderUncertainty/NEMStorageUnderUncertainty/src/simulation_utils.jl:18
.
NEMStorageUnderUncertainty.exponential_discounting
— Methodexponential_discounting(
times::Vector{Float64},
r::Float64
) -> Vector{Float64}
Summary
Exponential discounting
\[DF(r, t) = e^{-rt}\]
Arguments
times
: Vector that describes ahead times in hours aheadr
: Discount rate
Returns
Discount factor vector
Methods
exponential_discounting(times, r)
defined at /home/runner/work/NEMStorageUnderUncertainty/NEMStorageUnderUncertainty/src/simulation_utils.jl:138
.
NEMStorageUnderUncertainty.hyperbolic_discounting
— Methodhyperbolic_discounting(
times::Vector{Float64},
r::Float64
) -> Vector{Float64}
Summary
Hyperbolic discounting
\[DF(r, t) = \frac{1}{1+rt}\]
Arguments
times
: Vector that describes ahead times in hours aheadr
: Discount rate
Returns
Discount factor vector
Methods
hyperbolic_discounting(times, r)
defined at /home/runner/work/NEMStorageUnderUncertainty/NEMStorageUnderUncertainty/src/simulation_utils.jl:158
.
NEMStorageUnderUncertainty.results_to_jld2
— Methodresults_to_jld2(
results_file::String,
group::String,
key::String,
data::DataFrames.DataFrame
)
Summary
Saves simulation results to a JLD2 (HDF5) data file
Simulation results (data
) are saved in results_file/group/key
Arguments
results_file
: Path to file, including.jld2
extensiongroup
: Data group -actual
orforecast
key
: Dataset key - storage power capacitydata
: Simulation results DataFrame
Methods
results_to_jld2(results_file, group, key, data)
defined at /home/runner/work/NEMStorageUnderUncertainty/NEMStorageUnderUncertainty/src/simulation_utils.jl:114
.
NEMStorageUnderUncertainty.run_perfect_foresight
— Methodrun_perfect_foresight(
optimizer::MathOptInterface.OptimizerWithAttributes,
storage::NEMStorageUnderUncertainty.StorageDevice,
actual_data::NEMStorageUnderUncertainty.ActualData,
formulation::NEMStorageUnderUncertainty.StorageModelFormulation,
degradation::NEMStorageUnderUncertainty.DegradationModel;
silent,
time_limit_sec,
string_names
) -> Any
Summary
Runs a perfect foresight model across the period of an ActualData
instance.
Perfect foresight entails:
- Perfect knowledge of future price (hence use of actual price data)
- Complete horizon lookahead
Arguments
optimizer
: A solver optimizerstorage
:StorageDevice
actual_data
:ActualData
formulation
: A model formulation (StorageModelFormulation
)degradation
: A degradation model (DegradationModel
)silent
: defaultfalse
.true
to suppress solver outputtime_limit_sec
: defaultnothing
.Float64
to impose solver time limit in secondsstring_names
: defaulttrue
.false
to disable JuMP string names
Returns
Simulation results for the one binding decision point (i.e. at start of simulation period)
Methods
run_perfect_foresight(
optimizer,
storage,
actual_data,
formulation,
degradation;
silent,
time_limit_sec,
string_names
)
defined at /home/runner/work/NEMStorageUnderUncertainty/NEMStorageUnderUncertainty/src/simulation_utils.jl:68
.