BCS-Tool

‹ All software
Open source · GPL-3.0 · Python

BCS-Tool

Size battery storage for an entire industrial park in seconds. Give it a year of net-load data and get the optimal capacity, dispatch schedule and annual savings, plus payback period, NPV and IRR.

Linear programmingGurobiFlask web appTime-of-use & demand chargesMulti-site sizing
BCS-Tool web interface showing parameter settings, economic metrics and time-series charts
8.6 sto size a full year of 15-min data, the same optimum a MILP reaches in 116.8 s
13.6×faster than the MILP formulation, single-thread
4.56 yrpayback for PV + storage in a real industrial park case
20.6%internal rate of return in the same case

Why BCS-Tool

Battery sizing studies usually rely on mixed-integer models that are slow, or on rule-based control that leaves savings on the table. BCS-Tool solves sizing and year-round dispatch together as one linear program.

Fast, exact optimum

No binary variables. The pure LP reaches the same capacity as the MILP benchmark, about 13.6 times faster.

Sizing and dispatch together

Capacity and every time step of charging and discharging are optimized at once, so the result reflects the best possible operation.

Investment-ready metrics

Reports annual savings, payback period, NPV and IRR, with the battery cost annualized over the project life.

Real tariffs

Hourly time-of-use prices or seasonal peak, high, flat and valley tiers, plus monthly or daily demand charges and export credits.

Multi-site allocation

Split one storage budget across several sub-plots, each with its own meter and load, in a single joint optimization.

Python API and web interface

Script batch studies and sensitivity analyses in Python. A Flask browser interface with charts is included in the repository.

How it works

  1. Bring your dataA CSV of net load (building load minus PV) with a timestamp column. One full year at 15-min to 1-h resolution is recommended.
  2. Set the economicsBattery cost, efficiencies, state-of-charge limits, power ratio, tariff, demand charge, export price ratio, discount rate and project life.
  3. OptimizeThe LP returns the optimal capacity, the full charging schedule, grid import and export, and the financial indicators.
BCS-Tool framework: data access, LP formulation and solving, optimal capacity and sensitivity analysis
The BCS-Tool framework, from data access and LP formulation to optimal capacity and sensitivity analysis.

Proven on a real industrial park

Four sub-plots and 59 enterprises in Changsha, China, with one year of 15-min smart-meter load data and 2.1 MW of simulated rooftop and facade PV.

ResultValue
Optimal storage, sized per sub-plot (one-part / two-part tariff)16,359 / 11,373 kWh
Payback, storage only, every sub-plotwithin 3.6 years
Whole park with PV + storage, 10 MWh budget (one-part tariff)4.56 yr payback · 20.63% IRR
Solve time, LP vs. MILP (single-thread)8.60 s vs. 116.80 s
Capacity suggested by rule-based sizing for comparison (one-part tariff)5,959 kWh

Get started

Python 3.8 or later and a Gurobi license (free for academic use) are required.

Install
# 1. Clone and install
git clone https://github.com/huziqi/BCS-Tool.git
cd BCS-Tool
pip install -e .
pip install matplotlib numpy-financial flask flask-cors

# 2. Activate your Gurobi license: https://www.gurobi.com/academia/
Python API
from pvbat_optimizer import PVBatOptimizer_linearProg, OptimizerConfig, OptimizerUtils

# CSV: first column is a timestamp, second is net load in kW
net_load = OptimizerUtils.net_profiles("net_load.csv")

config = OptimizerConfig(
    battery_cost_per_kwh=1000,        # CNY/kWh
    use_seasonal_prices=True,        # peak / high / flat / valley tariff
    demand_charge_rate=33.8,
    years=15, discount_rate=0.12,
    decision_step=0.25,                # hours per time step (15-min data)
)

result = PVBatOptimizer_linearProg(config).optimize(net_load)
print(result["battery_capacity"], result["annual_savings"])

# Payback period, NPV and IRR
metrics = OptimizerUtils.calculate_economic_metrics(
    annual_savings=result["annual_savings"],
    project_lifetime=config.years,
    discount_rate=config.discount_rate,
    battery_construction_cost=result["battery_construction_cost"],
)
Multi-site
from pvbat_optimizer import MultiPlotOptimizer

loads = {"E13": load_e13, "E25": load_e25}   # pandas Series on the same time index
res = MultiPlotOptimizer(config, total_battery_capacity=10000).optimize_multi_plots(loads)
print(res["capacity_allocation"])
Web app
python app.py      # serves the interface at http://localhost:5000

Cite

Ziqi Hu, Parastoo Mohebi, Elence Xinzhu Chen, Xiaoguang Wang, Zhe Wang. BCS-Tool: An open-source web application for capacity sizing of battery energy storage systems. Building Simulation, 19(8): 2151–2168, 2026. doi:10.1007/s12273-026-1477-1

Figures reproduced from the open-access article under CC BY 4.0.