# Battery

Behavioral battery model

**Libraries:**

Simscape /
Electrical /
Sources

Simscape /
Battery /
Cells

## Description

The Battery block represents a simple battery model. You can also expose the charge output port and the thermal port of the battery.

To measure the internal charge level of the battery, in the **Main** section,
set the **Expose charge measurement port** to
`Yes`

. This action exposes an extra physical signal port
that outputs the internal state of charge. Use this functionality to change load
behavior as a function of state of charge, without the complexity of building a charge
state estimator.

To simulate the thermal effects of the battery, in the **Thermal Port**
section, set the **Thermal port** parameter to
`Model`

. This action exposes an extra thermal port, which
represents the battery thermal mass. When you select this option, provide additional
parameters to define battery behavior at a second temperature. For more information, see
Modeling Thermal Effects.

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

If you select `Infinite`

for the **Battery charge capacity** parameter, the block models the battery as a series resistor and a constant voltage source. If you select `Finite`

for the **Battery charge capacity** parameter, the block models the battery as a series resistor and a charge-dependent voltage source. In the finite case, the voltage is a function of charge and has the following relationship:

$$V={V}_{0}\left(\frac{\text{SOC}}{1-\beta (1-\text{SOC})}\right)$$

where:

`SOC`

(state-of-charge) is the ratio of current charge to rated battery capacity.*V*_{0}is the voltage when the battery is fully charged at no load, as defined by the**Nominal voltage, Vnom**parameter.*β*is a constant that is calculated so that the battery voltage is*V1*when the charge is*AH1*. Specify the voltage*V1*and cell capacity*AH1*using block parameters.*AH1*is the charge when the no-load (open-circuit) voltage is*V1*, and*V1*is less than the nominal voltage.

The equation defines an approximate relationship between voltage and remaining charge. This approximation replicates the increasing rate of voltage drop at low charge values, and ensures that the battery voltage becomes zero when the charge level is zero. The advantage of this model is that it requires few parameters, which are readily available on most datasheets.

### Modeling Battery Fade

For battery models with finite battery charge capacity, you can model battery performance deterioration depending on the number of discharge cycles. This deterioration is referred to as *battery fade*. To enable battery fade, set the **Battery fade** parameter to `Enabled`

. This setting exposes additional parameters in the **Fade** section.

The block implements battery fade by scaling certain battery parameter values that you specify in the **Main** section, depending on the number of completed discharge cycles. The block uses multipliers *λ*_{AH}, *λ*_{R0}, and *λ*_{V1} on the **Cell capacity (Ah rating)**, **Internal resistance**, and **Voltage V1 when charge is AH1** parameter values, respectively. These multipliers, in turn, depend on the number of discharge cycles:

$${\lambda}_{AH}=1-{k}_{1}{N}^{0.5}$$

$${\lambda}_{R0}=1+{k}_{2}{N}^{0.5}$$

$${\lambda}_{V1}=1-{k}_{3}N$$

$$N={N}_{0}+\frac{1}{AH}{\displaystyle \underset{0}{\overset{t}{\int}}\frac{i\left(t\right)\cdot H\left(i\left(t\right)\right)}{{\lambda}_{AH}\left(t\right)}dt}$$

where:

*λ*is the multiplier for battery nominal capacity._{AH}*λ*is the multiplier for battery series resistance._{R0}*λ*is the multiplier for voltage_{V1}*V1*.*N*is the number of discharge cycles completed.*N*is the number of full discharge cycles completed before the start of the simulation._{0}*AH*is the rated battery capacity in ampere-hours.*i(t)*is the instantaneous battery output current.*H(i(t))*is the Heaviside function of the instantaneous battery output current. This function returns 0 if the argument is negative, and 1 if the argument is positive.

**Note**

The Battery block tracks the current and
integrates it over time. The number of discharge cycles completed
*N* increases by 1 every time an equivalent cell discharge
capacity is extracted.

The block calculates the coefficients *k _{1}*,

*k*, and

_{2}*k*by substituting the parameter values you provide in the

_{3}**Fade**section into these battery equations. For example, the default set of block parameters corresponds to the following coefficient values:

