# Battery (Table-Based)

Tabulated battery model

**Libraries:**

Simscape /
Electrical /
Sources

Simscape /
Battery /
Cells

## Description

The Battery (Table-Based) block represents a high-fidelity battery model. The block calculates open-circuit voltage as a function of charge level and optional temperature using lookup tables and includes several modeling options:

Self-discharge

Battery fade

Charge dynamics

Calendar aging

**Note**

For all the table-based parameters, the Battery
(Table-Based) block supports linear interpolation only. For
extrapolation, set the **Extrapolation method for all tables**
parameter to either `Nearest`

,
`Linear`

, or `Error`

.

For rows and columns, it follows the row-column convention, whereas rows are indexed first and, subsequently, columns.

The plot shows a battery whose performance varies with temperature and state of charge changes, as typically found on a datasheet.

Use this block to parameterize batteries with complex open-circuit voltage behavior from datasheets or experimental results. For a simpler representation of a battery, see the Battery (Simscape Electrical) block.

The Battery (Table-Based) block has two optional ports that you can expose by setting the corresponding parameters. The extra physical signal port, **SOC**, outputs the internal state of charge. Use this functionality to change the load behavior as a function of state of charge, without the complexity of building a charge state estimator. To expose the **SOC** port, in the **Main** setting, set the **Expose SOC measurement port** parameter to `Yes`

.

To expose the thermal port, in the **Thermal** setting, set the **Thermal port** parameter to `Model`

. The thermal port represents the battery thermal mass.

You can also choose different built-in parameterizations for this block. For more information, see the Predefined Parameterization section.

The battery equivalent circuit is made up of the fundamental battery model, the self-discharge resistance *R _{SD}*, the charge dynamics model, and the series resistance

*R*.

_{0}### Battery Model

The block calculates the open-circuit voltage, or the voltage across the fundamental battery model by interpolation:

$${v}_{0}={v}_{0}(\text{SOC},T)$$

Where:

*v*is the open-circuit voltage of the battery. Specify the grid of lookup values using the_{0}**Open-circuit voltage, V0(SOC,T)**parameter if tabulating parameters over temperature, or**Open-circuit voltage, V0(SOC)**otherwise.`SOC`

is the ratio of current charge to nominal battery capacity specified in the**Cell capacity, AH**parameter along with the effects of the temperature dependent fade percentage change in cell capacity,*δ*, specified in the_{AH}(n, Tfade)**Percentage change in cell capacity, dAH(N, Tfade)**parameter. Specify the SOC breakpoints using the**Vector of state-of-charge values, SOC**parameter. The block estimates the nominal battery capacity based on the number of cycles and the temperature of the battery by interpolating the specified temperature dependent fade characteristic and the**Cell capacity, AH**parameter.`SOC`

represents the normalized data with respect to*q*._{nom}For the lookup-table based fade characteristic option,

$${q}_{nom}(T,n)=\left(1+\frac{{\delta}_{AH}(n,{T}_{fade})}{100}\right)*AH\text{\hspace{0.17em}}Ah.$$

For the equation-based fade characteristic option,

$${q}_{nom}(T,n)=\left(1+\frac{{\delta}_{AH}}{100}\sqrt{\frac{n}{N}}\right)*AH\text{\hspace{0.17em}}Ah.$$

Finally,

`SOC`

is obtained from the following equation.$$SOC(t)=\frac{1}{{q}_{nom}(T,n)}{\displaystyle \int \left(i(t)-\frac{{V}_{open}(T,n,t)}{{R}_{SD}(T,n)}\right)}dt$$

Where:

*q*is the cell capacity of the battery. Specify this value using the_{nom}**Cell capacity, AH**parameter.*N*is the reference number of discharge cycles over which you specify percent change of several battery parameters. Set this value using the**Number of discharge cycles, N**parameter.*n*is the present number of cycles of the battery.*δ*is the percentage change in cell capacity of the battery after_{AH}*N*discharge cycles.

*T*is the battery temperature. Specify the*T*breakpoints using the**Vector of temperatures, T**parameter if tabulating the parameters over temperature.

The block also models the series resistance *R _{0}* as a function of state of charge and optional temperature. Specify the grid of lookup values for the series resistance using the

**Terminal resistance, R0(SOC,T)**parameter if tabulating the parameters over temperature, or

**Terminal resistance, R0(SOC)**otherwise.

### Modeling Self-Discharge

When the battery terminals are open-circuit, it is still possible for internal currents to discharge the battery. This behavior is called self-discharge. To enable this effect, set the **Self-discharge** parameter to `Enabled`

.

The block models these internal currents with a temperature-dependent resistance *R _{SD}(T)* across the terminals of the fundamental battery model. You can specify the lookup values for this resistance using the

**Self-discharge resistance, Rleak(T)**parameter if tabulating the parameters over temperature, or

