Skip to content
You Start with one site
Amounts in Start with one site
Control, Measurement & Energy · Course

Batteries: State of Charge and Cycle Life

Lesson 6 of 10 26 min read
Found this useful?

The display said 60 percent at sunset, and at four in the morning the security lights went out. Or the battery that was sold “for ten years” holds half of its energy after four. In both cases the owner trusted one number on a screen and did not know how it was made. A battery is the most expensive part of a solar system for each kWh, and it is the part that is most often misread. This lesson shows what a battery stores, how its state of charge is known, and what decides how long it lives. #BatteryStorage #StateOfCharge #CycleLife

Learning Objectives

By the end of this lesson, you will be able to:

  1. Convert between capacity in Ah and energy in kWh, and express a current as a C-rate
  2. Explain how state of charge is found by counting charge, why the count drifts, and why voltage is a poor gauge for a flat curve
  3. Calculate the state of charge of a battery through a day from an energy balance, with the unmet load and the spilled solar energy
  4. Calculate the lifetime energy of a battery and the cost of each kWh stored from a cycle life curve and a price
  5. Describe what temperature, round-trip efficiency and the battery management system do

Real-World System Problem: The battery of the workshop



The site of this course has one battery of lithium iron phosphate cells: 51.2 V nominal and 300 Ah. It is charged by the array of 9.9 kWp through a hybrid inverter of 8 kW, and it carries the evening work and the night. The battery is used between 10 and 90 percent state of charge. These values are an example typical of this class of battery. For real equipment, the maker’s data sheet decides.

The load is 30 kWh a day, and 11 kWh of it falls between 18:30 and 06:30. The usable energy of the battery is a little above 12 kWh. On paper the night fits. Whether it fits on a real day depends on when the array stops covering the load, on the losses in each direction, and on the state in which the battery starts the evening.

The owner sees none of this. The owner sees a percentage. So the questions of this lesson are practical. Where does that percentage come from? How low does it go on a clear day? And what does each kWh that passes through the battery cost, when the battery is counted as something that wears out?

Array9.9 kWpLoad30 kWha dayBattery51.2 V 300 Ahwith its BMSHybridinverter8 kWdischargecharge
The battery in the system

Fundamental Theory: What a battery stores and what wears it



Ampere hours and kilowatt hours

A battery label gives a capacity in ampere hours (Ah). It is a quantity of charge: 300 Ah means 300 A for one hour, or 30 A for ten hours. Charge is what the cells really store, and it is what a current sensor can count.

A load uses energy, in kWh. The link is the voltage:

with in kWh, the capacity in Ah and the nominal voltage in volts. For the site battery, kWh. The 51.2 V comes from 16 cells in series, each with a nominal voltage of 3.2 V.

C-rate

The C-rate compares a current with the capacity. A current equal to the capacity number is 1 C, and it would empty a full battery in one hour.

The site battery allows 150 A continuously, which is C, or 7.68 kW at 51.2 V. The peak load of 6.5 kW takes kW from the battery through the inverter, which is 131 A or 0.44 C. A small battery behind a large inverter can hold enough energy and still be unable to give the power.

State of charge and depth of discharge

The state of charge (SoC) is the charge in the battery as a share of its capacity: 100 percent is full and 0 percent is empty. The depth of discharge (DoD) of a cycle is the share of the capacity that the cycle uses. A battery that moves between 90 and 10 percent has a depth of discharge of 80 percent.

The site battery is kept inside that window. Its usable energy is kWh.

notusednotusedused every day12.29 kWh of 15.36 kWh0 %10 %90 %100 %
The window of the site battery

Lead-acid and lithium iron phosphate

Two families of battery are common in solar systems. The table gives what is typical of each class. It is a guide for reading data sheets, and the data sheet of the real battery decides.

Lead-acidLithium iron phosphate
Nominal voltage of a cell2.0 V3.2 V
Usual depth of discharge in daily useabout 50 percent80 to 90 percent
Round-trip efficiencyabout 80 percentabove 90 percent
Left partly charged for weeksloses capacitynot harmed
Resting voltage against state of chargeslopesalmost flat
Mass for the same energyseveral times moreless
Electronics neededsimplea management system for each battery

A lead-acid battery costs less to buy for each kWh of nameplate. Because only about half of it is used in each cycle, and because it gives fewer cycles, the cost of each kWh that it delivers is often higher. The method of Application 2 makes that comparison for any two data sheets.

State of charge by counting charge

No instrument looks inside a cell and reads its state of charge. The usual method is to count, like a fuel gauge that counts the litres pumped in and out: a sensor measures the current into and out of the battery, and the monitor adds it up over time:

Coulomb counting

is the battery current in A, positive when charging, the capacity in Ah, and time is in hours. The method is called coulomb counting, after the unit of charge.

