def add_battery(self,p_battery:float, t_battery:float) -> None:
"""
Add a battery to the system.
- p_battery: maximum power of the battery
- t_battery: total amount of time the battery can deliver power p.
"""
### ADD BATTERY ###
self.p_battery = p_battery
self.t_battery = t_battery
# Add battery
self.network.add("Store",
"Battery",
bus="BatteryBus",
e_nom = self.p_battery * t_battery)
# Charging link
self.network.add("Link",
"ControlToBatteryLink",
bus0="ControlBus",
bus1="BatteryBus",
p_nom=self.p_battery, #The maximum capacity of charge/discharge of the battery.
marginal_cost = self.storage_cost, #Add cost for storing energy, otherwise it stores for low prices.
efficiency = 0.95
)
# Discharging link;
self.network.add("Link",
"BatteryToControl",
bus0="BatteryBus",
bus1="ControlBus",
p_nom=self.p_battery, #The maximum capacity of charge/discharge of the battery.
marginal_cost = 0,
efficiency = 0.95
)