
You really need to track energy in and energy out.The state-of-charge (SOC) describes the amount of energy left in BESS [12], [13]. SOC is not a physical quantity that can be measured directly. The SOC can only be estimated by measuring strongly correlated proxy quantities such as voltage, current, and temperature [14] and is usually expressed in a percentage in relation to the rated capacity. In the literature, SOC is defined as the ratio of the available amount of charge to the maximum amount of charge of the battery [15].
Equation (1) shows the mathematical definition of SOC.
SOC = Qavailable/Qrated
Despite the straightforward SOC definition expressed in (1), the accurate estimation of SOC for LIB is extremely non-trivial. The reason behind this is because of the rated capacity, Qrated which does not reflect the true capacity of the battery as suggested by battery manufacturers