> 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/supercapacitor.md).

# Supercapacitor

## Description

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

The **Supercapacitor block**, located in the **OPAL-RT SPS Software/Sources** library, implements a generic supercapacitor model. This figure shows the equivalent circuit of the supercapacitor:

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

The capacitors *C*<sub>*1*</sub>, *C*<sub>*2*</sub>, and *C*<sub>*3*</sub> have fixed capacitances. The capacitance of capacitor *C*<sub>*v*</sub> depends on the voltage across it. The resistors *R*<sub>*1*</sub>, *R*<sub>*2*</sub>, and *R*<sub>*3*</sub> have fixed resistances.

The equation for the current through the first branch of the supercapacitor depends on the voltage across the capacitors in the branch,

$$
i\_1 =
\left{
\begin{array}{l}
(C\_1 + K\_v V\_{C\_1}) \dfrac{dV\_{C\_1}}{dt} \quad \text{if } V\_{C\_1} > 0 \\
C\_1 \dfrac{dV\_{C\_1}}{dt} \quad \text{if } V\_{C\_1} < 0
\end{array}
\right.
\\\[8pt]
$$

where:

* *V*<sub>*C1*</sub> is the voltage across the capacitors in the first branch.
* *C*<sub>*1*</sub> is the capacitance of the fixed capacitor in the first branch.
* *K*<sub>*v*</sub> is the voltage-dependent capacitance gain.
* *i*<sub>*1*</sub> is the current through the first branch.

This equation defines the current through the remaining branches:

$$
i\_n = C\_n \dfrac{dV\_{C\_n}}{dt}, \\\[8pt]
$$

where *n* is the number of the branch in the range \[2,3] and *C*<sub>*n*</sub> is the capacitance of the \_n\_th branch.

The block derives the values of the resistors (*R*<sub>*1*</sub>, *R*<sub>*2*</sub>, and *R*<sub>*3*</sub>), capacitors (*C*<sub>*1*</sub>, *C*<sub>*2*</sub>, and *C*<sub>*3*</sub>), and *K*<sub>*v*</sub> from the block parameters by using the methodology in \[3].

#### Model Before R2024b

The Supercapacitor block implements a generic model parameterized to represent most popular types of supercapacitors. The figure shows the equivalent circuit of the supercapacitor:

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

The supercapacitor output voltage is expressed using a Stern equation as:

$$
V\_{SC} =
\frac{N\_s Q\_T d}{N\_p N\_e \epsilon\_0 A\_i}
\+
\frac{2 N\_e N\_s RT}{F}
\sinh^{-1}
\left(
\frac{Q\_T}{N\_p N\_e^2 A\_i \sqrt{8 RT \epsilon\_0}}
\right)
-------

R\_{SC} \cdot i\_{SC}
\\\[8pt]
$$

with

$$
Q\_T = \int i\_{SC} , dt \\\[8pt]
$$

To represent the self-discharge phenomenon, the supercapacitor electric charge is modified as follows (when *i*<sub>*SC*</sub> = 0):

$$
Q\_T = \int i\_{\text{self},i\_s} , dt \\\[8pt]
$$

where

$$
i\_{\text{self},i\_s} =
\left{
\begin{array}{l}
\frac{C r\_{a1}}{1 + s R\_s C\_T}
\quad \text{if } t - t\_{oc} \le t\_3 \\\[8pt]

\frac{C r\_{a2}}{1 + s R\_s C\_T}
\quad \text{if } t\_3 < t - t\_{oc} \le t\_4 \\\[8pt]

\frac{C r\_{a3}}{1 + s R\_s C\_T}
\quad \text{if } t - t\_{oc} > t\_4
\end{array}
\right.
\\\[8pt]
$$

The constants *α1*, *α2*, and *α3* are the rates of change of the supercapacitor voltage during time intervals (*toc*, *t3*), (*t3*, *t4*), and (*t4*, *t5*) respectively, as shown in the figure:

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

<table data-header-hidden><thead><tr><th width="249.7777099609375"></th><th></th></tr></thead><tbody><tr><td><strong>Variable</strong></td><td><strong>Description</strong></td></tr><tr><td>A<sub>i</sub></td><td>Interfacial area between electrodes and electrolyte (m<sup>2</sup>)</td></tr><tr><td>c</td><td>Molar concentration (mol/m<sup>3</sup>) equal to c = 1/(8N<sub>A</sub>r<sup>3</sup>)</td></tr><tr><td>r</td><td>Molecular radius (m)</td></tr><tr><td>F</td><td>Faraday constant</td></tr><tr><td>i<sub>sc</sub></td><td>Supercapacitor current (A)</td></tr><tr><td>V<sub>sc</sub></td><td>Supercapacitor voltage (V)</td></tr><tr><td>C<sub>T</sub></td><td>Total capacitance (F)</td></tr><tr><td>R<sub>sc</sub></td><td>Total resistance (ohms)</td></tr><tr><td>N<sub>e</sub></td><td>Number of layers of electrodes</td></tr><tr><td>N<sub>A</sub></td><td>Avogadro constant</td></tr><tr><td>N<sub>p</sub></td><td>Number of parallel supercapacitors</td></tr><tr><td>N<sub>s</sub></td><td>Number of series supercapacitors</td></tr><tr><td>Q<sub>T</sub></td><td>Electric charge (C)</td></tr><tr><td>R</td><td>Ideal gas constant</td></tr><tr><td>d</td><td>Molecular radius</td></tr><tr><td>T</td><td>Operating temperature (K)</td></tr><tr><td>ε</td><td>Permittivity of material</td></tr><tr><td>ε<sub>0</sub></td><td>Permittivity of free space</td></tr></tbody></table>

## Ports

#### Conserving

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

#### Output

<table data-header-hidden><thead><tr><th width="250.4444580078125"></th><th></th></tr></thead><tbody><tr><td><strong>m</strong> — Measurement signals<br>Vector of three elements</td><td>Measurement signals. You can demultiplex these signals using the Bus Selector block.</td></tr></tbody></table>

| **Signal** | **Definition**                               | **Units** | **Symbol** |
| ---------- | -------------------------------------------- | --------- | ---------- |
| 1          | Supercapacitor current                       | A         | Current    |
| 2          | Supercapacitor voltage                       | V         | Voltage    |
| 3          | State of charge (SOC), in the range \[0,100] | %         | SOC        |

The SOC for a fully charged supercapacitor is 100% and for an empty supercapacitor is 0%. The SOC is calculated as:

$$
SOC =
\frac{
Q\_{\text{init}} - \displaystyle \int\_{0}^{t} i(\tau), d\tau
}{Q\_T}
\times 100
\\\[8pt]
$$

## Parameters

To edit block parameters interactively, use the Property Inspector. From the Simulink<sup>®</sup> Toolstrip, on the **Simulation** tab, in the **Prepare** gallery, select **Property Inspector**.

<table data-header-hidden><thead><tr><th width="249.55560302734375"></th><th></th></tr></thead><tbody><tr><td><strong>Rated capacitance (F)</strong> — Nominal capacitance of supercapacitor<br>99.5 (default)</td><td>Nominal capacitance of the supercapacitor, in farad.</td></tr><tr><td><strong>Equivalent DC series resistance (Ohms)</strong> — Internal resistance of supercapacitor<br>8.9e-3 (default)</td><td>Internal resistance of the supercapacitor, in ohms.</td></tr><tr><td><strong>Rated voltage (V)</strong> — Rated voltage of supercapacitor<br>48 (default)</td><td>Rated voltage of the supercapacitor, in volts. Typical rated voltage is equal to 2.7 V.</td></tr><tr><td><strong>Number of series capacitors</strong> — Number of series capacitors<br>18 (default)</td><td>Number of series capacitors to be represented.</td></tr><tr><td><strong>Number of parallel capacitors</strong> — Number of parallel capacitors<br>1 (default)</td><td>Number of parallel capacitors to represent.</td></tr><tr><td><strong>Initial voltage (V)</strong> — Initial voltage of supercapacitor<br>0 (default)</td><td>Initial voltage of the supercapacitor, in volts.</td></tr><tr><td><strong>Operating temperature (Celsius)</strong> — Operating temperature of supercapacitor<br>25 (default)</td><td>Operating temperature of the supercapacitor. The nominal temperature is 25° C.</td></tr></tbody></table>

#### Stern

<table data-header-hidden><thead><tr><th width="249.5555419921875"></th><th></th></tr></thead><tbody><tr><td><strong>Number of layers</strong> — Number of layers<br>1 (default)</td><td>Number of layers related to the Stern model.</td></tr><tr><td><strong>Molecular radius (m)</strong> — Molecular radius<br>1e-9 (default)</td><td>Molecular radius related to the Stern model, in meters.</td></tr><tr><td><strong>Permittivity of electrolyte material (F/m)</strong> — Permittivity of electrolyte material<br>6.0208e-10 (default)</td><td>Permittivity of the electrolyte material, in farad/meter.</td></tr><tr><td><strong>Charge current (A)</strong><br>10 (default)</td><td><p>Specify the charge current during a constant current charge test, in amperes.</p><div data-gb-custom-block data-tag="hint" data-style="danger" class="hint hint-danger"><p>Removed in R2024b.</p></div></td></tr><tr><td><strong>Voltage @ 0 s, 20 s, and 60 s [V_0, V_2, V_3] (V)</strong><br>[0.161 2.7 7.8] (default)</td><td><p>Specify the supercapacitor voltage, in volts, at 0 s, 20 s, and 60 s, when the supercapacitor is charged with a constant current equal to the value provided in the <strong>Charge current (A)</strong> parameter.</p><div data-gb-custom-block data-tag="hint" data-style="danger" class="hint hint-danger"><p>Removed in R2024b.</p></div></td></tr><tr><td><strong>Use predetermined parameters</strong></td><td><p>When this check box is selected, loads predetermined parameters of the Stern model into the mask of the block.</p><p>These parameter values have been determined from experimental tests, and they can be used as default values to represent a common supercapacitor.</p><p>Experimental validation of the model has shown a maximum error of 2% for charge and discharge when using the predetermined parameters.</p><p>Default is cleared When this check box is selected, the <strong>Number of layers</strong>, <strong>Molecular radius (m)</strong>, <strong>Permittivity of electrolyte material (F/m)</strong>, and <strong>Estimate using test data</strong> parameters appear dimmed.</p><div data-gb-custom-block data-tag="hint" data-style="danger" class="hint hint-danger"><p>Removed in R2024b.</p></div></td></tr><tr><td><strong>Estimate using test data</strong></td><td><p>When this check box is selected, you provide test data required for the estimation of the Stern model parameters. Default is cleared. This parameter is available only if the Optimization Toolbox™ is installed.</p><p>When this check box is selected, the <strong>Charge current (A)</strong> and <strong>Voltage @ 0 s, 20 s, and 60 s [V_0, V_2, V_3] (V)</strong> parameters are enabled. The <strong>Use predetermined parameters</strong>, <strong>Number of layers</strong>, <strong>Molecular radius (m)</strong>, and <strong>Permittivity of electrolyte material (F/m)</strong> parameters appear dimmed.</p><div data-gb-custom-block data-tag="hint" data-style="danger" class="hint hint-danger"><p>Removed in R2024b .</p></div></td></tr></tbody></table>

#### Self-discharge

<table data-header-hidden><thead><tr><th width="250.4444580078125"></th><th></th></tr></thead><tbody><tr><td><strong>Current prior open-circuit (A)</strong> — Current prior to open-circuit event<br>10 (default)</td><td>Current prior to an open-circuit event, in amperes.</td></tr><tr><td><strong>Voltage @ 0 s, 10 s, 100 s, and 1000 s [V_oc, V_3, V_4, V_5] (V)</strong> — Supercapacitor voltage at 0 s, 10 s, 100 s<br>[48 47.8 47.06 44.65] (default)</td><td><p>Supercapacitor voltage, in volts, at 0 s, 10 s, 100 s, and at 1000 s, when the supercapacitor is open-circuit.</p><p>Specify the corresponding current prior to open-circuit in the <strong>Current prior open-circuit (A)</strong> parameter.</p></td></tr><tr><td><strong>Simulate self-discharge</strong> selected (default)</td><td><p>When this check box is selected, you provide test data required for modeling the self-discharge phenomenon.</p><div data-gb-custom-block data-tag="hint" data-style="danger" class="hint hint-danger"><p>Removed in R2024b.</p></div></td></tr><tr><td><strong>Plot charge characteristics</strong></td><td><p>When this check box is selected, the block plots a figure containing the charge curves at the specified charge currents and time units. Default is cleared.</p><div data-gb-custom-block data-tag="hint" data-style="danger" class="hint hint-danger"><p>Removed in R2024b.</p></div></td></tr><tr><td><strong>Charge current [i_1, i_2, i_3, ...] (A)</strong></td><td><p>Specify the charge currents, in amperes, used to plot the charge characteristics. Default is [10 20 100 500].</p><div data-gb-custom-block data-tag="hint" data-style="danger" class="hint hint-danger"><p>Removed in R2024b.</p></div></td></tr><tr><td><strong>Time units</strong></td><td><p>Specify the time units (seconds, minutes, hours) used to plot the charge characteristics. Default is sec.</p><div data-gb-custom-block data-tag="hint" data-style="danger" class="hint hint-danger"><p>Removed in R2024b.</p></div></td></tr></tbody></table>

## Model Assumptions

The model implementation before R2024b has the following assumptions:

* Internal resistance is assumed constant during the charge and the discharge cycles.
* The model does not take into account temperature effect on the electrolyte material.
* No aging effect is taken into account.
* Charge redistribution is the same for all values of voltage.
* The block does not model cell balancing.
* Current through the supercapacitor is assumed to be continuous.

## Examples

The parallel\_battery\_SC\_boost\_converter example shows a simple hybridization of a supercapacitor with a battery.

The supercapacitor is connected to a buck/boost converter and the battery is connected to a boost converter. The DC bus voltage is equal to 42V.

The converters are doing power management.

The battery power is limited by a rate limiter block, therefore the transient power is supplied to the DC bus by the supercapacitor.

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

\[1] Oldham, K. B. “A Gouy-Chapman-Stern model of the double layer at a (metal)/(ionic liquid) interface.” *J. Electroanalytical Chem*. Vol. 613, No. 2, 2008, pp. 131–38.

\[2] Xu, N., and J. Riley. “Nonlinear analysis of a classical system: The double-layer capacitor.” *Electrochemistry Communications*. Vol. 13, No. 10, 2011, pp. 1077–81.

\[3] Zubieta, L. and R. Bonert. *"Characterization of Double-Layer Capacitors for Power Electronics Applications."* IEEE Transactions on Industry Applications, Vol. 36, No. 1, 2000, pp. 199-205.


---

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