The count is exact only if the sensor is exact, and no sensor is. A small error of one sign is added at every moment of every day: a sensor that reads 0.2 A too high, on a battery whose currents reach more than 100 A, adds Ah a day, 1.6 percent of 300 Ah, and after 30 days the display is wrong by 48 percent.

The count also needs the capacity , which falls as the battery ages: a monitor that still divides by 300 Ah when the cells hold 250 Ah shows too high a value near empty.

So every monitor needs a point where it corrects itself: full charge, which the voltage shows clearly. A battery that reaches full charge on most days keeps an honest count; one that stays in the middle of its range for weeks does not.

Why voltage is a poor gauge

It seems simpler to read the voltage. A lead-acid battery at rest gives a rough reading, because its voltage falls steadily with the state of charge. Lithium iron phosphate does not: between about 20 and 80 percent the resting voltage of a cell changes by only a few hundredths of a volt, rising steeply only near full and falling steeply only near empty.

Vfull//flat part: the voltagesays almost nothingemptySoC0 %100 %
Resting voltage of a lithium iron phosphate cell (shape only)

A second problem: the terminal voltage moves with the current, sagging under load and rising on charge by more than the whole flat part of the curve. A reading taken while the battery works says more about the current than about the state of charge.

The flat curve is good for the load, which sees a steady voltage while the battery empties, and bad for the gauge. The owner in the first paragraph of this lesson was most likely looking at a count that had drifted.

Depth of discharge and cycle life

A battery does not fail on one day. It loses capacity a little with each cycle, and the usual end of life is the point where it holds 80 percent of its nameplate. The number of cycles to that point is the cycle life.

Deeper cycles wear the cells more. This course uses an assumed example curve for the site battery:

Depth of dischargeAssumed cycle life
50 percent10,000 cycles
80 percent6,000 cycles
100 percent3,500 cycles

Cycles are one of two clocks. The other is the calendar: cells age with time even when they rest, and faster when they are hot or kept full. A battery reaches its end by whichever clock finishes first.

Temperature

Cold reduces the capacity that a battery can deliver and the current that it can take. Lithium cells must not be charged when they are below freezing, because the charge damages them, and a management system blocks charging there. Heat does the opposite harm: the battery works well and ages fast. A battery room that is shaded and ventilated is part of the design.

Round-trip efficiency

A battery returns less energy than it receives. The round-trip efficiency is the energy taken out divided by the energy put in, over a cycle that ends at the same state of charge. For the site battery it is 0.92. This course splits the loss equally between charge and discharge, so each direction has the efficiency .

To take 1 kWh out, kWh must be put in. The missing 8 percent becomes heat in the cells.

The battery management system

A lithium battery always comes with a battery management system (BMS). It measures the voltage of every cell, the current and several temperatures; keeps the cells in balance, so that no cell is full before the others; reports the state of charge to the inverter; and opens the circuit if a cell voltage, the current or a temperature leaves its limits.

The BMS is a protection that acts in milliseconds, inside the battery, without any connection to anything else. The inverter is set so that the BMS never has to act: the charge limit, the discharge limit and the state of charge window are settings of normal operation, with the BMS behind them.

Application 1: The site battery through one day



Step 1: Check the load and the battery

Click to reveal the calculation
  1. Daily energy. Each block is its power multiplied by its hours. The sum is 30.00 kWh. ✅

  2. Night energy. From 18:30 to 06:30: kWh. ✅

  3. Peak. 6.50 kW, from 11:00 to 11:30. ✅

  4. What the battery can deliver. The window holds 12.288 kWh. After the loss on discharge the battery delivers kWh of direct current. ✅

  5. The night alone. The night load takes kWh of direct current. That is below 11.79 kWh, so the night alone fits. ✅

Step 2: Find the real night of the battery

Click to reveal the calculation
  1. When the array covers the load. The array power rises from zero at 06:30. It first exceeds the load at 07:20, and it falls below the load again at 16:40. Between 16:40 and 07:20 the battery must help. ✅

  2. The shortage outside the night. From 16:40 to 18:30 the load takes 1.60 kW of direct current and the array gives less and less. The shortage in that time is 1.91 kWh. From 06:30 to 07:20 it is 0.18 kWh. ✅

  3. The whole shortage.

    ✅

  4. Against the battery. The battery can deliver 11.79 kWh. It is short by kWh of direct current (the script keeps more digits), which is kWh at the load. ✅

Step 3: The state of charge through the clear day