**Self-discharge resistance, Rleak**otherwise.

### Modeling Charge Dynamics

Batteries are not able to respond instantaneously to load changes. They require some time to achieve a steady-state. This time-varying property is a result of battery charge dynamics and is modeled using parallel RC sections in the equivalent circuit.

You can model battery charge dynamics using the **Charge dynamics** parameter:

`No dynamics`

— The equivalent circuit contains no parallel RC sections. There is no delay between terminal voltage and internal charging voltage of the battery.`One time-constant dynamics`

— The equivalent circuit contains one parallel RC section. Specify the time constant using the**First time constant, tau1(SOC,T)**parameter if tabulating parameters over temperature or**First time constant, tau1(SOC)**otherwise.`Two time-constant dynamics`

— The equivalent circuit contains two parallel RC sections. Specify the time constants using the**First time constant, tau1(SOC,T)**and**Second time constant, tau2(SOC,T)**parameters if tabulating parameters over temperature or**First time constant, tau1(SOC)**and**Second time constant, tau2(SOC)**otherwise.`Three time-constant dynamics`

— The equivalent circuit contains three parallel RC sections. Specify the time constants using the**First time constant, tau1(SOC,T)**,**Second time constant, tau2(SOC,T)**, and**Third time constant, tau3(SOC,T)**parameters if tabulating parameters over temperature or**First time constant, tau1(SOC)**,**Second time constant, tau2(SOC)**, and**Third time constant, tau3(SOC)**otherwise.`Four time-constant dynamics`

— The equivalent circuit contains four parallel RC sections. Specify the time constants using the**First time constant, tau1(SOC,T)**,**Second time constant, tau2(SOC,T)**,**Third time constant, tau3(SOC,T)**, and**Fourth time constant, tau4(SOC,T)**parameters if tabulating parameters over temperature or**First time constant, tau1(SOC)**,**Second time constant, tau2(SOC)**,**Third time constant, tau3(SOC)**, and**Fourth time constant, tau4(SOC)**otherwise.`Five time-constant dynamics`

— The equivalent circuit contains five parallel RC sections. Specify the time constants using the**First time constant, tau1(SOC,T)**,**Second time constant, tau2(SOC,T)**,**Third time constant, tau3(SOC,T)**,**Fourth time constant, tau4(SOC,T)**, and**Fifth time constant, tau5(SOC,T)**parameters if tabulating parameters over temperature or**First time constant, tau1(SOC)**,**Second time constant, tau2(SOC)**,**Third time constant, tau3(SOC)**,**Fourth time constant, tau4(SOC)**, and**Fifth time constant, tau5(SOC)**otherwise.

This diagram shows the equivalent circuit for the block configured with two time-constant dynamics.

In the diagram:

*R*and_{1}*R*are the parallel RC resistances. Specify these values with the_{2}**First polarization resistance, R1(SOC,T)**and**Second polarization resistance, R2(SOC,T)**parameters, respectively, if tabulating parameters over temperature or**First polarization resistance, R1(SOC)**and**Second polarization resistance, R2(SOC)**otherwise.*C*and_{1}*C*are the parallel RC capacitances. The time constant_{2}*τ*for each parallel section relates the*R*and*C*values using the relationship $$C=\tau /R$$. Specify*τ*for each section using the**First time constant, tau1(SOC,T)**and**Second time constant, tau2(SOC,T)**parameters, respectively, if tabulating parameters over temperature or**First time constant, tau1(SOC)**and**Second time constant, tau2(SOC)**otherwise.*R*is the series resistance. Specify this value with the_{0}**Terminal resistance, R0(SOC,T)**parameter if tabulating parameters over temperature or**Terminal resistance, R0(SOC)**otherwise.

### Modeling Battery Fade

Battery fade is the deterioration of battery performance over repeated charge and discharge cycles. When the **Fade characteristic** parameter is set to `Equations`

, the battery fade is modeled as follows.

The open-circuit voltage across the fundamental battery model fades proportionally with the number of discharge cycles *n*:

$${v}_{0,\text{fade}}={v}_{0}\left(1+\frac{{\delta}_{{v}_{0}}}{100}\frac{n}{N}\right)$$

Where *δ _{v0}* is the percent change in open-circuit voltage after

*N*discharge cycles. Specify

*δ*using the

_{v0}**Change in open-circuit voltage after N discharge cycles (%)**parameter.

The nominal charge, from which state of charge is calculated, fades with the square root of number of discharge cycles:

$${q}_{nom,\text{fade}}={q}_{nom}\left(1+\frac{{\delta}_{AH}}{100}\sqrt{\frac{n}{N}}\right)$$

All resistances in the battery model also fade with the square root of the number of discharge cycles:

