Skip to contents

Charging when there is surplus, discharging when there is deficit

Usage

add_battery_simple(df, Bcap, Bc, Bd, SOCmin = 0, SOCmax = 100, SOCini = 0)

Arguments

df

tibble, time-series tibble with columns datetime, production and consumption

Bcap

numeric, capacity of the battery

Bc

numeric, maximum charging power

Bd

numeric, maximum discharging power

SOCmin

numeric, minimum State-of-Charge of the battery

SOCmax

numeric, maximum State-of-Charge of the battery

SOCini

numeric, required State-of-Charge at the beginning of time-series

Value

numeric vector

Examples

library(dplyr)
df <- select(
  energy_profiles,
  "datetime",
  production = "solar",
  consumption = "building"
)

df_batt <- df %>%
  mutate(
    battery = add_battery_simple(df, Bcap = 100, Bc = 10, Bd = 10)
  )

df_batt %>% dygraphs::dygraph()