Click to reveal the result
  1. Run the balance. The script gives the state of charge at each step. Some points of the day:

    ClockArray (kW)Load as direct current (kW)SoC (percent)
    00:000.000.5222.8
    03:400.000.5210.0
    07:200.330.3110.0
    10:004.461.3428.2
    11:006.046.7042.8
    11:306.603.6141.4
    13:056.910.7290.0
    16:401.511.6090.0
    18:300.001.8077.0
    22:300.000.5228.0

    ✅

  2. The lowest point. The battery reaches its lower limit of 10 percent at 03:40 and stays there until the array covers the load at 07:20. In that time the load of about 0.5 kW is unmet by the solar system: 1.60 kWh, which is 5.3 percent of the day’s load. ✅

  3. The start of the evening. At sunset, 18:30, the battery is already down to 77.0 percent. It has given 13 percent of its capacity before the night began. ✅

  4. The peak at 11:00. For half an hour the load takes 6.70 kW and the array gives 6.04 to 6.60 kW. The battery gives the difference, and its state of charge falls from 42.8 to 41.4 percent in the middle of a clear morning. ✅

  5. The afternoon. The battery is full at 13:05. From then until 16:40 the array could give more than the load takes, and there is nowhere to put it. ✅

SoC90 %50 %10 %h03:407:20 13:0516:4024
State of charge on the clear day (not to scale)

Step 4: Energy through the battery, and two other days

Click to reveal the result
  1. Clear day. The array gives 42.47 kWh. The battery takes in 13.03 kWh and gives out 11.99 kWh, so 1.04 kWh is lost in it. The energy spilled is 12.15 kWh, which is 29 percent of what the array gave. ✅

  2. Cycle. The state of charge swings over the full 80 percent. With the small discharge at 11:00, the cells give 0.81 of a full cycle in the day. ✅

  3. Worst month, 4.5 peak sun hours. The array gives 34.75 kWh. The battery still fills, at 14:10. The unmet load is 1.83 kWh and 4.61 kWh is spilled. ✅

  4. Cloudy day. With cloud=1.0 the day has 3.114 kWh/m² and the array gives 24.05 kWh. The battery never fills: its highest point is 57.1 percent, and it is empty before midnight. The unmet load is 7.57 kWh, one quarter of the load, and nothing is spilled. ✅

  5. A larger battery. With 350 Ah in place of 300 Ah the clear day has no unmet load, and the lowest state of charge is 11.8 percent. ✅

Step 5: Check the balance

Click to reveal the check
  1. Energy in and out. The load served takes kWh of direct current.

    This equals the energy from the array. Nothing is lost from the count. ✅

  2. Efficiency. The battery gives out of what it takes in, the stated round-trip efficiency. ✅

  3. Currents. The largest charge current of the day is 119 A and the largest discharge current is 35 A, both inside the limit of 150 A. ✅

  4. Two methods. The unmet load from the shortage in Step 2 and from the step by step balance is the same 1.60 kWh. ✅

Application 2: Lifetime energy and the cost of a stored kWh



Step 1: Lifetime energy by cycles only

Click to reveal the calculation
  1. Price. currency units. ✅

  2. Energy of one cycle. Depth of discharge multiplied by 15.36 kWh: 7.68, 12.29 and 15.36 kWh. ✅

  3. Lifetime energy and cost.

    DoDCycleskWh a cycleLifetime kWhCost per kWhYears at one cycle a day
    50 percent10,0007.6876,8006.0027.4
    80 percent6,00012.2973,7286.2516.4
    100 percent3,50015.3653,7608.579.6

    ✅

  4. Read the table. By cycles alone, the shallow cycle gives the most energy and the lowest cost. The full cycle gives 30 percent less energy than the shallow one. ✅

Step 2: The calendar

Click to reveal the calculation
  1. Cycles that fit in the calendar. In 15 years at one cycle a day there are cycles. ✅

  2. At 50 percent. The battery would need 27.4 years to use its 10,000 cycles. It uses only 5,475.

    ✅

  3. At 80 percent. 6,000 cycles need 16.4 years, so the calendar ends first here too, but only just. kWh, and the cost is 6.85 currency units per kWh. ✅

  4. At 100 percent. The cycles end first, after 9.6 years. The cost stays 8.57 currency units per kWh. ✅

  5. Compare. With both clocks counted, the order changes: 80 percent is the cheapest at 6.85, then 100 percent at 8.57, then 50 percent at 10.96. ✅

Step 3: Check with the same daily energy

Click to reveal the check
  1. Three batteries for one task. To give 12.29 kWh every day, a battery cycled at 50 percent must have 24.58 kWh of nameplate, at 80 percent 15.36 kWh, and at 100 percent 12.29 kWh. Their prices are 737,280, 460,800 and 368,640 currency units. ✅

  2. Cost of each kWh. The first two last 15 years and give kWh. The costs are and . The third lasts 3,500 days and gives 43,008 kWh, at . The three costs agree with Step 2. ✅

  3. With the charging energy. If the battery is charged with energy worth 22 currency units per kWh, each kWh taken out needs of energy. With the wear at 80 percent the stored kWh costs currency units. ✅

Verify It in Python



