# SOE Estimator (Energy Counting)

**Libraries:**

Simscape /
Battery /
BMS /
Estimators

## Description

The SOE Estimator (Energy Counting) block implements an estimator that calculates the state of energy (SOE) of a battery by using the energy counting method.

The SOE is the ratio of the remaining energy
*E*_{remain} to the total energy
*E*_{total}:

$$SOE=\frac{{E}_{\text{remain}}}{{E}_{\text{total}}}.$$

This block supports single-precision and double-precision floating-point simulation.

**Note**

To enable single-precision floating-point simulation, the data type of all inputs and
parameters, except for the **Sample time (-1 for inherited)**
parameter, must be `single`

.

You can switch between continuous and discrete implementations of the block by using
the **Sample time (-1 for inherited)** parameter. To configure the
block for continuous time, set the **Sample time (-1 for
inherited)** parameter to `0`

. To configure the block for
discrete time, set the **Sample time (-1 for inherited)**
parameter to a positive, nonzero value, or to `-1`

to inherit the
sample time from an upstream block.

**Note**

Continuous-time implementation of this block works only in a double-precision floating-point simulation. If you provide single-precision floating-point parameters and inputs, this block casts them to double-precision floating-point values to prevent errors.

This diagram shows the structure of the block:

### Equations

To compute the SOE of the battery, the SOE Estimator (Energy Counting) block uses this equation:

$$SOE=SOE\left({t}_{0}\right)+\frac{1}{{E}_{\text{nom}}}{\displaystyle \underset{0}{\overset{t}{\int}}{V}_{\text{t}}(t)i(t)dt}$$

where *V*_{t} is the
terminal voltage, *i* is the current, and
*E*_{nom} is the battery nominal energy
capacity in watt-hour.

## Ports

### Input

### Output

## Parameters

## References

[1] Yujie Wang, Chenbin Zhang,
Zonghai Chen. *Model-based State-of-energy Estimation of Lithium-ion Batteries
in Electric Vehicles.* Energy Procedia, Volume 88, 2016, Pages 998-1004.

## Extended Capabilities

## Version History

**Introduced in R2023b**