# SOE Estimator (Energy Counting, Variable Energy Capacity)

State of energy estimator with energy counting and variable energy capacity

Since R2023b

Libraries:
Simscape / Battery / BMS / Estimators

## Description

The SOE Estimator (Energy Counting, Variable Capacity) block implements an estimator that calculates the state of energy (SOE) of a battery by using the energy counting method. The cell energy capacity of the battery is an input to the block.

The SOE is the ratio of the remaining energy Eremain to the total energy Etotal:

`$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, Variable Energy Capacity) block uses this equation:

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

where Vt is the terminal voltage, i is the current, and Enom is the battery nominal energy capacity in watt-hour.

## Ports

### Input

expand all

Battery current, in ampere, specified as a scalar for a single cell or a vector for multiple cells. To specify this input as a vector of cell currents, select the Specify Current input as cell current(s) parameter.

Battery voltage, in volt, specified as a scalar for a single cell or a vector for multiple cells.

Cell energy capacity of the battery, in watt-hour, specified as a strictly positive scalar.

Initial state of energy, specified as a scalar or vector of entries in the range [0, 1]. The size of this input port must be equal to the size of the Current input port.

### Output

expand all

State of energy of the battery, returned as a scalar or a vector. The size of this output port is equal to the size of the Current and InitialSOE input ports.

## Parameters

expand all

Option to specify the value of the Current input port as a vector of cell currents. If you select this parameter, the value at the Current input port can be a scalar or a vector of size equal to the size of the block inputs.

Time between consecutive block executions. During execution, the block produces outputs and, if appropriate, updates its internal state. For more information, see What Is Sample Time? and Specify Sample Time.

For inherited discrete-time operation, specify this parameter as `-1`. For discrete-time operation, specify this parameter as a positive integer. For continuous-time operation, specify this parameter as `0`.

If this block is in a masked subsystem or a variant subsystem that supports switching between continuous operation and discrete operation, promote the sample time parameter. Promoting the sample time parameter ensures correct switching between the continuous and discrete implementations of the block. For more information, see Promote Block Parameters on a Mask.

## 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.

## Version History

Introduced in R2023b