The script holds the irradiance generator of the course and the load of the site as a function. It checks the load, runs the day balance for three days, prints the check by hand, shows the drift of a charge count, and calculates the lifetime energy and the cost of storage. It saves a plot of the clear day and of the state of charge on the three days.

battery_day.py
"""One day of the site battery at 5-minute steps, and the cost of each kWh it stores."""
import numpy as np
import matplotlib.pyplot as plt
def daily_irradiance(day=0, seed=5, step_min=5, psh=5.5, cloud=0.0):
"""Plane-of-array irradiance (W/m2) through one day near the equator.
Clear shape: sine squared between 06:30 and 18:30 scaled to `psh` peak sun hours.
`cloud` between 0 and 1 adds passing cloud. Returns hours, irradiance."""
rng = np.random.default_rng(seed + day)
h = np.arange(0, 24, step_min / 60.0)
x = np.clip((h - 6.5) / 12.0, 0, 1)
g = np.sin(np.pi * x) ** 2
g = g * psh / (g.sum() * step_min / 60.0) * 1000.0
if cloud > 0:
k = np.ones_like(h)
for _ in range(int(12 * cloud)):
c = rng.uniform(7, 18); w = rng.uniform(0.1, 0.6)
k *= 1 - 0.6 * np.exp(-0.5 * ((h - c) / w) ** 2)
g = g * k
return h, g
LOAD_EDGES = [0.0, 6.5, 8.0, 8.5, 10.5, 11.0, 11.5, 12.0, 13.0, 14.0, 16.5, 18.5, 22.5, 24.0]
LOAD_KW = [0.50, 0.30, 0.90, 1.30, 4.30, 6.50, 3.50, 1.30, 0.70, 1.30, 1.55, 1.75, 0.50]
def load_kw(h):
"""AC load (kW) of the site at clock hour h (0 to 24): constant in each block."""
i = np.searchsorted(LOAD_EDGES, np.asarray(h) + 1e-9, side="right") - 1
return np.array(LOAD_KW)[i]
KWP, PR_DC, ETA_INV = 9.9, 0.78, 0.97
V_NOM, AH, ETA_RT, I_MAX = 51.2, 300.0, 0.92, 150.0
E_NOM = V_NOM * AH / 1000.0 # kWh
E_LO, E_HI = 0.10 * E_NOM, 0.90 * E_NOM
ETA_ONE = np.sqrt(ETA_RT) # charge and discharge taken as equal
P_MAX = V_NOM * I_MAX / 1000.0 # kW at the battery terminals
DT = 5.0 / 60.0
def clock(x):
"""Clock time as text from an hour number."""
m = int(round(x * 60))
return f"{m // 60:02d}:{m % 60:02d}"
def run_day(g, load, kwp=KWP, e_nom=E_NOM, days=30):
"""Repeat the same day until it starts and ends at the same state of charge.
Returns the SoC trace and the day's energies (kWh)."""
pv = kwp * g / 1000.0 * PR_DC # kW of direct current from the array
need = load / ETA_INV # kW of direct current that the load takes
lo, hi = 0.10 * e_nom, 0.90 * e_nom
e = 0.5 * e_nom
for _ in range(days):
soc = np.zeros(len(g))
p_bat = np.zeros(len(g)) # kW at the terminals, plus is charging
charged = discharged = spilled = unmet = 0.0
for k in range(len(g)):
net = pv[k] - need[k]
if net >= 0:
p = min(net, P_MAX, (hi - e) / (ETA_ONE * DT))
e += p * ETA_ONE * DT
charged += p * DT
spilled += (net - p) * DT
p_bat[k] = p
else:
p = min(-net, P_MAX, (e - lo) * ETA_ONE / DT)
e -= p / ETA_ONE * DT
discharged += p * DT
unmet += (-net - p) * ETA_INV * DT
p_bat[k] = -p
soc[k] = e / e_nom
return soc, dict(pv=pv.sum() * DT, p_bat=p_bat, charged=charged, discharged=discharged,
spilled=spilled, unmet=unmet)
h, g = daily_irradiance()
load = load_kw(h)
night = (h + 1e-9 < 6.5) | (h + 1e-9 >= 18.5)
# ---------- The battery and the load shape ----------
print("The battery")
print(f" {AH:.0f} Ah x {V_NOM} V = {E_NOM:.2f} kWh; used from 10 % to 90 %: "
f"{E_HI - E_LO:.3f} kWh")
print(f" {I_MAX:.0f} A is {I_MAX / AH:.2f} C and {P_MAX:.2f} kW; "
f"one-way efficiency {ETA_ONE:.4f}")
print(f" the 6.5 kW peak takes {6.5 / ETA_INV:.2f} kW of direct current, "
f"{6.5 / ETA_INV * 1000 / V_NOM:.0f} A, {6.5 / ETA_INV * 1000 / V_NOM / AH:.2f} C")
print("The load shape")
print(f" total {load.sum() * DT:.2f} kWh, between 18:30 and 06:30 "
f"{load[night].sum() * DT:.2f} kWh, peak {load.max():.2f} kW")
# ---------- Application 1: one day ----------
cases = (("clear day, 5.5 peak sun hours", daily_irradiance()[1]),
("worst month, 4.5 peak sun hours", daily_irradiance(psh=4.5)[1]),
("cloudy day, cloud=1.0", daily_irradiance(cloud=1.0)[1]))
print("Application 1: the day balance (kWh)")
results = {}
for name, gg in cases:
soc, r = run_day(gg, load)
results[name] = soc
kmin, kmax = soc.argmin(), soc.argmax()
print(f" {name}: sun {gg.sum() * DT / 1000:.3f} kWh/m2, array {r['pv']:.2f}")
print(f" into the battery {r['charged']:.2f}, out of it {r['discharged']:.2f}, "
f"spilled {r['spilled']:.2f}, unmet load {r['unmet']:.2f}")
print(f" SoC at midnight {100 * soc[-1]:.1f} %, lowest {100 * soc.min():.1f} % at "
f"{clock(h[kmin] + DT)}, highest {100 * soc.max():.1f} %, "
f"first reached at {clock(h[kmax] + DT)}")
print(f" swing {100 * (soc.max() - soc.min()):.1f} % of capacity, "
f"{r['discharged'] / ETA_ONE / E_NOM:.2f} of a full cycle")
soc, r = run_day(g, load)
pv = KWP * g / 1000.0 * PR_DC
need = load / ETA_INV
short = np.clip(need - pv, 0, None) # kW that the array does not cover
k_on = np.argmax(pv >= need)
k_off = len(h) - 1 - np.argmax((pv >= need)[::-1])
eve = (h > 12) & ~night
morn = (h < 12) & ~night & (np.arange(len(h)) < k_on)
print(" clear day, check by hand")
print(f" array peak {pv.max():.2f} kW; it first covers the load at {clock(h[k_on])} "
f"and last covers it until {clock(h[k_off + 1])}")
print(f" not covered by the array: evening before 18:30 {short[eve].sum() * DT:.2f}, "
f"night {short[night].sum() * DT:.2f}, morning after 06:30 {short[morn].sum() * DT:.2f}, "
f"total {(short[eve | night | morn]).sum() * DT:.2f}")
print(f" the battery can deliver {(E_HI - E_LO):.3f} x {ETA_ONE:.4f} = "
f"{(E_HI - E_LO) * ETA_ONE:.2f}; short by "
f"{short[eve | night | morn].sum() * DT - (E_HI - E_LO) * ETA_ONE:.2f} as direct current, "
f"{(short[eve | night | morn].sum() * DT - (E_HI - E_LO) * ETA_ONE) * ETA_INV:.2f} at the load")
print(f" night alone: {load[night].sum() * DT:.0f} / {ETA_INV} / {ETA_ONE:.4f} = "
f"{load[night].sum() * DT / ETA_INV / ETA_ONE:.2f} from the cells, "
f"{100 * load[night].sum() * DT / ETA_INV / ETA_ONE / E_NOM:.1f} % of capacity")
print(f" balance: array {r['pv']:.2f} = load served {need.sum() * DT - r['unmet'] / ETA_INV:.2f} "
f"+ battery loss {r['charged'] - r['discharged']:.2f} + spilled {r['spilled']:.2f}")
print(" clock array kW load kW (DC) SoC % at that time")
for t in ("00:00", "03:40", "06:30", "07:20", "10:00", "10:30", "11:00", "11:30", "12:00",
"13:05", "16:40", "18:30", "22:30"):
k = (int(t[:2]) * 60 + int(t[3:])) // 5
print(f" {t} {pv[k]:7.2f} {need[k]:9.2f} {100 * soc[k - 1]:10.1f}")
for ah in (300, 350, 400):
s2, r2 = run_day(g, load, e_nom=V_NOM * ah / 1000.0)
print(f" with {ah} Ah: unmet load {r2['unmet']:.2f}, spilled {r2['spilled']:.2f}, "
f"lowest SoC {100 * s2.min():.1f} %")
# ---------- Coulomb counting with a small sensor error ----------
amps = r["p_bat"] * 1000.0 / V_NOM # A at the terminals, plus is charging
OFFSET = 0.2 # A, a stated sensor error
print("Coulomb counting")
print(f" largest current of the clear day: {amps.max():.0f} A charging at "
f"{clock(h[amps.argmax()])}, {-amps.min():.0f} A discharging at {clock(h[amps.argmin()])}")
print(f" a sensor that reads {OFFSET} A too high adds {OFFSET * 24:.1f} Ah a day: "
f"{100 * OFFSET * 24 / AH:.1f} % of SoC a day, {100 * OFFSET * 24 * 30 / AH:.0f} % in 30 days")
# ---------- Application 2: lifetime energy and cost of storage ----------
PRICE_PER_KWH, CAL_YEARS = 30000.0, 15.0 # stated assumptions
price = PRICE_PER_KWH * E_NOM
print("Application 2: lifetime energy and cost of each kWh stored")
print(f" battery price {price:,.0f} currency units ({PRICE_PER_KWH:,.0f} per kWh of nameplate)")
print(" DoD cycles kWh a cycle lifetime kWh cost per kWh years at one cycle a day")
for dod, cycles in ((0.5, 10000), (0.8, 6000), (1.0, 3500)):
per = dod * E_NOM
life = per * cycles
print(f" {100 * dod:3.0f} % {cycles:6d} {per:9.2f} {life:12,.0f} {price / life:10.2f} "
f"{cycles / 365:10.1f}")
print(f" with a calendar life of {CAL_YEARS:.0f} years and one cycle a day:")
for dod, cycles in ((0.5, 10000), (0.8, 6000), (1.0, 3500)):
used = min(cycles, CAL_YEARS * 365)
life = dod * E_NOM * used
print(f" {100 * dod:3.0f} % {used:6.0f} cycles used {life:8,.0f} kWh "
f"{price / life:6.2f} per kWh battery for 12.29 kWh a day: "
f"{0.8 * E_NOM / dod:5.2f} kWh, {PRICE_PER_KWH * 0.8 * E_NOM / dod:9,.0f}")
c80 = price / (0.8 * E_NOM * min(6000, CAL_YEARS * 365))
print(f" energy lost in the round trip: {100 * (1 / ETA_RT - 1):.1f} % more must be put in; "
f"with charging energy at 22 per kWh that adds {22 * (1 / ETA_RT - 1):.2f} per kWh")
print(f" stored grid energy at 80 % DoD costs 22 / {ETA_RT} + {c80:.2f} = "
f"{22 / ETA_RT + c80:.2f} per kWh")
# ---------- Plot ----------
fig, ax = plt.subplots(2, 1, figsize=(8, 8), sharex=True)
ax[0].plot(h, pv, label="array, direct current (kW)")
ax[0].step(h, need, where="post", label="load, as direct current (kW)")
ax[0].set_ylabel("power (kW)")
ax[0].set_title("Clear day: array and load")
ax[0].legend()
for name, s in results.items():
ax[1].plot(h, 100 * s, label=name)
ax[1].axhline(10, color="gray", lw=0.8)
ax[1].axhline(90, color="gray", lw=0.8)
ax[1].set_xlabel("hour of the day")
ax[1].set_ylabel("state of charge (%)")
ax[1].set_title("Battery state of charge, repeated day")
ax[1].legend()
fig.tight_layout()
fig.savefig("battery_day.png", dpi=120)
print("Saved battery_day.png")

