--- jupytext: text_representation: extension: .md format_name: myst format_version: 0.13 jupytext_version: 1.13.8 kernelspec: display_name: 'Python 3' name: python3 --- (battery)= # battery A battery that is a part of a power system. | | | |---|---| |Input connections|{ref}`reserve_group`, {ref}`busbar`| |Output connections|{ref}`busbar`, {ref}`reserve_group`| |License|SHOP_OPEN| |Release version|15.2.0.0| ```{contents} :local: :depth: 1 ``` ## Introduction A battery can be used to temporarily store energy in a power system. The battery can charge and discharge power where the power losses are given by the [charge efficiency](battery:charge_efficiency) $\eta_c$ and [discharge efficiency](battery:discharge_efficiency) $\eta_d$. The battery energy balance is ```{math} :label: energy-balance e_{i,t+1} = e_{i,t} + \eta_c pc_{i,t} - \frac{1}{\eta_d} pd_{i,t}, ``` where $e_{i,t}$ expresses the [initial energy](battery:initial_energy) in battery $i$ at the beginning of time step $t$, and $pc_{i,t}$, $pd_{i,t}$ the power charge and discharge respectively. The charge and discharge power is limited by the [maximum charge power](battery:max_charge_power) $PC_i$ ```{math} :label: max-charge 0 \leq pc_{i,t} \leq PC_{i} ``` and the [maximum discharge power](battery:max_discharge_power) $PD_i$ ```{math} :label: max-discharge 0 \leq pd_{i,t} \leq PD_{i}. ``` ## Connection Batteries can be connected to [busbars](busbar) if used in combination with [](ac_line) and/or [](dc_line). If busbars are not created explicitly, a copper plate representation is used where all sources and loads are connected to the same point. ## MIP The battery net-discharge curve is discontinuous. Therefore, batteries are typically modelled with separate charge and discharge variables. This is, in reality, a relaxation that allows simultaneous charging and discharging. This will typically not occur simply since it is not optimal to waste energy. However, in situations with surplus renewable generation or negative electricity price, the optimization might exploit this relaxation. This can be avoided by using mixed-integer programming and is activated with the [](battery:charge_discharge_mip) attribute. Given the binary variable $\delta_{i,t}$ which takes the value 0 when charging and 1 when discharging, the additional restrictions will ensure that charging and discharging does not occur simultaneously: ```{math} :label: mip-charge pc_{i,t} \leq PC_{i} (1-\delta_{i,t} ) ``` ```{math} :label: mip-discharge pd_{i,t} \leq PD_{i} \delta_{i,t} ``` ## Schedules Schedules for batteries can be given as both [charge](battery:charge_schedule), [discharge](battery:discharge_schedule), [net-discharge](battery:net_discharge_schedule), [minimum energy](battery:min_energy_constraint) and [maximum energy](battery:max_energy_constraint). Net-discharge represents discharge minus charge. All series can take the special value $nan$ to deactivate the schedule at a given time step. ## Operating costs The battery can also have a fixed [charge cost](battery:charge_cost) and [discharge cost](battery:discharge_cost), typically associated with degradation. ## Results The results show the battery [charge](battery:power_charge), [discharge](battery:power_discharge) and [net discharge](battery:net_power_discharge). Net discharge will always represent the difference between discharge and charge. However, the charge and discharge are also useful quantities as they can reveal situations where simultaneous charging and discharging occurs. These situations will also issue a warning. The battery state-of-charge is shown in by the [energy](battery:energy) attribute, and the dual value of the energy balance is given by the [energy value](battery:energy_value). ## Examples - [](battery-wind-solar) - [](battery_reserves) ## References - Optimal microgrid operation considering battery degradation using stochastic dual dynamic programming {cite}`Aaslid2019b` - Non-linear charge-based battery storage optimization model with bi-variate cubic spline constraints {cite}`Aaslid2020` - Pricing electricity in constrained networks dominated by stochastic renewable generation and electric energy storage {cite}`Aaslid2021` - Stochastic Optimization of Microgrid Operation With Renewable Generation and Energy Storages {cite}`Aaslid2022a` - Stochastic operation of energy constrained microgrids considering battery degradation {cite}`Aaslid2022b` - Operating a Battery in a Hydropower-Dominated System to Balance Net Load Deviations {cite}`Naversen2019` ## Attributes ```{code-cell} ipython3 :tags: ['remove-input', 'full-width'] from IPython.core.display import HTML HTML("""
""") ``` (battery:charge_efficiency)= ### charge_efficiency Charge efficiency coefficient. (xUnit: NO_UNIT, yUnit: NO_UNIT) (battery:discharge_efficiency)= ### discharge_efficiency Discharge efficiency coefficient. (xUnit: NO_UNIT, yUnit: NO_UNIT) (battery:max_charge_power)= ### max_charge_power Maximum charge power. (xUnit: MW, yUnit: MW) (battery:max_discharge_power)= ### max_discharge_power Maximum discharge power. (xUnit: MW, yUnit: MW) (battery:max_energy)= ### max_energy Maximum energy storage capacity. (xUnit: MWH, yUnit: MWH) (battery:initial_energy)= ### initial_energy Initial energy storage. (xUnit: MWH, yUnit: MWH) (battery:discharge_cost)= ### discharge_cost Battery discharge cost. (xUnit: NOK/MWH, yUnit: NOK/MWH) (battery:charge_cost)= ### charge_cost Battery charge cost. (xUnit: NOK/MWH, yUnit: NOK/MWH) (battery:max_charge_power_constraint)= ### max_charge_power_constraint Maximum charge power constraint. (xUnit: MW, yUnit: MW) (battery:max_discharge_power_constraint)= ### max_discharge_power_constraint Maximum discharge power constraint. (xUnit: MW, yUnit: MW) (battery:max_energy_constraint)= ### max_energy_constraint Maximum energy storage constraint. (xUnit: MWH, yUnit: MWH) (battery:min_energy_constraint)= ### min_energy_constraint Minimum energy storage constraint. (xUnit: MWH, yUnit: MWH) (battery:charge_discharge_mip)= ### charge_discharge_mip MIP variable to prevent simultaneous charging and discharging. (xUnit: NO_UNIT, yUnit: NO_UNIT) (battery:charge_schedule)= ### charge_schedule Battery charging schedule. (xUnit: MW, yUnit: MW) (battery:discharge_schedule)= ### discharge_schedule Battery discharging schedule. (xUnit: MW, yUnit: MW) (battery:net_discharge_schedule)= ### net_discharge_schedule Battery net-discharging schedule. (xUnit: MW, yUnit: MW) (battery:fcr_n_up_cost)= ### fcr_n_up_cost The cost of allocating fcr_n_up on this battery (xUnit: NO_UNIT, yUnit: NOK/MW) (battery:fcr_n_down_cost)= ### fcr_n_down_cost The cost of allocating fcr_n_down on this battery (xUnit: NO_UNIT, yUnit: NOK/MW) (battery:fcr_d_up_cost)= ### fcr_d_up_cost The cost of allocating fcr_d_up on this battery (xUnit: NO_UNIT, yUnit: NOK/MW) (battery:fcr_d_down_cost)= ### fcr_d_down_cost The cost of allocating fcr_d_down on this battery (xUnit: NO_UNIT, yUnit: NOK/MW) (battery:frr_up_cost)= ### frr_up_cost The cost of allocating frr_up on this battery (xUnit: NO_UNIT, yUnit: NOK/MW) (battery:frr_down_cost)= ### frr_down_cost The cost of allocating frr_down on this battery (xUnit: NO_UNIT, yUnit: NOK/MW) (battery:rr_up_cost)= ### rr_up_cost The cost of allocating rr_up on this battery (xUnit: NO_UNIT, yUnit: NOK/MW) (battery:rr_down_cost)= ### rr_down_cost The cost of allocating rr_down on this battery (xUnit: NO_UNIT, yUnit: NOK/MW) (battery:power_charge)= ### power_charge Power charged from battery. (xUnit: MW, yUnit: MW) (battery:power_discharge)= ### power_discharge Power discharged from battery. (xUnit: MW, yUnit: MW) (battery:net_power_discharge)= ### net_power_discharge Net power discharged from battery. (xUnit: MW, yUnit: MW) (battery:energy)= ### energy Energy stored in battery. (xUnit: MWH, yUnit: MWH) (battery:energy_value)= ### energy_value Battery energy dual value. (xUnit: NOK/MWH, yUnit: NOK/MWH) (battery:fcr_n_up_delivery)= ### fcr_n_up_delivery Resulting battery fcr_n_up delivery (xUnit: NO_UNIT, yUnit: MW) (battery:fcr_n_down_delivery)= ### fcr_n_down_delivery Resulting battery fcr_n_down delivery (xUnit: NO_UNIT, yUnit: MW) (battery:fcr_d_up_delivery)= ### fcr_d_up_delivery Resulting battery fcr_d_up delivery (xUnit: NO_UNIT, yUnit: MW) (battery:fcr_d_down_delivery)= ### fcr_d_down_delivery Resulting battery fcr_d_down delivery (xUnit: NO_UNIT, yUnit: MW) (battery:frr_up_delivery)= ### frr_up_delivery Resulting battery frr_up delivery (xUnit: NO_UNIT, yUnit: MW) (battery:frr_down_delivery)= ### frr_down_delivery Resulting battery frr_down delivery (xUnit: NO_UNIT, yUnit: MW) (battery:rr_up_delivery)= ### rr_up_delivery Resulting battery rr_up delivery (xUnit: NO_UNIT, yUnit: MW) (battery:rr_down_delivery)= ### rr_down_delivery Resulting battery rr_down delivery (xUnit: NO_UNIT, yUnit: MW)