

Vietnam's Commercial and Industrial (C&I) sector is considering the use of BESS to reduce the cost of electricity purchased from the grid.
The use of behind-the-meter Solar PV systems are already allowing industries to lower their costs by reducing their grid consumption. However, these Solar PV systems are yet not optimized to reduce to costs.
A BESS connected behind the meter to the solar system allows for it be charged not only from the grid (during off-peak periods), but also from the solar PV, which reduces the curtailment of solar PV and the reduction of the demand charges from the EVN Trial Tariffs.
Our analysis below shows how it is possible to do so…
The study is divided into several sections
The sections below also include some of the prompts and XanhTerra's Agentic AI outputs, as well as the insights derived from the analysis (a joint AI + human endeavor)
Let's assume that this illustrative factory is fairly large, connected at 22 kV level, in Southern Vietnam, with annual energy consumption of about 63.252 GWh.
The Daily consumption peaks are mostly between 6,000 to 7,000 kWh, and the factory does not operate on Sundays. The load pattern on a daily basis are shown below, along with a heat map of the load by 30-min intervals averaged over the months.


The EVN Trial Tariffs based on the time-of-use (TOU) periods for this 22-kV connected factory are:
For this factory, the total annual electricity charges are:
The VND to USD exchange rate is 25,500.
The breakdown of energy and demand charges by month are shown below.

The monthly highest peak demand, which is maximum average power consumption at any 30-min interval, is below. The peak demand mostly varies between 14 and 15 MW, and the average monthly demand is about 3.4 Billion VND.

Now, for the Solar PV system connected to the factory and the BESS, behind the meter.
Let's assume that this is a fairly significant, but relatively small, Solar PV system, with the total annual energy about 1/3 of the factory demand — 20.249 GWh, compared to the factory's 63.252 GWh. Assuming a 14% capacity factor, this amounts to 16.5 MW of Solar PV connected to the factory.
A heat map of the solar generation (same scale as the factory) is shown below.

A simple solar PV offset, without BESS, would result in a "Net Utility Draw" as shown the graph below, and it shows the Solar PV, effectively "flattens" the factory load, resulting in the usual duck curve. In February, the "duck" is stronger due to Tet.

Rather than a heat map, one can also assess how the factory demand and solar generation offset each other on a daily basis, and also on a hourly basis (for a two week periods in April and November).



There is curtailment of solar during some days, particularly during Sundays and Holidays, see graph below. The overall curtailment of solar is about 780 MWh (3.85%).
Clearly, this already shows the value of BESS to prevent the curtailment of solar generation.

Overall, the grid supply to the factory with the solar still has a lot of variations, and fairly high peak demand values, although it is less than without a solar PV system.

The Solar PV reduces the overall demand of the factory, and hence reduces the grid supply to the factory. There is now a reduction in both the TOU energy cost, and also the demand charges, as shown below
The total annual electricity charges for the factory with Solar PV only are:
The VND to USD exchange rate is 25,500.
This is already significant savings. However, the cost of solar generation is NOT included here yet. Assuming a capital investment of $600/kW, the simple straight line payback period is 6.2 years.
In other words, if the Solar PV is a Self Production - Self Consumption PV system, then after about 6 years, the factory gains all of the 30% savings!
Energy and peak demand charges and the breakdown of the peak demand charges are shown below.


In this example, a 30 MWh battery is connected to the Solar PV system, allowing the battery to charge from the grid and also from Solar PV. Below are the characteristics of the BESS system.
The optimization Objective Function is:

XanhTerra’s AI model uses the linprog optimization function from the SciPy Python toolkit.
XanhTerra's Agentic AI tool developed an optimization code (on its own) to develop an optimized dispatch for the battery, charging from both solar and the grid to lower the entire cost for the factory.
Below is the raw output for the hourly dispatch for one day.

Unlike the previous scenario which had a lot of variations, the grid supply is now capped at lower values because the BESS and solar are jointly limiting the power drawn from the grid to reduce not only the TOU energy costs, but also the demand charges.
The battery is being discharged not only during the peak times, but also during standard and off-peak periods if there is a need to lower the grid supply beyond a specified grid supply value.

Below are two examples of how the BESS is being used. In the first set of days, we see the battery being discharged and charged during standard (white) hours and off-peak hours (light green), in order to lower the grid supply to a specific value. In the second set of days, we see what we normally assume would happen, which is charging the battery at night time and discharging during peak periods.


During the entire operations, the energy storage in the BESS goes from 10% to 90%, as required. Mean SOC ≈ 11,454 kWh (38.18% of 30,000 kWh); battery cycles/day/month show substantial use (mean per-interval charge ≈207.65 kWh; discharge ≈188.05 kWh). The total battery cycles is about 115.

Solar curtailment is drastically reduced with the battery.

First, let's examine the demand charges. As the graph below shows, the monthly peak demand can now be optimized to reduce the total monthly demand charge. Peak demand reduces dramatically from ~7,028–7,409 kWh in the scenario with no solar or BESS to ~2,856–3,554 kWh, depending on month.

There are two components to the Energy cost now: the TOU cost from the grid supply and also battery degradation cost. The daily TOU cost and the degradation cost is shown below, and the total monthly cost of Energy and Demand costs are shown in the second graph.


A comparison of the full metrics across the three scenarios is shown below:

Now that we know that a BESS can play a major role in reducing factory costs, particularly the demand charges, here below are some additional questions to think about…
Case Study:
Optimal Use of Battery Storage in Combination with a Small Solar PV