*k*= 1e-2_{1}*k*= 1e-3_{2}*k*= 1e-3_{3}

You can also define a starting point for a simulation based on the previous charge-discharge history by using the high-priority variable **Discharge cycles**. For more information, see Variables (Simscape Electrical).

### Modeling Thermal Effects

If you set the **Thermal port** parameter to
`Model`

, you must provide additional parameters to define
battery behavior at a second temperature. The extended equations for the voltage
when you expose the thermal port are:

$$V={V}_{0T}\left(\frac{\text{SOC}}{1-{\beta}_{T}(1-\text{SOC})}\right)$$

$${V}_{0T}={V}_{0}\left(1+{\lambda}_{V}\left(T-{T}_{1}\right)\right)$$

where:

*T*is the battery temperature.*T*is the nominal measurement temperature._{1}*λ*is the parameter temperature dependence coefficient for_{V}*V*_{0}.$${\beta}_{T}=\beta \left[1+{\lambda}_{\beta}\left(T-{T}_{1}\right)\right].$$

*λ*is the parameter temperature dependence coefficient for_{β}*β*.*β*is calculated in the same way as Battery Model, using the temperature-modified nominal voltage*V*._{0T}

The internal series resistance, self-discharge resistance, and any charge-dynamic resistances are also functions of temperature:

$${R}_{T}=R\left(1+{\lambda}_{R}\left(T-{T}_{1}\right)\right)$$

where *λ _{R}* is the parameter temperature dependence coefficient.

All the temperature dependence coefficients are determined from the corresponding values you provide at the nominal and second measurement temperatures. If you include charge dynamics in the model, the time constants vary with temperature in the same way.

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*is the battery thermal mass._{th}*i*corresponds to the*i*th ohmic loss contributor. Depending on how you have configured the block, the losses include:Series resistance

Self-discharge resistance

First charge dynamics segment

Second charge dynamics segment

Third charge dynamics segment

Fourth charge dynamics segment

Fifth charge dynamics segment

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

### Modeling Charge Dynamics

You can model battery charge dynamics by 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**parameter.`Two time-constant dynamics`

— The equivalent circuit contains two parallel RC sections. Specify the time constants using the**First time constant**and**Second time constant**parameters.`Three time-constant dynamics`

— The equivalent circuit contains three parallel RC sections. Specify the time constants using the**First time constant**,**Second time constant**, and**Third time constant**parameters.`Four time-constant dynamics`

— The equivalent circuit contains four parallel RC sections. Specify the time constants using the**First time constant**,**Second time constant**,**Third time constant**, and**Fourth time constant**parameters.`Five time-constant dynamics`

— The equivalent circuit contains five parallel RC sections. Specify the time constants using the**First time constant**,**Second time constant**,**Third time constant**,**Fourth time constant**, and**Fifth time constant**parameters.

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

In the diagram:

*R*and_{RC1}*R*are the parallel RC resistances. Specify these values with the_{RC2}**First polarization resistance**and**Second polarization resistance**parameters, respectively.*C*and_{RC1}*C*are the parallel RC capacitances. The time constant_{RC2}*τ*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**and**Second time constant**parameters, respectively.*R*is the series resistance. Specify this value with the_{0}**Internal resistance**parameter.

### Modeling Battery Aging

For battery models with finite battery charge capacity, 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 depend on the storage temperature, the storage state of charge, and time.

**Note**

The Battery block only applies the calendar aging during
initialization. When you set the **Calendar aging** parameter
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.

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**parameter.*b*is the**Linear scaling for voltage, b**.*c*is the**Constant offset for voltage, c**.*d*is the**Temperature-dependent exponential increase, d**.*a*is the**Time exponent, a**.*q*is the electron's elementary charge, in C.*k*is the Boltzmann constant, in J/K.

The *R1_age_multiplier* variable in the **Simscape Results Explorer** stores the calendar aging of the battery in terms of resistance increase:

$$R1\_age\_multiplier=\frac{R}{{R}_{0}}.$$

For thermal modeling options of the block, if you set the **Storage condition** parameter to `Fixed open-circuit voltage`

