Case Study:
Optimal Use of Battery Storage in Combination with a Small Solar PV
Below is an example of XanhTerra's analysis on optimizing the use of a Battery Energy Storage System (BESS) to reduce the electricity costs (under the new EVN Trial Tariffs) for a 22-kV connected factory with a solar PV system. The solar PV can be a (fairly large) rooftop solar system that is connected behind the meter. The battery is also connected behind the meter, allowing the battery to charged either from the grid or from the solar PV.
In this example, we are not considering the cost of the installation of solar PV or the BESS system, but rather how to use the battery to optimize its operation to reduce costs.
Background
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)
Factory Characterization
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.

  • If you are an manufacturing entity …
  • Do you have your 30 min load data? For how many years? Do you know where to get the data from, if you don't have it?
  • What is your consumption across TOU categories?
Back to Top
Baseline Factory Cost of Electricity
(EVN Trial Tariffs)
The EVN Trial Tariffs based on the time-of-use (TOU) periods for this 22-kV connected factory are:
  • Standard: 1,275 VND/kWh
  • Off-Peak: 859 VND/kWh
  • Peak: 2,182 VND/kWh
  • Demand charge: 235,414 VND/kW for the maximum average peak demand per month.
For this factory, the total annual electricity charges are:
  • TOU energy costs: 88.158 Billion VND ($3.459 M)
  • Demand charges: 40.758 Billion VND ($1.598 M)
  • Total Cost: 128.916 Billion VND ($5.057 M)
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.

  • If you are an manufacturing entity in Vietnam…
  • Have you already estimated your demand charges going forward?
  • Do you have a plan to reduce your monthly peak demand?
Solar PV Characterization
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.
Like what you see here? Talk us to at contact@xanhterra.com
Factory Cost of Electricity with Solar PV only
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:
  • TOU energy costs: 59.232 Billion VND ($3.459 M) — 32.8% savings relative to Baseline
  • Demand charges: 28.887 Billion VND ($1.133 M) — 29.1% savings relative to Baseline
  • Total Cost: 88.119 Billion VND ($3.456 M) 31.7% savings relative to Baseline
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.
BESS Characterization
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.
Like what you see here? Talk us to at contact@xanhterra.com
Optimized BESS Charging & Discharging
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.
Like what you see here? Talk us to at contact@xanhterra.com
Factory Cost with Solar PV & BESS
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:
Insights
  • Scenario with optimized BESS reduces total annual cost by 39.59% vs grid-only (Savings = 51,033,041,163.75 VND, about $2 Million USD) and by 11.59% vs solar-only (Savings = 10,306,088,117.43 VND, about $400,000).
  • Savings of about $400,000 with the battery is not sufficient to justify the installation of battery of 30 MWh for this factory. Need to test lower capacity batteries to identify the cost vs. saving tradeoff.
  • Degradation cost is non-negligible: annual degradation cost ≈ 3.12 billion VND, about $122,000 USD.
  • Prioritize BESS dispatch strategies that reduce monthly peak interval grid draws — maintain reserve to shave identified monthly peaks
  • Integrate degradation-aware control: incorporate degradation factors in real-time dispatch to avoid unnecessary cycling during low TOU-cost periods; evaluate trade-off between additional savings vs additional degradation cost monthly.

  • If you have a BESS already with your Solar PV…
  • How do you use your BESS?
  • Have you discussed with your BESS and Solar PV provider(s) on how to operate the BESS to reduce peak demand?
Like what you see here? Talk us to at contact@xanhterra.com
Next Steps/Questions
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…

  • What should be smallest battery size that still result in lower cost for the factory?
  • How would changes in the degradation factor impact the results?
  • How much would results change if the load shape of the factory was mostly flat?
  • What would be the size of the battery if we consider a large solar PV under a DPPA mechanism?
Stay Tuned…
Reach out to us with any questions or comments at contact@xanhterra.com