$${R}_{i,\text{fade}}={R}_{i}\left(1+\frac{{\delta}_{{R}_{i}}}{100}\sqrt{\frac{n}{N}}\right)$$

Where:

*R*is the_{i}*i*^{th}resistance*δ*is the percent change in this resistance over_{Ri}*N*cycles

Depending on how you have configured the block, the resistances might include:

The series resistance — Specify the percent change over

*N*cycles using the**Change in terminal resistance after N discharge cycles (%)**parameter.The self-discharge resistance — Specify the percent change over

*N*cycles using the**Change in self-discharge resistance after N discharge cycles (%)**parameter.The first charge dynamics resistance — Specify the percent change over

*N*cycles using the**Change in first polarization resistance after N discharge cycles (%):**parameter.The second charge dynamics resistance — Specify the percent change over

*N*cycles using the**Change in second polarization resistance after N discharge cycles (%)**parameter.The third charge dynamics resistance — Specify the percent change over

*N*cycles using the**Change in third polarization resistance after N discharge cycles (%)**parameter.The fourth charge dynamics resistance — Specify the percent change over

*N*cycles using the**Change in fourth polarization resistance after N discharge cycles (%)**parameter.The fifth charge dynamics resistance — Specify the percent change over

*N*cycles using the**Change in fifth polarization resistance after N discharge cycles (%)**parameter.

**Note**

You can also model the battery fade characteristic by using lookup tables (temperature independent) or lookup tables (temperature dependent). Choosing any of these two options changes the blocks parameters accordingly. For more information, see the Fade parameters tab.

### Modeling Thermal Effects

The battery temperature is determined from a summation of all the ohmic losses included in the model:

$${M}_{th}\dot{T}={\displaystyle \sum _{i}{V}_{T,i}{}^{2}/{R}_{T,i}}$$

Where:

*M*_{th}is the battery thermal mass.*i*corresponds to the*i*^{th}ohmic loss contributor. Depending on how you have configured the block, the losses might include:The series resistance

The self-discharge resistance

The first charge dynamics segment

The second charge dynamics segment

The third charge dynamics segment

The fourth charge dynamics segment

The fifth charge dynamics segment

*V*is the voltage drop across resistor_{T,i}*i*.*R*is resistor_{T,i}*i*.

### Modeling Battery Aging

You can model the battery performance deterioration that occurs when the battery is not used. Calendar aging affects both the internal resistance and capacity. In particular, the resistance increase depends by various mechanisms such as the creation of Solid Electrolyte Interface (SEI) at both anode and cathode and the corrosion of the current collector. These processes mainly depends on the storage temperature, the storage state of charge, and time.

You can model the calendar aging in the Battery (Table-Based) block by setting the **Modeling option** parameter to:

`Equation-based`

`Tabulated: temperature`

`Tabulated: time and temperature`

**Note**

The Battery (Table-Based) block only applies the calendar aging
during initialization. When you set the **Internal resistance calendar
aging** or **Capacity calendar aging** parameters
to `Enabled`

, the block exposes the **Vector of
time intervals** parameter that represents the time the battery has
aged before the start of the simulation. Calendar aging during the simulation is
not covered with this option.

**Equation-based**

This equation defines the terminal resistance increase of the battery due to calendar aging:

$$\begin{array}{c}{\alpha}_{r}\left(T,{V}_{oc}\right)=\left(b{V}_{oc}-c\right){e}^{-\frac{qd}{kT}},\\ R={R}_{0}\left(1+{\displaystyle \sum _{i=1}^{i=n}{\alpha}_{r}\left({T}_{i},{V}_{oc}\right)\left({t}_{i}^{a}-{t}_{i-1}^{a}\right)}\right),\end{array}$$

where:

*V*is the_{oc}**Normalized open-circuit voltage during storage, V/Vnom**.*R*is the_{0}**Internal resistance**.*t*is the time sample derived from the_{i}**Vector of time intervals**parameter.*T*is derived from the_{i}**Vector of temperatures, T**parameter.*b*is the**Terminal resistance linear scaling for voltage, b**.*c*is the**Terminal resistance constant offset for voltage, c**.*d*is the**Terminal resistance temperature-dependent exponential increase, d**.*a*is the**Terminal resistance time exponent, a**.*q*is the electron's elementary charge, in C.*k*is the Boltzmann constant, in J/K.

This equation defines the capacity decrease of the battery due to calendar aging:

$$\begin{array}{l}{\alpha}_{c}\left(T,{V}_{oc}\right)=\left(b{V}_{oc}-c\right){e}^{-\frac{qd}{kT}},\\ C={C}_{0}\left(1-{\displaystyle \sum _{i=1}^{i=n}{\alpha}_{c}\left({T}_{i},{V}_{oc}\right)\left({t}_{i}^{a}-{t}_{i-1}^{a}\right)}\right),\end{array}$$

where:

*C*is the_{0}**initial capacity**.*b*is the**Capacity linear scaling for voltage, b**.*c*is the**Capacity constant offset for voltage, c**.*d*is the**Capacity temperature-dependent exponential increase, d**.*a*is the**Capacity time constant, a**.

If you set the **Storage condition** parameter to `Specify state-of-charge during storage`

, the block converts the state of charge during storage into normalized open-circuit voltage using the tabulated voltage **V _{0}** against the state of charge and the temperature during storage.

**Tabulated: temperature**

The aged terminal resistance is the product between the terminal resistance, *R _{0}(SOC,T)*, the percentage resistance increase,

*dR*, and the power law that describes the time dependence of the calendar aging:

_{0}$${R}_{0}(SOC,T;{t}_{\text{st}},{T}_{\text{st}})={R}_{\text{0}}(SOC,T)\left(1+{\displaystyle \sum _{i=1}^{n}\frac{d{R}_{0}({T}_{\text{st},i})}{100}\left(\frac{{t}^{\text{a}}{}_{\text{st},i}-{t}^{\text{a}}{}_{\text{st},i-1}}{{t}^{\text{a}}{}_{\text{st,m}}}\right)}\right),$$

where:

*T*is the battery temperature. Specify the*T*breakpoints using the**Vector of temperatures, T**parameter if tabulating the parameters over temperature.*T*is the_{st}**Vector of storage temperatures**.*t*and_{st,i}*t*are the time samples derived from the_{st,i-1}**Vector of time intervals**.*t*is assumed to be null._{0}*t*is the moment in time at which the resistance increase,_{st,m}*dR*, is measured._{0}

The same equation applies to the calculation of the aged battery capacity.

**Tabulated: time and temperature**

The aged terminal resistance is the product between the terminal resistance, *R _{0}(SOC,T)* and

*dR*:

_{0}$${R}_{0}(SOC,T;\Delta {t}_{\text{st}},{T}_{\text{st}})={R}_{0}(SOC,T)\left(1+{\displaystyle \sum _{i=1}^{n}\frac{d{R}_{0}(\Delta {t}_{\text{st},i},{T}_{\text{st},i})}{100}}\right).$$

The same equation applies to the calculation of the aged battery capacity.

### Predefined Parameterization

There are multiple available built-in parameterizations for the Battery (Table-Based) block.

This pre-parameterization data allows you to set up the block to represent components by specific suppliers. The parameterizations of these batteries match the discharge curves in the manufacturer data sheets. To load a predefined parameterization, double-click the Battery (Table-Based) block, click the **<click to select>** hyperlink of the **Selected part** parameter and, in the Block Parameterization Manager window, select the part you want to use from the list of available components.

The available pre-parameterized data model steady state electrical parameters of a lithium-ion battery. The **Open-circuit voltage, V0(SOC)**, **Terminal resistance, R0(SOC, T)**, **Cell capacity, AH**, **Percentage change in cell capacity, dAH**, and **Percentage change in Open-circuit voltage, dV0(N)** parameters are parameterized from characteristics curves in the manufacture datasheets. The change in series resistance with the battery cycle life, the thermal mass, and the dynamic RC network parameters are not parameterized. Instead, the net resistance of the RC network resistors is summed to the series resistance of the specific pre-parameterized data. If you need to fill the RC parameter data, subtract the net RC network resistance from the series resistance data.

The available data is parameterized for 1C discharge current for different temperatures up to the minimum terminal voltage in the datasheet. The data below the minimum terminal voltage is extrapolated. The **Open-circuit voltage, V0(SOC)** parameter is approximated to be temperature independent. At lower temperature, in the low SOC region, the terminal resistances are constant and equal to the value of the resistance at the minimum terminal voltage. This might lead to higher thermal losses.

**Note**

The predefined parameterizations of Simscape™ components use available data sources for the parameter values. Engineering judgement and simplifying assumptions are used to fill in for missing data. As a result, expect deviations between simulated and actual physical behavior. To ensure accuracy, validate the simulated behavior against experimental data and refine component models as necessary.

For more information about pre-parameterization and for a list of the available components, see List of Pre-Parameterized Components (Simscape Electrical).

### Plotting Voltage-Charge Characteristics

A quick plot feature lets you visualize the voltage-charge characteristic for the battery model parameter values. To plot the characteristics, right-click a Battery (Table-Based) block in your model and, from the context menu, select **Electrical** > **Basic characteristics**. The software automatically computes a set of bias conditions, based on the block parameter values, and opens a figure window containing a plot of open-circuit voltage versus the state-of-charge (SOC) for the block. For more information, see Plot Basic Characteristics for Battery Blocks (Simscape Electrical).

## Examples

## Ports

### Output

### Conserving

## Parameters

## Extended Capabilities

## Version History

**Introduced in R2018a**