Expected output

The battery
300 Ah x 51.2 V = 15.36 kWh; used from 10 % to 90 %: 12.288 kWh
150 A is 0.50 C and 7.68 kW; one-way efficiency 0.9592
the 6.5 kW peak takes 6.70 kW of direct current, 131 A, 0.44 C
The load shape
total 30.00 kWh, between 18:30 and 06:30 11.00 kWh, peak 6.50 kW
Application 1: the day balance (kWh)
clear day, 5.5 peak sun hours: sun 5.500 kWh/m2, array 42.47
into the battery 13.03, out of it 11.99, spilled 12.15, unmet load 1.60
SoC at midnight 22.8 %, lowest 10.0 % at 03:40, highest 90.0 %, first reached at 13:05
swing 80.0 % of capacity, 0.81 of a full cycle
worst month, 4.5 peak sun hours: sun 4.500 kWh/m2, array 34.75
into the battery 13.67, out of it 12.58, spilled 4.61, unmet load 1.83
SoC at midnight 21.3 %, lowest 10.0 % at 03:15, highest 90.0 %, first reached at 14:10
swing 80.0 % of capacity, 0.85 of a full cycle
cloudy day, cloud=1.0: sun 3.114 kWh/m2, array 24.05
into the battery 11.58, out of it 10.65, spilled 0.00, unmet load 7.57
SoC at midnight 10.0 %, lowest 10.0 % at 00:05, highest 57.1 %, first reached at 15:45
swing 47.1 % of capacity, 0.72 of a full cycle
clear day, check by hand
array peak 7.08 kW; it first covers the load at 07:20 and last covers it until 16:40
not covered by the array: evening before 18:30 1.91, night 11.34, morning after 06:30 0.18, total 13.43
the battery can deliver 12.288 x 0.9592 = 11.79; short by 1.65 as direct current, 1.60 at the load
night alone: 11 / 0.97 / 0.9592 = 11.82 from the cells, 77.0 % of capacity
balance: array 42.47 = load served 29.28 + battery loss 1.04 + spilled 12.15
clock array kW load kW (DC) SoC % at that time
00:00 0.00 0.52 22.8
03:40 0.00 0.52 10.0
06:30 0.00 0.31 10.0
07:20 0.33 0.31 10.0
10:00 4.46 1.34 28.2
10:30 5.31 4.43 39.1
11:00 6.04 6.70 42.8
11:30 6.60 3.61 41.4
12:00 6.96 1.34 51.3
13:05 6.91 0.72 90.0
16:40 1.51 1.60 90.0
18:30 0.00 1.80 77.0
22:30 0.00 0.52 28.0
with 300 Ah: unmet load 1.60, spilled 12.15, lowest SoC 10.0 %
with 350 Ah: unmet load 0.00, spilled 10.36, lowest SoC 11.8 %
with 400 Ah: unmet load 0.00, spilled 10.36, lowest SoC 21.6 %
Coulomb counting
largest current of the clear day: 119 A charging at 13:00, 35 A discharging at 18:30
a sensor that reads 0.2 A too high adds 4.8 Ah a day: 1.6 % of SoC a day, 48 % in 30 days
Application 2: lifetime energy and cost of each kWh stored
battery price 460,800 currency units (30,000 per kWh of nameplate)
DoD cycles kWh a cycle lifetime kWh cost per kWh years at one cycle a day
50 % 10000 7.68 76,800 6.00 27.4
80 % 6000 12.29 73,728 6.25 16.4
100 % 3500 15.36 53,760 8.57 9.6
with a calendar life of 15 years and one cycle a day:
50 % 5475 cycles used 42,048 kWh 10.96 per kWh battery for 12.29 kWh a day: 24.58 kWh, 737,280
80 % 5475 cycles used 67,277 kWh 6.85 per kWh battery for 12.29 kWh a day: 15.36 kWh, 460,800
100 % 3500 cycles used 53,760 kWh 8.57 per kWh battery for 12.29 kWh a day: 12.29 kWh, 368,640
energy lost in the round trip: 8.7 % more must be put in; with charging energy at 22 per kWh that adds 1.91 per kWh
stored grid energy at 80 % DoD costs 22 / 0.92 + 6.85 = 30.76 per kWh
Saved battery_day.png

