> For the complete documentation index, see [llms.txt](https://www.opal-rt.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.opal-rt.com/docs/smart-power-simulation-software-sps/blocks-functions-tools/renewables/battery.md).

# Battery

## Description

<figure><img src="https://799605156-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdlNg8IbOdahCpFCyzxSN%2Fuploads%2Fgit-blob-b3babac5b27d6696a5f051b0f76de95e93ba6c64%2Fbattery_block.png?alt=media" alt=""><figcaption></figcaption></figure>

The **Battery block**, located in the **OPAL-RT SPS Software/Sources** library, implements a generic dynamic model that represents most popular types of rechargeable batteries.

This figure shows the equivalent circuit that the block models.

<figure><img src="https://799605156-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdlNg8IbOdahCpFCyzxSN%2Fuploads%2Fgit-blob-7c24296c865103fd01d1d94c2a612fdc24df89bc%2Fbattery_equivalent_circuit_model.png?alt=media" alt=""><figcaption></figcaption></figure>

### Charge and Discharge Characteristics

The circuit parameters can be modified to represent a specific battery type and its discharge characteristics. A typical discharge curve consists of three sections.

<figure><img src="https://799605156-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdlNg8IbOdahCpFCyzxSN%2Fuploads%2Fgit-blob-b74c5f5178ed51966fb7dff63b6f9797e9132f34%2Fbattery_charge_discharge_charac.png?alt=media" alt=""><figcaption></figcaption></figure>

The first section represents the exponential voltage drop when the battery is charged. The width of the drop depends on the battery type.

The second section represents the charge that can be extracted from the battery until the voltage drops below the battery nominal voltage. Finally, the third section represents the total discharge of the battery, when the voltage drops rapidly.

When the battery current is negative, the battery recharges, following a charge characteristic.

<figure><img src="https://799605156-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdlNg8IbOdahCpFCyzxSN%2Fuploads%2Fgit-blob-ccf1f7203a4891dd000eb1a5d14b8a08a843416a%2Fbattery_charge_discharge_model_curves.png?alt=media" alt=""><figcaption></figcaption></figure>

The model parameters are derived from the discharge characteristics. The discharging and charging characteristics are assumed to be the same.

The Exp(s) transfer function represents the hysteresis phenomenon for the lead-acid, nickel-cadmium (NiCD), and nickel-metal hydride (NiMH) batteries during the charge and discharge cycles. The exponential voltage increases when a battery is charging, regardless of the battery’s state of charge. When the battery is discharging, the exponential voltage decreases immediately.

<figure><img src="https://799605156-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdlNg8IbOdahCpFCyzxSN%2Fuploads%2Fgit-blob-d377af99000ecd6f6e2c540896d7f9faa5bd797f%2Fbattery_currentvsstate_charge_curve.png?alt=media" alt=""><figcaption></figcaption></figure>

The state of charge (SOC) for a battery is a measure of battery’s charge, expressed as a percent of the full charge. The depth of discharge (DOD) is the numerical compliment of the SOC, such that *DOD* = 100% - *SOC*.

For example, if the SOC is:

* 100% — The battery is fully charged and the DOD is 0%.
* 75% — The battery is 3/4 charged and the DOD is 25%.
* 50% — The battery is 1/2 charged and the DOD is 50%.
* 0% — The battery is has 0 charge and the DOD is 100%.

### Model Validation

Experimental validation of the model shows a maximum error of 5% (when SOC is between 10% and 100%) for the charge (when the current is 0 through 2 C) and discharge (when the current is 0 through 5 C) dynamics.

### Parameterization

**Extract Battery Parameters from Data Sheets**

This figure shows detailed parameters extracted from the Panasonic NiMH-HHR650D battery data sheet.

<figure><img src="https://799605156-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdlNg8IbOdahCpFCyzxSN%2Fuploads%2Fgit-blob-7ac977541d156d59572815377431b27bd6b4236e%2Fbattery_paramters_extract_datasheet.png?alt=media" alt=""><figcaption></figcaption></figure>

You can obtain the rated capacity and the internal resistance from the specification tables. The other detailed parameters are derived from the Typical Discharge Characteristics plot.

| **Parameter**                  | **Value**              |
| ------------------------------ | ---------------------- |
| Rated Capacity                 | 6.5 Ah                 |
| Internal Resistance            | 2 mΩ                   |
| Nominal Voltage (a)            | 1.18 V                 |
| Rated Capacity                 | 6.5 Ah                 |
| Maximum Capacity (b)           | 7 Ah (5.38 h \* 1.3 A) |
| Fully Charged Voltage (c)      | 1.39 V                 |
| Nominal Discharge Current (d)  | 1.3 A                  |
| Capacity @ Nominal Voltage (a) | 6.25 Ah                |
| Exponential Voltage (e)        | 1.28 V                 |
| Exponential Capacity (e)       | 1.3 Ah                 |

These parameters are approximate and depend on the precision of the points obtained from the discharge curve.

The discharge curves you obtain from these parameters, which are marked by dotted lines in the following figures, are similar to the data sheet curves.

<figure><img src="https://799605156-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdlNg8IbOdahCpFCyzxSN%2Fuploads%2Fgit-blob-92050718da76036fe0e0a8253a857f5c70f47574%2Fbattery_model_comparaison_results.png?alt=media" alt=""><figcaption></figcaption></figure>

### **Temperature Effects**

{% hint style="info" %}
Temperature and aging effects have been removed from R2024b
{% endhint %}

To represent the temperature effects of the lithium-ion (Li-ion) battery type, an additional discharge curve at ambient temperature, which is different from the nominal temperature, and the thermal response parameters are required.

Additional discharge curves are not usually provided on the data sheet and may require simple experiments to be obtained.

The following examples show parameters extracted from the A123 Li-iron-phosphate ANR26650M1 and the Panasonic Li-cobalt-oxide CGR 18,650 AF battery data sheets.

The A123 ANR26650M1 data sheet specifications include the required discharge curve points and other required parameters.

<figure><img src="https://799605156-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdlNg8IbOdahCpFCyzxSN%2Fuploads%2Fgit-blob-88be5c531121feca3b5b4f9f99a6cd68af800f01%2Fbattery_temp_effect.png?alt=media" alt=""><figcaption></figcaption></figure>

These parameters are derived from the data sheet for the A123 Li-ion temperature-dependent battery model.

| **Parameter**                                      | **Value**         |
| -------------------------------------------------- | ----------------- |
| Nominal voltage (c)                                | 3.22 V            |
| Rated capacity                                     | 2.3 Ah            |
| Maximum capacity (d)                               | 2.3 Ah            |
| Fully charged voltage (a)                          | 3.7 V             |
| Nominal discharge current                          | 2.3 A             |
| Internal resistance                                | 10 mΩ             |
| Capacity at nominal voltage (c)                    | 2.07 Ah           |
| Exponential zone (b)                               | \[3.4 V, 0.23Ah]  |
| Nominal ambient temperature                        | 25°C              |
| Second ambient temperature                         | 0°C               |
| Maximum capacity at 0°C (h)                        | 2.208 Ah          |
| Initial discharge voltage at 0°C (e)               | 3.45 V            |
| Voltage at 90% maximum capacity at 0°C (g)         | 2.8 V             |
| Exponential zone at 0°C (f)                        | \[3.22 V, 0.23Ah] |
| Thermal resistance, cell-to-ambient (estimated)    | 0.6               |
| Thermal time constant, cell-to-ambient (estimated) | 1000              |

In the figure, the dashed lines show the discharges curves obtained from the simulation at different ambient temperatures. The model performance is very close to the data sheet results.

<figure><img src="https://799605156-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdlNg8IbOdahCpFCyzxSN%2Fuploads%2Fgit-blob-8123f82f71da33845d58deb7e52c8a4bd3f26f6f%2Fbattery_tempeffect_comparaison_results.png?alt=media" alt=""><figcaption></figcaption></figure>

The same approach for parameter extraction is applied to the Panasonic Lithium-Ion CGR18650AF with these specifications.

<figure><img src="https://799605156-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdlNg8IbOdahCpFCyzxSN%2Fuploads%2Fgit-blob-4b9985b8da0cf540d73d45e6799af212ba3a91b2%2Fbattery_tempeffect_datasheet.png?alt=media" alt=""><figcaption></figcaption></figure>

These parameters are extracted for the battery model.

| **Parameter**                                      | **Value**         |
| -------------------------------------------------- | ----------------- |
| Nominal voltage (c)                                | 3.3 V             |
| Rated capacity                                     | 2.05 Ah           |
| Maximum capacity (d)                               | 2 Ah              |
| Fully charged voltage (a)                          | 4.2 V             |
| Nominal discharge current                          | 1.95 A            |
| Internal resistance (estimated)                    | 16.5 mΩ           |
| Capacity at nominal voltage (c)                    | 1.81 Ah           |
| Exponential zone (b)                               | \[3.71 V, 0.6 Ah] |
| Nominal ambient temperature                        | 25°C              |
| Second ambient temperature                         | 0°C               |
| Maximum capacity at 0°C (h)                        | 1.78 Ah           |
| Initial discharge voltage at 0°C (e)               | 4 V               |
| Voltage at 90% maximum capacity at 0°C (g)         | 3.11 V            |
| Exponential zone at 0°C (f)                        | \[3.8 V, 0.2Ah]   |
| Thermal resistance, cell-to-ambient (estimated)    | 0.06              |
| Thermal time constant, cell-to-ambient (estimated) | 1000              |

The figure shows a good match between the simulated discharge curves (represented by the dashed lines) and the data sheet curves. The accuracy of the model depends on how precise the selected points from the data sheet discharge curves are.

<figure><img src="https://799605156-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdlNg8IbOdahCpFCyzxSN%2Fuploads%2Fgit-blob-e22c3164e3e0ea9268bbea02fabe200d731a14f8%2Fbattery_simulated_discharge_curves.png?alt=media" alt=""><figcaption></figcaption></figure>

### **Model cells in Series and/or in Parallel**

To model a series and/or parallel combination of cells based on the parameters of a single cell, use the parameter transformation shown in the following table can be used.

The Nb\_ser variable corresponds to the number of cells in series, and Nb\_par corresponds to the number of cells in parallel.

| **Parameter**               | **Value**                       |
| --------------------------- | ------------------------------- |
| Nominal voltage             | 1.18 \* Nb\_ser                 |
| Rated capacity              | 6.5 \* Nb\_par                  |
| Maximum capacity            | 7 \* Nb\_par                    |
| Fully charged voltage       | 1.39 \* Nb\_ser                 |
| Nominal discharge current   | 1.3 \* Nb\_par                  |
| Internal resistance         | 0.002 \* Nb\_ser/Nb\_par        |
| Capacity at nominal voltage | 6.25 \* Nb\_par                 |
| Exponential zone            | 1.28 \* Nb\_ser, 1.3 \* Nb\_par |

#### Equations

For the lead-acid battery type, the model uses these equations.

* Discharge Model (i\* > 0)

$$
f\_1(it, i^*, i, Exp) = E\_0 - K \cdot \frac{Q}{Q - it} \cdot i^* - K \cdot \frac{Q}{Q - it} \cdot it + \text{Laplace}^{-1}\left( \frac{\text{Exp}(s)}{\text{Sel}(s)}, 0 \right) \\\[8pt]
$$

* Charge Model (i\* < 0)

$$
f\_2(it, i^*, i, Exp) = E\_0 - K \cdot \frac{Q}{it + 0.1 \cdot Q} \cdot i^* - K \cdot \frac{Q}{Q - it} \cdot it + \text{Laplace}^{-1}\left( \frac{\text{Exp}(s)}{\text{Sel}(s)}, \frac{1}{s} \right) \\\[8pt]
$$

For the lithium-ion battery type, the model uses these equations.

* Discharge Model (i\* > 0)

$$
f\_1(it, i^*, i) = E\_0 - K \cdot \frac{Q}{Q - it} \cdot i^* - K \cdot \frac{Q}{Q - it} \cdot it + A \cdot \exp(-B \cdot it) \\\[8pt]
$$

* Charge Model (i\* < 0)

$$
f\_2(it, i^*, i) = E\_0 - K \cdot \frac{Q}{it + 0.1 \cdot Q} \cdot i^* - K \cdot \frac{Q}{Q - it} \cdot it + A \cdot \exp(-B \cdot it) \\\[8pt]
$$

For the nickel-cadmium and nickel-metal-hydride battery types, the model uses these equations.

* Discharge Model (i\* > 0)

$$
f\_1(it, i^*, i, Exp) = E\_0 - K \cdot \frac{Q}{Q - it} \cdot i^* - K \cdot \frac{Q}{Q - it} \cdot it + \text{Laplace}^{-1}\left( \frac{\text{Exp}(s)}{\text{Sel}(s)}, 0 \right) \\\[8pt]
$$

* Charge Model (i\* < 0)

$$
f\_2(it, i^*, i, Exp) = E\_0 - K \cdot \frac{Q}{|it| + 0.1 \cdot Q} \cdot i^* - K \cdot \frac{Q}{Q - it} \cdot it + \text{Laplace}^{-1}\left( \frac{\text{Exp}(s)}{\text{Sel}(s)}, \frac{1}{s} \right) \\\[8pt]
$$

In the equations:

* *E*<sub>*Batt*</sub> is the nonlinear voltage, in V.
* *E*<sub>0</sub> is the constant voltage, in V.
* *Exp(s)* is the exponential zone dynamics, in V.
* *Sel(s)* represents the battery mode. *Sel(s)* = 0 during battery discharge, *Sel(s)* = 1 during battery charging.
* *K* is the polarization constant, in V/Ah, or polarization resistance, in Ohms.
* *i\** is the low-frequency current dynamics, in A.
* *i* is the battery current, in A.
* *it* is the extracted capacity, in Ah.
* *Q* is the maximum battery capacity, in Ah.
* *A* is the exponential voltage, in V.
* *B* is the exponential capacity, in Ah<sup>−1</sup>.

{% hint style="info" %}
Temperature and aging effects have been removed from R2024b
{% endhint %}

**Temperature Effect Equations**

* Discharge Model (i\* > 0)

$$
f\_1(it, i\*, i, T, T\_a) = E\_0(T) - K(T) \cdot \frac{Q(T\_a)}{Q(T\_a) - it} \cdot (i\* + it) + A \cdot \exp(-B \cdot it) - C \cdot it \\\[8pt]

V\_{batt}(T) = f\_1(it, i\*, i, T, T\_a) - R(T) \cdot i \\\[8pt]
$$

* Charge Model (i\* < 0)

$$
f\_1(it, i\*, i, T, T\_a) = E\_0(T) - K(T) \cdot \frac{Q(T\_a)}{it + 0.1 \cdot Q(T\_a)} \cdot i\*
\- K(T) \cdot \frac{Q(T\_a)}{Q(T\_a) - it} \cdot it
\+ A \cdot \exp(-B \cdot it) - C \cdot it \\\[8pt]

V\_{batt}(T) = f\_1(it, i\*, i, T, T\_a) - R(T) \cdot i \\\[8pt]
$$

with

$$
E\_0(T) = E\_0|*{T*{ref}} + \frac{\partial E}{\partial T} (T - T\_{ref}) \\\[8pt]

K(T) = K|*{T*{ref}} \cdot \exp!\left( \alpha \left( \frac{1}{T} - \frac{1}{T\_{ref}} \right) \right) \\\[8pt]

Q(T\_a) = Q|*{T*{ref}} + \frac{\Delta Q}{\Delta T} \cdot (T\_a - T\_{ref}) \\\[8pt]

R(T) = R|*{T*{ref}} \cdot \exp!\left( \beta \left( \frac{1}{T} - \frac{1}{T\_{ref}} \right) \right) \\\[8pt]
$$

where:

* *T*<sub>*ref*</sub> is the nominal ambient temperature, in K.
* *T* is the cell or internal temperature, in K.
* *T*<sub>*a*</sub> is ambient temperature, in K.
* *E*/*T* is the reversible voltage temperature coefficient, in V/K.
* α is the Arrhenius rate constant for the polarization resistance.
* β is the Arrhenius rate constant for the internal resistance.
* Δ*Q*/Δ*T* is the maximum capacity temperature coefficient, in Ah/K.
* *C* is the nominal discharge curve slope, in V/Ah. For lithium-ion batteries with less pronounced discharge curves (such as lithium iron phosphate batteries), this parameter is set to zero.
* The cell or internal temperature, *T*, at any given time, *t*, is expressed as:

$$
T(t) = \mathcal{L}^{-1}!\left( \frac{P\_{loss} R\_{th} + T\_a}{1 + s \cdot t\_c} \right) \\\[8pt]
$$

where:

* *R*<sub>*th*</sub> is thermal resistance, cell to ambient (°C/W).
* *t*<sub>*c*</sub> is thermal time constant, cell to ambient (s).
* *Ploss* is the overall heat generated (W) during the charge or discharge process and is given by

$$
P\_{loss} = \left( E\_0(T) - V\_{batt}(T) \right) \cdot i ; + ; \frac{\partial E}{\partial T} \cdot i \cdot T \\\[8pt]
$$

**Aging Effect Equations**

For the lithium-ion battery type, the impact of aging (due to cycling) on the battery capacity and internal resistance is represented by these equations:

$$
Q(n) = Q\_{BOL} - \epsilon (n) \cdot (Q\_{BOL} - Q\_{EOL}) , \quad  \text{if } k/2 \neq 0  \enspace
Q(n-1)  \quad \text{otherwise} \\\[8pt]
R(n) =
R\_{BOL} + \epsilon(n) \cdot (R\_{EOL} - R\_{BOL}) , \quad  \text{if } k/2 \neq 0  \enspace
R(n-1)   \quad \text{otherwise,} \\\[8pt]
$$

with

$$
n = k T\_h \qquad (k = 1,2,3,\ldots,\infty) \\\[8pt]
$$

where:

* *T*<sub>*h*</sub> is the half-cycle duration, in s. A complete cycle is obtained when the battery is discharged and charged or conversely.
* *Q*<sub>*BOL*</sub> is the battery’s maximum capacity, in Ah, at the beginning of life (BOL) and at nominal ambient temperature.
* *Q*<sub>*EOL*</sub> is the battery’s maximum capacity, in Ah, at the end of life (EOL) and at nominal ambient temperature.
* *R*<sub>*BOL*</sub> is the battery’s internal resistance, in ohms, at the BOL and at nominal ambient temperature.
* *R*<sub>*EOL*</sub> is the battery’s internal resistance, in ohms, at the EOL and at nominal ambient temperature.
* ε is the battery aging factor. The aging factor is equal to zero and unity at the BOL and EOL. The battery aging factor, ξ, is expressed as

$$
\epsilon(n) =
\epsilon(n-1) + \frac{0.5}{N\_{(n-1)}} \left( 2 -
\frac{DOD(n-2) + DOD(n)}{DOD(n-1)} \right) ,  \text{if } k/2 \neq 0 \enspace
\epsilon(n-1)  \quad  \text{otherwise,}
$$

where:

* *DD* is the battery DOD (%) after a half-cycle duration.
* *N* is maximum number of cycles and is given by

$$
N(n) = H!\left( \frac{DOD(n)}{100} \right)^{-\xi}
\cdot \exp!\left( -\psi \left( \frac{1}{T\_{ref}} - \frac{1}{T\_a(n)} \right) \right)
\cdot (I\_{dis\_ave}(n))^{-\gamma\_1}
\cdot (I\_{ch\_ave}(n))^{-\gamma\_2} \\\[8pt]
$$

where:

* *H* is the cycle number constant (cycles).
* ξ is the exponent factor for the DOD.
* ψ is the Arrhenius rate constant for the cycle number.
* *I*<sub>*dis\_ave*</sub> is the average discharge current in A during a half cycle duration.
* *I*<sub>*ch\_ave*</sub> is the average charge current in A during a half cycle duration.
* *γ*<sub>1</sub> is the exponent factor for the discharge current.
* *γ*<sub>2</sub> is the exponent factor for the charge current.

## Limitations and Assumptions

### **Limitations**

* The minimum no-load battery voltage is 0 V and the maximum battery voltage is equal to 2 × *E*<sub>*0*</sub>.
* The minimum capacity of the battery is 0 Ah and the maximum capacity is Q<sub>max</sub>.

### **Assumptions**

* The internal resistance is assumed to be constant during the charge and discharge cycles and does not vary with the amplitude of the current.
* The parameters of the model are derived from the discharge characteristics. The discharging and charging characteristics are assumed to be the same.
* The capacity of the battery does not change with the amplitude of the current (there is no Peukert effect).
* The self-discharge of the battery is not represented. It can be represented by adding a large resistance in parallel with the battery terminals.
* The battery has no memory effect.

## Ports

### Output

<table data-header-hidden><thead><tr><th width="249.77777099609375"></th><th></th></tr></thead><tbody><tr><td><strong>m</strong> — Battery temperature, state-of-charge, current, and voltage<br>Simulink<sup>®</sup> signal | vector</td><td><p>Output vector of signals for the battery temperature, state-of-charge, current and voltage.</p><p>To demultiplex the signals, you can use a Bus Selector block.<br><strong>Cell Temperature</strong>: The cell or internal temperature (°C)<br><strong>SOC</strong>: Battery SOC (%), represented as a percentage (between 0 and 100%). The SOC is 100% for a fully charged battery and 0% for an empty battery. The SOC is calculated as:<br><span class="math">\\[4pt] SOC = 100 \left( 1 - \frac{1}{Q} \int_{0}^{t} i(t) \, dt \right) \\[8pt]</span><br><strong>Current</strong>: Battery current (A)<br><strong>Voltage</strong>: Battery voltage</p></td></tr></tbody></table>

### Conserving

<table data-header-hidden><thead><tr><th width="249.95556640625"></th><th></th></tr></thead><tbody><tr><td><strong>+</strong> — Positive terminal<br>Specialized electrical</td><td>Specialized electrical conserving port associated with the battery's positive terminal.</td></tr><tr><td><strong>-</strong> — Negative terminal<br>Specialized electrical</td><td>Specialized electrical conserving port associated with the battery's negative terminal.</td></tr></tbody></table>

## Parameters

<table data-header-hidden><thead><tr><th width="250.22210693359375"></th><th></th></tr></thead><tbody><tr><td><strong>Type</strong> — Battery model<br>Lithium-Ion (default) | Lead-Acid | Nickel-Cadmium | Nickel-Metal-Hydride</td><td>Battery model. The block provides predetermined charge behavior for four battery types.</td></tr><tr><td><strong>Nominal voltage (V)</strong> — Nominal voltage<br>7.2 (default) | positive scalar</td><td>Nominal voltage, <em>V</em><sub><em>nom</em></sub>, of the battery, in V. The nominal voltage represents the end of the linear zone of the discharge characteristics.</td></tr><tr><td><strong>Rated capacity (Ah)</strong> — Rated capacity<br>5.4 (default) | positive scalar</td><td>Rated capacity, <em>Q</em><sub><em>rated</em></sub>, of the battery, in Ah. The rated capacity is the minimum effective capacity of the battery.</td></tr><tr><td><strong>Initial state-of-charge (%)</strong> — Initial SOC<br>100 (default)</td><td><p>State-of-charge (SOC) of the battery, expressed as a percentage of the maximum potential charge, at the beginning of simulation.</p><p>An SOC of 100% indicates a fully charged battery and 0% indicates an empty battery. The specified value does not affect the discharge curve that the block generates if, in the <strong>Discharge</strong> settings, you click <strong>Plot</strong>.</p></td></tr><tr><td><strong>Battery response time (s)</strong> — Response time<br>30 (default) | nonnegative scalar</td><td><p>Response time of the battery, in s, at 95% of the final value.</p><p>This value represents the voltage dynamics and can be observed when a current step is applied.</p><p>The plots show the voltage and discharge current for a battery with a response time of 30 s.</p><p><img src="https://799605156-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdlNg8IbOdahCpFCyzxSN%2Fuploads%2Fgit-blob-8af65fc786af9a7c61f5f45141ab0f82357e6022%2Fbattery_response_time_curves.png?alt=media" alt="" data-size="original"></p></td></tr></tbody></table>

### Discharge

<table data-header-hidden><thead><tr><th width="250.22222900390625"></th><th></th></tr></thead><tbody><tr><td><strong>Determined from the nominal parameters of the battery</strong> — Discharge parameter determination<br>on (default) | off</td><td><p>Select to have the block determine the parameters in the <strong>Discharge</strong> settings based on the values specified for the parameters in the <strong>Parameters</strong> settings.</p><p><strong>Dependencies</strong> Selecting this parameter disables the parameters in the <strong>Discharge</strong> settings.</p></td></tr><tr><td><strong>Maximum capacity (Ah)</strong> — Maximum amp-hour capacity<br>5.4 (default) | positive scalar</td><td>Maximum theoretical capacity, <em>Q</em>, when a discontinuity occurs in the battery voltage, in Ah. This value is generally equal to 105% of the rated capacity.</td></tr><tr><td><strong>Cut-off Voltage (V)</strong> — Cut-off voltage<br>5.4 (default) | positive scalar</td><td>Minimum allowable battery voltage, in V. This voltage represents the end of the discharge characteristics. At the cut-off voltage, the battery is fully discharged.</td></tr><tr><td><strong>Fully charged voltage (V)</strong> — Fully charged voltage<br>8.3807 (default) | positive scalar</td><td>Fully charged voltage, <em>V</em><sub><em>full</em></sub>, for a given discharge current. The fully charged voltage is not the no-load voltage.</td></tr><tr><td><strong>Nominal discharge current (A)</strong> — Nominal discharge current<br>2.3478 (default) | positive scalar</td><td><p>Nominal discharge current, in A, for which the discharge curve is measured.</p><p>For example, a typical discharge current for a 1.5-Ah NiMH battery is 20% of the rated capacity: (0.2 * 1.5 Ah / 1 h = 0.3 A).</p></td></tr><tr><td><strong>Internal resistance (Ohms)</strong> — Internal resistance<br>0.013333 (default) | positive scalar</td><td><p>Internal resistance of the battery, in ohms. When a preset model is used, a generic value is loaded that corresponds to 1% of the nominal power (nominal voltage multiplied by the battery rated capacity).</p><p>The resistance is constant during the charge and the discharge cycles and does not vary with the amplitude of the current.</p></td></tr><tr><td><strong>Capacity (Ah) at nominal voltage</strong> — Amp-hour capacity at nominal voltage<br>4.8835 (default) | positive scalar</td><td><p>Capacity, <em>Q</em><sub><em>nom</em></sub>, extracted from the battery until the voltage drops under the nominal voltage.</p><p>This value should be between <em>Q</em><sub><em>exp</em></sub> and <em>Q</em><sub><em>max</em></sub>.</p></td></tr><tr><td><strong>Exponential zone [Voltage (V), Capacity (Ah)]</strong> — Exponential zone voltage and capacity<br>[7.7788 0.2653] (default) | nonnegative vector</td><td><p>Voltage, <em>V</em><sub><em>exp</em></sub>, and the capacity, <em>Q</em><sub><em>exp</em></sub>, that correspond to the end of the exponential zone.</p><p>The voltage should be between <em>V</em><sub><em>nom</em></sub> and <em>V</em><sub><em>full</em></sub>. The capacity should be between 0 and <em>Qnom</em>.</p></td></tr></tbody></table>

{% hint style="info" %}
Temperature and aging effects have been removed from R2024b
{% endhint %}

### **Display Characteristics**

<table data-header-hidden><thead><tr><th width="250.0888671875"></th><th></th></tr></thead><tbody><tr><td><strong>Discharge current [i1, i2, i3,...] (A)</strong> — Discharge characteristic plot currents [6.5 13 32.5] (default)</td><td>The block can generate a figure of two graphs that show the battery discharge characteristics. The discharge characteristics for these currents are presented in the second graph.</td></tr><tr><td><strong>Units</strong> — Discharge characteristic plot <em>x</em>-axis units Time (default) | Ampere-hour</td><td>Units used for the x-axis of the plots generated by <strong>Plot</strong>.</td></tr><tr><td><strong>Plot</strong> — Plot discharge characteristics</td><td><p>Generate a figure of two graphs that show the battery discharge characteristics.</p><p>The first graph represents the nominal discharge curve for the specified value for the <strong>Nominal Discharge Current</strong> parameter.</p><p>The second graph represents the discharge curves at the specified discharge currents.</p><p><img src="https://799605156-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdlNg8IbOdahCpFCyzxSN%2Fuploads%2Fgit-blob-84d1ec8343fc08e88f91a207ebb695e0ccca7df0%2Fbattery_discharge_char_plot.png?alt=media" alt="" data-size="original"></p><p><strong>Dependencies</strong> The discharge currents for the second plot are the specified values for the <strong>Discharge current [i1, i2, i3,…] (A)</strong> parameter. For more information, see Discharge current [i1, i2, i3,…] (A). The units for the <em>x</em>-axis of the plots are determined by the specified value, Ampere-hour (Ah) or Time, for the <strong>Units</strong> parameter.</p><p>For more information, see Units.</p></td></tr></tbody></table>

### Temperature

The **Temperature** settings are visible only if, in the **Parameter** settings, the **Type** parameter is set to Lithium-Ion and the **Simulate temperature effects** check box is selected. For more information, see Parameters, Type, and Simulate temperature effects.

The battery provides preset parameter values for common types of lithium-ion batteries. To use the preset parameter values, in the **Parameters** settings, set the **Use a preset battery to parameter** to one of the lithium-ion batteries. For more information, see Use a preset battery.

If you use a preset option, the only enabled parameter in the **Temperature** settings is **Initial cell temperature (deg. C)**.

The other parameters in the **Temperature** settings are disabled because the block provides the values.

Alternatively, if you have a license for Simulink Design Optimization and empirical battery data, you can estimate the temperature parameters for a lithium-ion based.

To enable the parameters, In the **Parameters** settings, set the **Use a preset battery to parameter** to no.

<table data-header-hidden><thead><tr><th width="249.9998779296875"></th><th></th></tr></thead><tbody><tr><td><strong>Initial cell temperature (deg. C)</strong> — Initial battery temperature20 (default) | scalar</td><td><p>Cell or internal temperature of the battery, in °C at the start of simulation.</p><p><strong>Dependencies</strong> To enable this parameter, in the <strong>Parameter</strong> settings, set <strong>Type</strong> to Lithium-Ion and select <strong>Simulate temperature effects</strong>. For more information, see Parameters, Type, and Simulate temperature effects.</p></td></tr><tr><td><strong>Nominal ambient temperature T1 (deg. C)</strong> — Nominal ambient temperature20 (default) | scalar</td><td><p>Ambient temperature, in °C, at nominal condition of operation. The block assumes that the parameter values provided in the <strong>Parameters</strong> settings are obtained at this ambient temperature.</p><p><strong>Dependencies</strong> This parameter is visible if, in the <strong>Parameter</strong> settings, you set <strong>Type</strong> to Lithium-Ion and select <strong>Simulate temperature effects</strong>.</p><p>For more information, see Parameters, Type, and Simulate temperature effects. This parameter is enabled if, in the <strong>Parameters</strong> settings, you set <strong>Use a preset battery</strong> to no. For more information, see Use a preset battery.</p></td></tr><tr><td><strong>Second ambient temperature T2 (deg. C)</strong> — Second ambient temperature-30 (default) | scalar</td><td><p>Ambient temperature, in °C, at the second operating condition. This value should be less than the value specified for the <strong>Nominal ambient temperature T1 (deg. C)</strong> parameter.</p><p><strong>Dependencies</strong> This parameter is visible if, in the <strong>Parameter</strong> settings, you set <strong>Type</strong> to Lithium-Ion and select <strong>Simulate temperature effects</strong>.</p><p>For more information, see Parameters, Type, and Simulate temperature effects.</p><p>This parameter is enabled if, in the <strong>Parameters</strong> settings, you set <strong>Use a preset battery</strong> to no.</p><p>For more information, see Use a preset battery.</p></td></tr></tbody></table>

### **Discharge parameters at T2**

<table data-header-hidden><thead><tr><th width="250"></th><th></th></tr></thead><tbody><tr><td><strong>Maximum capacity (Ah)</strong> — Maximum amp-hour capacity4.8 (default) | positive scalar</td><td><p>Maximum battery capacity, in Ah, at the temperature specified for the <strong>Second ambient temperature parameter T2 (deg. C)</strong>.</p><p><strong>Dependencies</strong> This parameter is visible if, in the <strong>Parameter</strong> settings, you set <strong>Type</strong> parameter to Lithium-Ion and select <strong>Simulate temperature effects</strong>.</p><p>For more information, see Parameters, Type, and Simulate temperature effects.</p><p>This parameter is enabled if, in the <strong>Parameters</strong> settings, you set <strong>Use a preset battery</strong> to no.</p><p>For more information, see Use a preset battery.</p></td></tr><tr><td><strong>Initial discharge voltage (V)</strong> — Initial discharge voltage7.1 (default) | positive scalar</td><td><p>Discharge voltage at the second ambient temperature, in V, when the discharge current is first applied.</p><p><strong>Dependencies</strong> This parameter is visible if, in the <strong>Parameter</strong> settings, you set <strong>Type</strong> to Lithium-Ion and select <strong>Simulate temperature effects</strong>.</p><p>For more information, see Parameters, Type, and Simulate temperature effects. This parameter is enabled if, in the <strong>Parameters</strong> settings, you set <strong>Use a preset battery</strong> to no. For more information, see Use a preset battery.</p></td></tr><tr><td><strong>Voltage at 90% maximum capacity (V)</strong> — 90% maximum capacity voltage5.655 (default) | positive scalar</td><td><p>Discharge voltage at the second ambient temperature when 90% of the maximum capacity is used, in V.</p><p><strong>Dependencies</strong> This parameter is visible if, in the <strong>Parameter</strong> settings, you set <strong>Type</strong> to Lithium-Ion and select <strong>Simulate temperature effects</strong>. For more information, see Parameters, Type, and Simulate temperature effects. This parameter is enabled if, in the <strong>Parameters</strong> settings, you set <strong>Use a preset battery</strong> to no.</p><p>For more information, see Use a preset battery.</p></td></tr><tr><td><strong>Exponential zone [Voltage (V), Capacity (Ah)]</strong> — Exponential zone voltage and capacity[6.58 1] (default) | positive vector</td><td><p>Discharge voltage, in V, and the capacity, in Ah, that correspond to the end of the exponential zone, at the second ambient temperature.</p><p><strong>Dependencies</strong> This parameter is visible if, in the <strong>Parameter</strong> settings, you set <strong>Type</strong> to Lithium-Ion and select <strong>Simulate temperature effects</strong>. For more information, see Parameters, Type, and Simulate temperature effects.</p><p>This parameter is enabled if, in the <strong>Parameters</strong> settings, you set <strong>Use a preset battery</strong> to no.</p><p>For more information, see Use a preset battery.</p></td></tr></tbody></table>

### **Thermal response and Heat loss**

<table data-header-hidden><thead><tr><th width="250.2222900390625"></th><th></th></tr></thead><tbody><tr><td><strong>Thermal resistance, cell-to-ambient (deg. C/W)</strong> — Thermal resistance0.6 (default) | positive scalar</td><td><p>Total thermal resistance, in °C/W, between the cell and ambient points of measurement. It is assumed the cell temperature is equivalent to the average internal temperature of the battery.</p><p><strong>Dependencies</strong> This parameter is visible if, in the <strong>Parameter</strong> settings, you set <strong>Type</strong> to Lithium-Ion and select <strong>Simulate temperature effects</strong>.</p><p>For more information, see Parameters, Type, and Simulate temperature effects. This parameter is enabled if, in the <strong>Parameters</strong> settings, you set <strong>Use a preset battery</strong> to no. For more information, see Use a preset battery.</p></td></tr><tr><td><strong>Thermal time constant, cell-to-ambient (s)</strong> — Thermal time constant2000 (default) | positive scalar</td><td><p>Temperature response time constant, in s, between the cell and ambient points of measurement. You can obtain this value from the ambient temperature step response while the battery is in idle mode.</p><p><strong>Dependencies</strong> This parameter is visible if, in the <strong>Parameter</strong> settings, you set <strong>Type</strong> to Lithium-Ion and select <strong>Simulate temperature effects</strong>.</p><p>For more information, see Parameters, Type, and Simulate temperature effects.</p><p>This parameter is enabled if, in the <strong>Parameters</strong> settings, you set <strong>Use a preset battery</strong> to no.</p><p>For more information, see Use a preset battery.</p></td></tr><tr><td><strong>Heat loss difference [charge vs. discharge] (W)</strong> — Heat loss difference0 (default) | scalar</td><td><p>Power loss difference between charge and discharge, in W, when the battery is charged and discharged at the same C-rate and ambient temperature. To determine the power loss difference Δ<em>P</em>, use this equation:</p><p><span class="math">\Delta P = \frac{t_c(\theta 2-\theta 1)}{R_{th}}</span></p><p>where <em>θ</em><sub><em>1</em></sub> and <em>θ</em><sub><em>2</em></sub> are the rates of change of the battery internal temperature (°C/s) during discharge and charge.</p><p><strong>Dependencies</strong> This parameter is visible only if, in the <strong>Parameter</strong> settings, the <strong>Type</strong> parameter is set to Lithium-Ion and the <strong>Simulate temperature effects</strong> check box is selected.</p><p>For more information, see Parameters, Type, and Simulate temperature effects.</p><p>This parameter is enabled only if, in the <strong>Parameters</strong> settings, the <strong>Use a preset battery</strong> parameter is set to no.</p><p>For more information, see Use a preset battery.</p></td></tr></tbody></table>

### Aging

The **Aging** settings visible if, in the **Parameters** settings, you set the **Type** parameter to Lithium-Ion and select **Simulate aging effects**. For more information, see Type and Simulate aging effects.

<table data-header-hidden><thead><tr><th width="250.26068115234375"></th><th></th></tr></thead><tbody><tr><td><strong>Initial battery age (Equivalent full cycles)</strong> — Initial battery age 0 (default) | nonnegative scalar</td><td><p>Battery age or equivalent full cycles at the beginning of the simulation. A full cycle is defined as a complete discharge and charge to 100% DOD and 100% SOC at a nominal ambient temperature and nominal discharge and charge current.</p><p>Default is 0.</p><p><strong>Dependencies</strong> To enable this parameter, in the <strong>Parameters</strong> settings, set <strong>Type</strong> to Lithium-Ion and select <strong>Simulate aging effects</strong>.</p><p>For more information, see Type and Simulate aging effects.</p></td></tr><tr><td><strong>Aging model sampling time (s)</strong> — Aging model sampling time 1e6 (default) | positive scalar</td><td><p>Simulation time step of the aging model, in s.</p><p><strong>Dependencies</strong> To enable this parameter, in the <strong>Parameters</strong> settings, set <strong>Type</strong> to Lithium-Ion and select <strong>Simulate aging effects</strong>.</p><p>For more information, see Type and Simulate aging effects.</p></td></tr></tbody></table>

#### **Aging characteristics at ambient temperature*****Ta1***

<table data-header-hidden><thead><tr><th width="249.51055908203125"></th><th></th></tr></thead><tbody><tr><td><strong>Ambient temperature Ta1 (deg. C)</strong> — Ambient temperature25 (default) | scalar</td><td><p>First ambient temperature , <em>Ta1</em>, during the aging performance test, in °C.</p><p><strong>Dependencies</strong> To enable this parameter, in the <strong>Parameters</strong> settings, set <strong>Type</strong> to Lithium-Ion and select <strong>Simulate aging effects</strong>.</p><p>For more information, see Type and Simulate aging effects.</p></td></tr><tr><td><strong>Capacity at EOL (End Of Life) (Ah)</strong> — End-of-life amp-hour capacity5.4*0.9 (default) | positive scalar</td><td><p>Maximum capacity at EOL at ambient temperature <em>Ta1</em>, in Ah.</p><p><strong>Dependencies</strong> To enable this parameter, in the <strong>Parameters</strong> settings, set <strong>Type</strong> to Lithium-Ion and select <strong>Simulate aging effects</strong>.</p><p>For more information, see Type and Simulate aging effects.</p></td></tr><tr><td><strong>Internal resistance at EOL (Ohms)</strong> — End-of-life internal resistance0.013333*1.2 (default) | positive scalar</td><td><p>Internal resistance at EOL at ambient temperature <em>Ta1</em>, in ohms.</p><p><strong>Dependencies</strong> To enable this parameter, in the <strong>Parameters</strong> settings, set <strong>Type</strong> to Lithium-Ion and select <strong>Simulate aging effects</strong>.</p><p>For more information, see Type and Simulate aging effects.</p></td></tr><tr><td><strong>Charge current (nominal, maximum) [Ic (A), Icmax (A)]</strong> — Nominal and maximum charge currents[2.3478, 3] (default) | positive vector</td><td><p>Nominal and maximum charge current, in A.</p><p><strong>Dependencies</strong> To enable this parameter, in the <strong>Parameters</strong> settings, set <strong>Type</strong> to Lithium-Ion and select <strong>Simulate aging effects</strong>.</p><p>For more information, see Type and Simulate aging effects.</p></td></tr><tr><td><strong>Discharge current (nominal, maximum) [Id (A), Idmax (A)]</strong> — Nominal and maximum discharge currents[2.3478, 10] (default) | positive vector</td><td><p>Nominal and maximum discharge current in A.</p><p><strong>Dependencies</strong> To enable this parameter, in the <strong>Parameters</strong> settings, set <strong>Type</strong> to Lithium-Ion and select <strong>Simulate aging effects</strong>.</p><p>For more information, see Type and Simulate aging effects.</p></td></tr><tr><td><strong>Cycle life at 100% DOD, Ic and Id (Cycles)</strong> — Cycle life at 100% DOD, <em>Ic</em>, <em>Id</em>, and <em>Ta1</em>1500 (default) | positive scalar</td><td><p>Number of cycles at 100% depth of discharge, at nominal charge current and discharge current, and at the first ambient temperature, <em>Ta1</em>.</p><p><strong>Dependencies</strong> To enable this parameter, in the <strong>Parameters</strong> settings, set <strong>Type</strong> t to Lithium-Ion and select <strong>Simulate aging effects</strong>. For more information, see Type and Simulate aging effects.</p></td></tr><tr><td><strong>Cycle life at 25% DOD, Ic and Id (Cycles)</strong> — Cycle life at 25% DOD, <em>Ic</em>, <em>Id</em>, and <em>Ta1</em>10500 (default) | positive scalar</td><td><p>Number of cycles at 25% depth of discharge, at nominal charge current and discharge current, and at the first ambient temperature, <em>Ta1</em>.</p><p><strong>Dependencies</strong> To enable this parameter, in the <strong>Parameters</strong> settings, set <strong>Type</strong>to Lithium-Ion and select <strong>Simulate aging effects</strong>.</p><p>For more information, see Type and Simulate aging effects.</p></td></tr><tr><td><strong>Cycle life at 100% DOD, Ic and Idmax (Cycles)</strong> — Cycle life at 100% DOD, <em>Ic</em>, <em>Id_max</em>, and <em>Ta1</em>1000 (default) | positive scalar</td><td><p>Number of cycles at 100% DOD, at nominal charge current, at maximum discharge current, and at the first ambient temperature, <em>Ta1</em>.</p><p><strong>Dependencies</strong> To enable this parameter, in the <strong>Parameters</strong> settings, set <strong>Type</strong> to Lithium-Ion and select <strong>Simulate aging effects</strong>.</p><p>For more information, see Type and Simulate aging effects.</p></td></tr><tr><td><strong>Cycle life at 100 % DOD, Icmax and Id (Cycles)</strong> — Cycle life at 100% DOD, <em>Ic_max</em>, <em>Id</em>, and <em>Ta1</em>1400 (default) | positive scalar</td><td><p>Number of cycles at 100% depth of discharge, at maximum charge current, at nominal charge current and discharge current, and at the first ambient temperature, Ta1.</p><p><strong>Dependencies</strong> To enable this parameter, in the <strong>Parameters</strong> settings, set <strong>Type</strong> to Lithium-Ion and select <strong>Simulate aging effects</strong>.</p><p>For more information, see Type and Simulate aging effects.</p></td></tr></tbody></table>

#### **Aging characteristics at ambient temperature*****Ta2***

<table data-header-hidden><thead><tr><th width="250.26068115234375"></th><th></th></tr></thead><tbody><tr><td><strong>Ambient temperature Ta2 (deg. C)</strong> — Ambient temperature <em>Ta2</em>45 (default) | scalar</td><td><p>Second ambient temperature, <em>Ta2</em>, in °C, during the aging performance test.</p><p><strong>Dependencies</strong> To enable this parameter, in the <strong>Parameters</strong> settings, set <strong>Type</strong> to Lithium-Ion and select <strong>Simulate aging effects</strong>.</p><p>For more information, see Type and Simulate aging effects.</p></td></tr><tr><td><strong>Cycle life at 100% DOD, Ic and Id (Cycles)</strong> — Cycle life at 100% DOD, <em>Ic</em>, <em>Id</em>, and <em>Ta2</em>950 (default) | positive scalar</td><td><p>Number of cycles at 100% DOD, at nominal charge and discharge currents, and at the second ambient temperature, <em>Ta2</em>.</p><p><strong>Dependencies</strong> To enable this parameter, in the <strong>Parameters</strong> settings, set <strong>Type</strong> to Lithium-Ion and select <strong>Simulate aging effects</strong>.</p><p>For more information, see Type and Simulate aging effects.</p></td></tr></tbody></table>

## References <a href="#references" id="references"></a>

\[1] Omar N., M. A. Monem, Y. Firouz, J. Salminen, J. Smekens, O. Hegazy, H. Gaulous, G. Mulder, P. Van den Bossche, T. Coosemans, and J. Van Mierlo. “Lithium iron phosphate based battery — Assessment of the aging parameters and development of cycle life model.” *Applied Energy*, Vol. 113, January 2014, pp. 1575–1585.

\[2] Saw, L.H., K. Somasundaram, Y. Ye, and A.A.O. Tay, “Electro-thermal analysis of Lithium Iron Phosphate battery for electric vehicles.” *Journal of Power Sources*. Vol. 249, pp. 231–238.

\[3] Tremblay, O., L.A. Dessaint, “Experimental Validation of a Battery Dynamic Model for EV Applications.” *World Electric Vehicle Journal*. Vol. 3, May 13–16, 2009.

\[4] Zhu, C., X. Li, L. Song, and L. Xiang, “Development of a theoretically based thermal model for lithium ion battery pack.” *Journal of Power Sources*. Vol. 223, pp. 155–164.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://www.opal-rt.com/docs/smart-power-simulation-software-sps/blocks-functions-tools/renewables/battery.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
