Solving an operation with StorageSystemSimulations
Originally Contributed by: Jose Daniel Lara
Introduction
Load Packages
using PowerSystems
using PowerSimulations
using StorageSystemsSimulations
using PowerSystemCaseBuilder
using HiGHS # solver
Data
PowerSystemCaseBuilder.jl
is a helper library that makes it easier to reproduce examples in the documentation and tutorials. Normally you would pass your local files to create the system data instead of calling the function build_system
. For more details visit PowerSystemCaseBuilder Documentation
c_sys5_bat = build_system(
PSITestSystems,
"c_sys5_bat_ems";
add_single_time_series=true,
add_reserves=true,
)
orcd = get_component(ReserveDemandCurve, c_sys5_bat, "ORDC1")
set_available!(orcd, false)
false
batt = get_component(EnergyReservoirStorage, c_sys5_bat, "Bat2")
operation_cost = get_operation_cost(batt)
StorageCost:
charge_variable_cost: CostCurve:
value_curve: LinearCurve (a type of InputOutputCurve) where function is: f(x) = 0.0 x + 0.0
power_units: UnitSystem.NATURAL_UNITS = 2
vom_cost: LinearCurve (a type of InputOutputCurve) where function is: f(x) = 0.0 x + 0.0
discharge_variable_cost: CostCurve:
value_curve: LinearCurve (a type of InputOutputCurve) where function is: f(x) = 0.0 x + 0.0
power_units: UnitSystem.NATURAL_UNITS = 2
vom_cost: LinearCurve (a type of InputOutputCurve) where function is: f(x) = 0.0 x + 0.0
fixed: 0.0
start_up: 0.0
shut_down: 0.0
energy_shortage_cost: 50.0
energy_surplus_cost: 40.0
template_uc = ProblemTemplate(PTDFPowerModel)
set_device_model!(template_uc, ThermalStandard, ThermalStandardUnitCommitment)
set_device_model!(template_uc, RenewableDispatch, RenewableFullDispatch)
set_device_model!(template_uc, PowerLoad, StaticPowerLoad)
set_device_model!(template_uc, Line, StaticBranch)
storage_model = DeviceModel(
EnergyReservoirStorage,
StorageDispatchWithReserves;
attributes=Dict(
"reservation" => true,
"energy_target" => false,
"cycling_limits" => false,
"regulatization" => true,
),
)
set_device_model!(template_uc, storage_model)
set_service_model!(template_uc, ServiceModel(VariableReserve{ReserveUp}, RangeReserve))
set_service_model!(template_uc, ServiceModel(VariableReserve{ReserveDown}, RangeReserve))