Common Mistakes



  • Comparing batteries by Ah without the voltage. Energy is Ah multiplied by volts.
  • Taking the nameplate energy as usable energy. The window of state of charge, the loss on discharge and the inverter loss all come off it. Of the 15.36 kWh of the site battery, 11.43 kWh reaches the load in one cycle.
  • Reading the state of charge of a lithium iron phosphate battery from its voltage. The curve is flat in the middle, and the voltage moves more with the current than with the charge.
  • Trusting a charge count that has not seen a full charge for weeks. The count drifts, and only a full charge corrects it.
  • Sizing the battery for the hours of darkness. The battery starts to discharge when the array stops covering the load, which is before sunset.
  • Reading a cycle life figure without its depth of discharge and its conditions, or reading it as a promise. And forgetting the calendar: a battery that is cycled very gently can grow old before it has given its energy.

Summary



  • Capacity in Ah multiplied by the nominal voltage gives energy: 300 Ah at 51.2 V is 15.36 kWh, of which 12.29 kWh is used between 10 and 90 percent.
  • State of charge is found by counting the current. The count drifts, by 1.6 percent a day for a sensor error of 0.2 A, and it is corrected at full charge. Voltage is a poor gauge for the flat curve of lithium iron phosphate.
  • On a clear day of the course, the site battery is full at 13:05, starts to discharge at 16:40 and reaches its lower limit at 03:40. The unmet load is 1.60 kWh and 12.15 kWh of solar energy is spilled.
  • On the assumed example curve and a stated price, the wear of the battery costs 6.00 to 8.57 currency units for each kWh by cycles alone, and 6.85 at 80 percent depth of discharge when a calendar life of 15 years is counted.
  • A battery has two clocks, cycles and years, and a good design uses both.
  • The BMS protects the cells locally. The settings of the inverter keep the battery inside its limits in normal operation.

