Battery
Description
The Battery block represents a simple battery model.
The block has four modeling variants, accessible by right-clicking the block in your
block diagram and then selecting the appropriate option from the context menu, under > :
— Basic model
that does not output battery charge level or simulate thermal effects. This
modeling variant is the default.
— Model with
exposed thermal port. This model does not measure internal charge level of
the battery.
— Model with
exposed charge output port. This model does not simulate thermal
effects.
— Model that
lets you measure internal charge level of the battery and simulate thermal
effects. Both the thermal port and the charge output port are exposed.
The instrumented variants have 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.
The thermal port variants expose a 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 RSD, the charge
dynamics model, and the series resistance R0.
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:
where:
SOC
(state-of-charge) is the ratio of current
charge to rated battery capacity.
V0 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 ampere-hour rating 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 Ampere-hour
rating, Internal resistance, and
Voltage V1 when charge is AH1 parameter values,
respectively. These multipliers, in turn, depend on the number of discharge
cycles:
where:
λAH is the multiplier for
battery nominal capacity.
λR0 is the multiplier for
battery series resistance.
λV1 is the multiplier for
voltage V1.
N is the number of discharge cycles completed.
N0 is the number of full
discharge cycles completed before the start of the simulation.
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.
The block calculates the coefficients
k1,
k2, and
k3 by substituting the parameter
values you provide in the Fade section into these battery
equations. For example, the default set of block parameters corresponds to the
following coefficient values:
k1 = 1e-2
k2 = 1e-3
k3 = 1e-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.
Modeling Thermal Effects
For thermal variants of the block, you provide additional parameters to define
battery behavior at a second temperature. The extended equations for the voltage
when the thermal port is exposed are:
where:
T is the battery temperature.
T1 is the nominal
measurement temperature.
λV is the parameter
temperature dependence coefficient for
V0.
λβ is the parameter
temperature dependence coefficient for β.
β is calculated in the same way as Battery Model, using the
temperature-modified nominal voltage
V0T.
The internal series resistance, self-discharge resistance, and any charge-dynamic
resistances are also functions of temperature:
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:
where:
Mth is the battery thermal
mass.
i corresponds to the ith 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
VT,i is the voltage drop
across resistor i.
RT,i is resistor
i.
Modeling Charge Dynamics
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 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:
RRC1 and
RRC2 are the parallel
RC resistances. Specify these values with the First
polarization resistance and Second polarization
resistance parameters, respectively.
CRC1 and
CRC2 are the parallel
RC capacitances. The time constant τ for each
parallel section relates the R and
C values using the relationship . Specify τ for each section using
the First time constant and Second time
constant parameters, respectively.
R0 is the series resistance.
Specify this value with the Internal resistance
parameter.
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 block in your model and, from the context
menu, select > . The software automatically computes a set of bias conditions, based
on the block parameter values, and opens a figure window containing a plot of
no-load voltage versus the state-of-charge (SOC) for the block. For more
information, see Plot Basic Characteristics for Battery Blocks.
Variables
Use the Variables section of the block
interface to set the priority and initial target values for the block
variables prior to simulation. For more information, see Set Priority and Initial Target for Block Variables.
Unlike block parameters, variables do not have conditional visibility.
The Variables section lists all the existing
block variables. If a variable is not used in the set of equations
corresponding to the selected block configuration, the values specified
for this variable are ignored.
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.
Assumptions and Limitations
The self-discharge resistance is assumed not to depend strongly on the
number of discharge cycles.
For the thermal variant of the battery, you provide fade data only for the
reference temperature operation. The block applies the same derived
λAH,
λR0, and
λV1 multipliers to
parameter values corresponding to the second temperature.
When using the thermal block variants, 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.
Ports
Output
expand all
q
— Battery charge level, C
physical signal
Physical signal port that outputs the internal charge, in the units of
coulomb (C). Use this output port to change load behavior as a function
of charge, without the complexity of building a charge state
estimator.
Dependencies
Enabled for the instrumented variants of the block:
and
.
Conserving
expand all
+
— Positive terminal
electrical
Electrical conserving port associated with the battery positive
terminal.
-
— Negative terminal
electrical
Electrical conserving port associated with the battery negative
terminal.
H
— Battery thermal mass
thermal
Thermal conserving port that represents the battery thermal mass. When
you expose this port, provide additional parameters to define battery
behavior at a second temperature. For more information, see Modeling Thermal Effects.
Dependencies
Enabled for the thermal variants of the block:
and .
Parameters
expand all
Main
Nominal voltage, Vnom
— Output voltage when battery is fully charged
12
V
(default) | positive number
The no-load voltage across the battery when it is fully
charged.
Current directionality
— Enable direction of current
Disabled
(default) | Enabled
Whether to enable current directionality. If you set this parameter to
Enabled
, the terminal resistance depends
on the direction of the current.
Internal resistance
— Battery internal resistance
2
Ohm
(default) | positive number
Internal connection resistance of the battery.
Dependencies
To enable this parameter, set Current
directionality to
Disabled
.
Internal resistance during charge phase
— Battery internal resistance during charge
2
Ohm
(default) | positive number
Internal connection resistance of the battery during charge
phase.
Dependencies
To enable this parameter, set Current
directionality to
Enabled
.
Internal resistance during discharge phase
— Battery internal resistance during discharge
2
Ohm
(default) | positive number
Internal connection resistance of the battery during discharge
phase.
Dependencies
To enable this parameter, set Current
directionality to
Enabled
.
Battery charge capacity
— Select battery model
Infinite
(default) | Finite
Select one of the options for modeling the charge capacity of the
battery:
Ampere-hour rating
— Nominal battery capacity when fully charged
50
hr*A
(default) | positive number
The maximum (nominal) battery charge in ampere-hours. To specify a
target value for the initial battery charge at the start of simulation,
use the high-priority Charge variable. For more
information, see Variables.
Dependencies
Enabled when the Battery charge capacity
parameter is set to Finite
.
Voltage V1 when charge is AH1
— Output voltage at charge level AH1
11.5
V
(default) | positive number
The fundamental battery output voltage when the charge level is AH1,
as specified by the Charge AH1 when no-load voltage is
V1 parameter. This parameter must be less than
Nominal voltage, Vnom.
Dependencies
Enabled when the Battery charge capacity
parameter is set to Finite
.
Charge AH1 when no-load voltage is V1
— Charge level when the no-load output voltage is V1
25
hr*A
(default) | positive number
The battery charge level corresponding to the no-load output voltage
specified by the Voltage V1 when charge is AH1
parameter.
Dependencies
Enabled when the Battery charge capacity
parameter is set to Finite
.
Self-discharge
— Select whether to model the self-discharge resistance of the battery
Disabled
(default) | Enabled
Select whether to model the self-discharge resistance of the battery.
The block models this effect as a resistor across the terminals of the
fundamental battery model.
As temperature increases, self-discharge resistance decreases, causing
self-discharge to increase. If the decrease in resistance is too fast,
thermal runaway of the battery and numerical instability can occur. You
can resolve this by doing any of the following:
Decrease the thermal resistance
Decrease the gradient of the self-discharge resistance with
respect to temperature
Increase the self-discharge resistance
Dependencies
Enabled when the Battery charge capacity
parameter is set to Finite
.
Self-discharge resistance
— Resistance that represents battery self-discharge
2000
Ohm
(default) | positive number
The resistance across the fundamental battery model that represents
battery self-discharge.
Dependencies
Enabled when the Self-discharge parameter is
set to Enabled
.
Measurement temperature
— Temperature at which the block parameters are measured
298.15
K
(default) | positive number
Temperature T1, at which the
block parameters in the Main section are measured.
For more information, see Modeling Thermal Effects.
Dependencies
Enabled for blocks with exposed thermal port.
Dynamics
Charge dynamics
— Battery charge dynamics model
No dynamics
(default) | One time-constant dynamics
| Two time-constant dynamics
| Three time-constant dynamics
| Four time-constant dynamics
| Five time-constant dynamics
Select how to model battery charge dynamics. This parameter determines
the number of parallel RC sections in the equivalent circuit:
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.
First polarization resistance
— First RC resistance
0.005
Ohm
(default) | positive number
The resistance of the first parallel RC section. This parameter
primarily affects the ohmic losses of the RC section.
Dependencies
To enable this parameter, set Charge dynamics
to One time-constant dynamics
,
Two time-constant dynamics
,
Three time-constant dynamics
,
Four time-constant dynamics
, or
Five time-constant dynamics
.
First time constant
— First RC time constant
30
s
(default) | positive number
The time constant of the first parallel RC section. This value is
equal to RC and affects the dynamics of the RC
section.
Dependencies
To enable this parameter, set Charge dynamics
to One time-constant dynamics
,
Two time-constant dynamics
,
Three time-constant dynamics
,
Four time-constant dynamics
, or
Five time-constant dynamics
.
Second polarization resistance
— Second RC resistance
0.005
Ohm
(default) | positive number
The resistance of the second parallel RC section. This parameter
primarily affects the ohmic losses of the RC section.
Dependencies
To enable this parameter, set Charge dynamics
to Two time-constant dynamics
,
Three time-constant dynamics
,
Four time-constant dynamics
, or
Five time-constant dynamics
.
Second time constant
— Second RC time constant
30
s
(default) | positive number
The time constant of the second parallel RC section. This value is
equal to RC and affects the dynamics of the RC
section.
Dependencies
To enable this parameter, set Charge dynamics
to Two time-constant dynamics
,
Three time-constant dynamics
,
Four time-constant dynamics
, or
Five time-constant dynamics
.
Third polarization resistance
— Third RC resistance
0.005
Ohm
(default) | positive number
The resistance of the third parallel RC section. This parameter
primarily affects the ohmic losses of the RC section.
Dependencies
To enable this parameter, set Charge dynamics
to Three time-constant dynamics
,
Four time-constant dynamics
, or
Five time-constant dynamics
.
Third time constant
— Third RC time constant
30
s
(default) | positive number
The time constant of the third parallel RC section. This value is
equal to RC and affects the dynamics of the RC
section.
Dependencies
To enable this parameter, set Charge dynamics
to Three time-constant dynamics
,
Four time-constant dynamics
, or
Five time-constant dynamics
.
Fourth polarization resistance
— Fourth RC resistance
0.005
Ohm
(default) | positive number
The resistance of the fourth parallel RC section. This parameter
primarily affects the ohmic losses of the RC section.
Dependencies
To enable this parameter, set Charge dynamics
to Four time-constant dynamics
or
Five time-constant dynamics
.
Fourth time constant
— Fourth RC time constant
30
s
(default) | positive number
The time constant of the fourth parallel RC section. This value is
equal to RC and affects the dynamics of the RC
section.
Dependencies
To enable this parameter, set Charge dynamics
to Four time-constant dynamics
or
Five time-constant dynamics
.
Fifth polarization resistance
— Fifth RC resistance
0.005
Ohm
(default) | positive number
The resistance of the fifth parallel RC section. This parameter
primarily affects the ohmic losses of the RC section.
Dependencies
To enable this parameter, set Charge dynamics
to Five time-constant dynamics
.
Fifth time constant
— Fifth RC time constant
30
s
(default) | positive number
The time constant of the fifth parallel RC section. This value is
equal to RC and affects the dynamics of the RC
section.
Dependencies
To enable this parameter, set Charge dynamics
to Five time-constant dynamics
.
Fade
Battery fade
— Select whether to model battery performance deterioration with
aging
Disabled
(default) | Enabled
Select whether to include battery fade modeling:
Disabled
— The battery performance
is not age dependent.
Enabled
— The battery performance
changes depending on the number of completed charge-discharge
cycles. Selecting this option exposes additional parameters in
this section, which define the battery performance after a
certain number of discharge cycles. The block uses these
parameter values to calculate the scaling coefficients
k1,
k2, and
k3. For more
information, see Modeling Battery Fade.
Dependencies
Enabled when the Battery charge capacity
parameter in the Main section is set to
Finite
. If Battery charge
capacity is Infinite
, the
Fade section is empty.
Number of discharge cycles, N
— Number of cycles that defines a second set of data points
100
(default) | positive number
The number of charge-discharge cycles after which the other parameters
in this section are measured. This second set of data points defines the
scaling coefficients k1,
k2, and
k3, used in modeling
battery fade.
Dependencies
Enabled when the Battery fade parameter is
set to Enabled
.
Ampere-hour rating after N discharge cycles
— Maximum battery capacity after N discharge cycles
45
hr*A
(default) | positive number
The maximum battery charge, in ampere-hours, after the number of
discharge cycles specified by the Number of discharge cycles,
N parameter.
Dependencies
Enabled when the Battery fade parameter is
set to Enabled
.
Internal resistance after N discharge cycles
— Battery internal resistance after N discharge cycles
2.02
Ohm
(default) | positive number
The battery internal resistance after the number of discharge cycles
specified by the Number of discharge cycles, N
parameter.
Dependencies
Enabled when the Battery fade parameter is
set to Enabled
and Current
Directionality is set to
Disabled
.
Average internal resistance after N discharge cycles
— Battery average internal resistance after N discharge cycles
2.02
Ohm
(default) | positive number
Average of the battery charge and discharge internal resistance after
the number of discharge cycles specified by the Number of
discharge cycles, N parameter.
Dependencies
To enable this parameter, set Battery fade
and Current directionality to
Enabled
.
Voltage V1 at charge AH1 after N discharge cycles
— Output voltage at charge level AH1 after N discharge cycles
10.35
V
(default) | positive number
The fundamental battery model output voltage, at charge level AH1,
after the number of discharge cycles specified by the Number
of discharge cycles, N parameter.
Dependencies
Enabled when the Battery fade parameter is
set to Enabled
.
Temperature Dependence
This section appears only for blocks with exposed thermal port. For more
information, see Modeling Thermal Effects.
Nominal voltage at second measurement temperature
— Output voltage when battery is fully charged
12
V
(default) | positive number
The no-load voltage across the battery at the second measurement
temperature when it is fully charged.
Internal resistance at second measurement temperature
— Battery internal resistance
2.2
Ohm
(default) | positive number
Internal connection resistance of the battery at the second
measurement temperature.
Voltage V1 at second measurement temperature
— Output voltage at charge level AH1
11.4
V
(default) | positive number
The fundamental battery model output voltage at the second measurement
temperature and at charge level AH1, as specified by the
Charge AH1 when no-load voltage is V1
parameter.
Dependencies
Enabled when the Battery charge capacity
parameter in the Main section is set to
Finite
.
Self-discharge resistance at second measurement temperature
— Resistance that represents battery self-discharge
2200
Ohm
(default) | positive number
The resistance across the fundamental battery model at the second
measurement temperature. This resistance represents the
self-discharge.
Dependencies
Enabled when the Self-discharge resistance
parameter in the Main section is set to
Enabled
.
First polarization resistance at second measurement temperature
— First RC resistance at second measurement temperature
0.005
Ohm
(default) | positive number
The resistance of the first parallel RC section at the second
measurement temperature.
Dependencies
To enable this parameter, set Charge dynamics
to One time-constant dynamics
,
Two time-constant dynamics
,
Three time-constant dynamics
,
Four time-constant dynamics
, or
Five time-constant dynamics
.
First time constant at second measurement temperature
— First RC time constant at second measurement temperature
30
s
(default) | positive number
The time constant of the first parallel RC section at the second
measurement temperature.
Dependencies
To enable this parameter, set Charge dynamics
to One time-constant dynamics
,
Two time-constant dynamics
,
Three time-constant dynamics
,
Four time-constant dynamics
, or
Five time-constant dynamics
.
Second polarization resistance at second measurement temperature
— Second RC resistance at second measurement temperature
0.005
Ohm
(default) | positive number
The resistance of the second parallel RC section at the second
measurement temperature.
Dependencies
To enable this parameter, set Charge dynamics
to Two time-constant dynamics
,
Three time-constant dynamics
,
Four time-constant dynamics
, or
Five time-constant dynamics
.
Second time constant at second measurement temperature
— Second RC time constant at second measurement temperature
30
s
(default) | positive number
The time constant of the second parallel RC section at the second
measurement temperature.
Dependencies
To enable this parameter, set Charge dynamics
to Two time-constant dynamics
,
Three time-constant dynamics
,
Four time-constant dynamics
, or
Five time-constant dynamics
.
Third polarization resistance at second measurement temperature
— Third RC resistance at second measurement temperature
0.005
Ohm
(default) | positive number
The resistance of the third parallel RC section at the second
measurement temperature.
Dependencies
To enable this parameter, set Charge dynamics
to Three time-constant dynamics
,
Four time-constant dynamics
, or
Five time-constant dynamics
.
Third time constant at second measurement temperature
— Third RC time constant at second measurement temperature
30
s
(default) | positive number
The time constant of the third parallel RC section at the second
measurement temperature.
Dependencies
To enable this parameter, set Charge dynamics
to Three time-constant dynamics
,
Four time-constant dynamics
, or
Five time-constant dynamics
.
Fourth polarization resistance at second measurement temperature
— Fourth RC resistance at second measurement temperature
0.005
Ohm
(default) | positive number
The resistance of the fourth parallel RC section at the second
measurement temperature.
Dependencies
To enable this parameter, set Charge dynamics
to Four time-constant dynamics
or
Five time-constant dynamics
.
Fourth time constant at second measurement temperature
— Fourth RC time constant at second measurement temperature
30
s
(default) | positive number
The time constant of the fourth parallel RC section at the second
measurement temperature.
Dependencies
To enable this parameter, set Charge dynamics
to Four time-constant dynamics
or
Five time-constant dynamics
.
Fifth polarization resistance at second measurement temperature
— Fifth RC resistance at second measurement temperature
0.005
Ohm
(default) | positive number
The resistance of the fifth parallel RC section at the second
measurement temperature.
Dependencies
To enable this parameter, set Charge dynamics
to Five time-constant dynamics
.
Fifth time constant at second measurement temperature
— Fifth RC time constant at second measurement temperature
30
s
(default) | positive number
The time constant of the fifth parallel RC section at the second
measurement temperature.
Dependencies
To enable this parameter, set Charge dynamics
to Five time-constant dynamics
.
Second measurement temperature
— Temperature at which the block parameters in this section are measured
273.15
K
(default) | positive number
Temperature T2, at which the
block parameters in the Temperature Dependence
section are measured. For more information, see Modeling Thermal Effects.
To specify the initial temperature at the start of simulation, use the
high-priority Temperature variable. For more
information, see Variables.
Thermal Port
This section appears only for blocks with exposed thermal port. For more
information, see Modeling Thermal Effects.
Thermal mass
— Thermal mass associated with the thermal port
30000
J/K
(default) | positive number
Thermal mass associated with the thermal port H. It represents the
energy required to raise the temperature of the thermal port by one
degree.
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 (2003), pp. 230–240.
[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 (2003), pp. 160–169.
Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.
Introduced in R2008b