Recent attention to industrial peak shaving applications sparked an increased interest in battery energy storage. Batteries provide a fast and high power capability, making them an ideal solution for this task. This work proposes a general framework for sizing of battery energy storage system (BESS) in peak shaving applications. A cost-optimal sizing of the battery and power electronics is derived using linear programming based on local demand and billing scheme. A case study conducted with real-world industrial profiles shows the applicability of the approach as well as the return on investment dependence on the load profile. At the same time, the power flow optimization reveals the best storage operation patterns considering a trade-off between energy purchase, peak-power tariff, and battery aging. This underlines the need for a general mathematical optimization approach to efficiently tackle the challenge of peak shaving using an energy storage system. The case study also compares the applicability of yearly and monthly billing schemes, where the highest load of the year/month is the base for the price per kW. The results demonstrate that batteries in peak shaving applications can shorten the payback period when used for large industrial loads. They also show the impacts of peak shaving variation on the return of investment and battery aging of the system. Energies 2018, 11, 2048 2 of 22costs. The electricity charge can be discriminated in subcomponents like the generation cost, taxes, and fees which represent a small portion of the total electricity payment of the customers. Accordingly, commercial and industrial customers are interested in decreasing energy and power costs, which are the most significant part of the total charges, without lowering their energy consumption. In this context, energy storage systems (ESS) can be used to help customers flatten their demand profile by storing energy during off-peak periods and releasing it during peak load periods.The deployment of ESS can achieve another benefit besides the reduction of demand charges for customers. For instance, system operators can reduce the need of network reinforcement by sizing the infrastructure for a more flat profile coupled with ESS, instead of designing it for the highest power demand [3]. Depending on the market conditions, other benefits can be achieved. The customers can take advantage of time of use energy price [4] by discharging the ESS when the energy price at the peak load periods is more expensive than the price during the off-peak periods. This can lead to additional electricity bill reduction [5].Energy storage system technologies are used for a variety of applications [6,7]. They can be classified in many different ways, according to the application area [8], based on the energy conversion [9], or depending on the quantity of energy that the ESS can provide [10]. For "power-type" applications like peak shaving, the ESS have to maintain a constant delivery of power [11].Although the improvements of battery energy storage sys...