Exercises



1. A battery has a capacity of 200 Ah and a nominal voltage of 25.6 V. It is used between 20 and 100 percent state of charge. Find its nameplate energy and its usable energy.

Answer

kWh. Usable: kWh.

2. A battery of 280 Ah is discharged at 100 A. Find the C-rate and the time from full to empty at that current.

Answer

C. The time is hours.

3. A monitor counts charge on a battery of 200 Ah. The state of charge is 80 percent. The battery is then discharged at 30 A for 2.5 hours and charged at 20 A for 1 hour. Find the state of charge that the monitor shows.

Answer

Discharge: Ah, which is 37.5 percent. Charge: Ah, which is 10 percent. percent.

4. A battery has a round-trip efficiency of 0.85. A site takes 6 kWh from it every night. How much energy must be put into the battery each day?

Answer

kWh. The difference of 1.06 kWh is lost as heat.

5. The current sensor of a battery of 300 Ah reads 0.5 A too low. The battery does not reach full charge for 10 days. How far is the displayed state of charge from the true one?

Answer

Ah, which is 40 percent of 300 Ah. The display is 40 points below the true state of charge.

6. A battery of 10 kWh costs 280,000 currency units. Its data sheet gives 4,000 cycles at 80 percent depth of discharge, and its calendar life is taken as 10 years. It makes one cycle a day at 80 percent. Find the cost of each kWh stored by cycles alone and with the calendar life.