, you must specify the additional **Open-circuit voltage measurement temperature** parameter to convert the storage open-circuit voltage to the temperature-independent state of charge during storage:

$$SOC=\frac{OCV\left(1-\beta \left({T}_{OC{V}_{measurement}}\right)\right)}{1-\beta \left({T}_{OC{V}_{measurement}}\right)OCV}.$$

The open-circuit voltage according to the storage temperature is then defined by this equation:

$$OC{V}_{{T}_{storage}}=\frac{SOC}{1-\beta \left({T}_{storage}\right)\left(1-\beta \left({T}_{storage}\right)SOC\right)}.$$

Finally, this equation defines the terminal resistance increase of the battery due to calendar aging according to the storage temperature:

$$R={R}_{0}\left(1+{\displaystyle \sum _{i=1}^{i=n}{\alpha}_{r}\left({T}_{storag{e}_{i}},OC{V}_{{T}_{storag{e}_{i}}}\right)\left({t}_{i}^{a}-{t}_{i-1}^{a}\right)}\right).$$

### Variables

To set the priority and initial target values for the block variables before simulation,
use the **Initial Targets** section in the block dialog box or Property
Inspector. For more information, see Set Priority and Initial Target for Block Variables.

Use nominal values to specify the expected magnitude of a variable in a model. Using
system scaling based on nominal values increases the simulation robustness. Nominal values
can come from different sources. One of these sources is the **Nominal
Values** section in the block dialog box or Property Inspector. For more
information, see System Scaling by Nominal Values.

When you model battery fade, the **Discharge cycles** variable lets you specify the number of charge-discharge cycles completed prior to the start of simulation. If you disable battery fade modeling, this variable is not used by the block.

### Plot Basic Voltage-Charge Characteristics

You can plot the basic voltage-charge characteristics of the Battery block without building a complete model. Use the plots to explore the impact of your parameter choices on device characteristics. If you parameterize the block from a datasheet, you can compare your plots to the datasheet to check that you parameterized the block correctly. If you have a complete working model but do not know which manufactured part to use, you can compare your plots to datasheets to help you decide.

To plot the basic characteristics, right-click the block and select
**Battery** > **Basic
characteristics** from the context menu. For more information
about the **Basic characteristics** option, see Plot Basic Voltage-Charge Characteristics of Battery Blocks (Simscape Electrical).

### Assumptions and Limitations

The self-discharge resistance is assumed not to depend strongly on the number of discharge cycles.

For the thermal modeling option of the battery, you provide fade data only for the reference temperature operation. The block applies the same derived

*λ*,_{AH}*λ*, and_{R0}*λ*multipliers to parameter values corresponding to the second temperature._{V1}When using the thermal block modeling options, use caution when operating at temperatures outside of the temperature range bounded by the

**Measurement temperature**and**Second measurement temperature**values. The block uses linear interpolation for the derived equation coefficients, and simulation results can become nonphysical outside of the specified range. The block checks that the internal series resistance, self-discharge resistance, and nominal voltage always remain positive. If there is a violation, the block issues error messages.

## Examples

## Ports

### Output

### Conserving

## Parameters

## References

[1] Ramadass, P., B. Haran, R. E. White, and B. N. Popov. “Mathematical
Modeling of the Capacity Fade of Li-Ion Cells.” *Journal of Power
Sources* 123, no. 2 (September 2003): 230–240. https://doi.org/10.1016/S0378-7753(03)00531-7.

[2] Ning, G., B. Haran, and B. N. Popov. “Capacity Fade Study of
Lithium-Ion Batteries Cycled at High Discharge Rates.” *Journal of Power
Sources* 117, no. 1-2 (May 2003): 160–169. https://doi.org/10.1016/S0378-7753(03)00029-6.

[3] Schmalstieg, J., S. Käbitz, M.
Ecker, and D. U. Sauer. “A Holistic Aging Model for Li(NiMnCo)O_{2}
Based 18650 Lithium-Ion Batteries.” *Journal of Power Sources* 257
(July 2014): 325–334. https://doi.org/10.1016/j.jpowsour.2014.02.012.

## Extended Capabilities

## Version History

**Introduced in R2008b**