Answer

By cycles: kWh, so currency units per kWh. In 10 years there are 3,650 cycles, fewer than 4,000, so the calendar ends first: kWh and currency units per kWh.

References



  • D. Linden and T. B. Reddy (editors), Handbook of Batteries, 3rd edition, McGraw-Hill, 2002.
  • G. M. Masters, Renewable and Efficient Electric Power Systems, 2nd edition, Wiley, 2013.
  • R. A. Messenger and A. Abtahi, Photovoltaic Systems Engineering, 4th edition, CRC Press, 2017.


© 2021-2026 SiliconWit®. All rights reserved.
Predict first

A workshop uses 11 kWh between sunset and sunrise. Its battery can deliver 11.8 kWh, and on a clear day it is full soon after 13:00. Does the battery carry the load until the morning?

See it: one day of the battery

Array energy
Unmet load
Spilled solar energy
Lowest state of charge
Battery full
Cycles used in the day

The figure runs the day balance of this lesson at 5-minute steps, and at the start it has the lesson's values: a battery of 300 Ah at 51.2 V, 18 modules of 550 W, a clear day of 5.5 peak sun hours and the load table of the site. The array feeds the load first. A surplus charges the battery up to 90 percent and the rest is spilled. A shortage is taken from the battery down to 10 percent and the rest is unmet load, for the grid or the generator. Both power lines are in kW of direct current: the array after the factor 0.78, and the load divided by the inverter efficiency of 0.97. The battery has a one-way efficiency of 0.9592 and a power limit of 7.68 kW for every size. The day is a clear day without cloud, and it is repeated until the state of charge at midnight repeats. The shaded hours are 18:30 to 06:30, and the night load slider multiplies the load in those hours only. Clock times are the end of a 5-minute step. All values are an example, and the data sheet of real equipment decides.

Check yourself

Three questions. Each wrong choice is a mistake people really make, so read the note after you answer.

1. On the clear day the battery of 300 Ah leaves 1.60 kWh of load unmet. The battery is changed to 350 Ah at the same voltage and with the same limits. What happens to the unmet load?

2. In the worst month the array gives 34.75 kWh in the day in place of 42.47 kWh, which is 7.72 kWh less. Where does most of that loss appear?

3. At sunset, 18:30, the battery of 15.36 kWh is at 77.0 percent. Its lower limit is 10 percent and its one-way efficiency is 0.9592. The load needs 11.34 kWh of direct current before 06:30. Can the battery deliver it?

300 Ah300 Ah at 12.8 Vat 51.2 V 3.84 kWh15.36 kWh Compare kWh, not Ah.
never full: 48 % wrong after 30 days full most days: reset, under 1.6 % error of the display30 daysday 0
Watch it build: a charge count and its drift
300Ah I Σ I·dt SoC The counter adds everyamp in and out, hourby hour: Ah in the battery. 480 30 dayserror, percent 0.2 A too high:+1.6 % a day 25 %true 10 % cells: 250 Ah,count: 300 Ah 100 %reset at full full every day:under 1.6 %
  1. A sensor on the battery cable measures the current; the monitor adds it up: charge in, charge out.
  2. A sensor 0.2 A too high adds 4.8 Ah a day: 1.6 percent a day, 48 percent after 30 days.
  3. Aged cells hold 250 Ah, the count divides by 300: the display shows 25 % when 10 % is left.
  4. At full charge the voltage is clear and the count resets. Full every day keeps the error under 1.6 %.
Array 9.9 kWp Hybrid inverter 8 kW Load 30 kWh a day Battery 51.2 V, 300 Ah with its BMS charge discharge
The battery in the system
0 % 10 % 90 % 100 % not used not used used every day 12.29 kWh of 15.36 kWh depth of discharge 80 %: 0.80 × 15.36 = 12.29 kWh
The window of the site battery
0 % 20 % 50 % 80 % 100 % state of charge, % resting voltage of a cell flat part: the voltage says almost nothing a few hundredths of a volt from 20 to 80 % empty full
Resting voltage of a lithium iron phosphate cell (example shape)
Found this useful?

Discussion

    Comments show your name. Be kind, stay on the topic.