# Supercapacitor (`supercap`)

> A very large capacitor with series resistance, leakage and a slow inner branch.

![supercap](https://voltecx-web.nguyenvanqui291.workers.dev/docs/reference/img/supercap.svg)

[Component reference](https://voltecx-web.nguyenvanqui291.workers.dev/docs/reference/) · [繁體中文](https://voltecx-web.nguyenvanqui291.workers.dev/zh/docs/reference/passive/supercap/)

**Group:** Passive · **Kind:** `{"kind":"supercap"}`

## When to use it

Use it for short power bursts, backup power, regenerative braking and smoothing a battery current. For an ordinary capacitor, use Capacitor.

## Pins

| Pin | Domain | Meaning |
|---|---|---|
| `p` | electrical | Positive terminal |
| `n` | electrical | Negative terminal |

## Common parameters

- `c`: Capacitance (Default: required)
- `esr`: ESR: small resistance in series with it (Default: 0)
- `v0`: Initial voltage; the voltage across it at the start (Default: 0)
- `rleak`: Resistance that lets charge leak away (Default: optional (off))

## Parameters

| Key | Unit | Default | Typical range | Description |
|---|---|---|---|---|
| `c` | F | required |  | Capacitance |
| `v0` | V | 0 |  | Initial voltage; the voltage across it at the start |
| `esr` | Ω | 0 |  | ESR: small resistance in series with it |
| `rleak` | Ω | optional (off) |  | Resistance that lets charge leak away |
| `r2` | Ω | optional (off) |  | Resistance of the slow charge branch |
| `c2` | F | optional (off) |  | Capacitance of the slow charge branch |

_Parameter descriptions are in English in both languages._

**Use for:** Power bursts · Backup power · Regenerative braking

**Not for:** Decoupling and filters → [`capacitor`](https://voltecx-web.nguyenvanqui291.workers.dev/docs/reference/passive/capacitor/) · Long-term energy storage → [`battery`](https://voltecx-web.nguyenvanqui291.workers.dev/docs/reference/sources/battery/)

## Formulas

| Formula | Equation | Source |
|---|---|---|
| Usable energy down to vmin | E = ½·c·(v² − vmin²) | Hayt, Kemmerly & Durbin, Engineering Circuit Analysis, 8th ed. (2012), ch. 7 (energy stored in a capacitor) |
| Voltage drop on esr | Δv = i·esr | Hayt, Kemmerly & Durbin, Engineering Circuit Analysis, 8th ed. (2012), ch. 2 (Ohm's law) |
| Constant-current discharge time | t = c·(v − vmin − i·esr) / i | Hayt, Kemmerly & Durbin, Engineering Circuit Analysis, 8th ed. (2012), ch. 7 (i = C·dv/dt) |

## Quick check

Inputs:

- `c`: Capacitance = 100 F, `c`
- `v`: Start voltage = 2.7 V, `v0`
- `vmin`: Lowest usable voltage = 1.35 V
- `i`: Discharge current = 10 A
- `esr`: Series resistance = 10m Ω, `esr`

Outputs:

- `energy`: Usable energy = `0.5*c*(v^2 - vmin^2)` J
- `drop`: Voltage drop on esr = `i*esr` V
- `tdis`: Discharge time = `c*(v - vmin - i*esr)/i` s

## Model logic

- From p it is an internal current meter (the part's current), esr, then c to n, with rleak across c; zero esr or unset rleak leaves them out.
- With both r2 and c2 set, the slow branch r2 in series with c2 sits across c; setting only one of them is refused.
- c and c2 both start at v0, so the slow branch moves charge only after the run changes the voltage.
- c is constant: no voltage dependence, temperature, rated-voltage check or cell balancing is modelled.

## Model

From p, the parts are esr, then the capacitance c to n, with rleak across c. When r2 and c2 are set, a slow branch (r2 in series with c2) also sits across c, so charge moves inside the part after a fast charge, as in the multi-branch model of Zubieta and Bonert (2000). Every capacitance starts at v0. The current of the part named like the supercapacitor is the current into p. The capacitance does not change with voltage here.

## Common mistakes

- c is in farad, so 100 means 100 F, not 100 mF. Write the prefix when you mean a smaller value.
- Charging a large capacitance from a voltage source without esr draws a huge current spike. Set esr or a source resistance.

## Datasheet and sources

c is the rated capacitance, esr the DC series resistance, and rleak follows from the leakage current: rleak = rated voltage / leakage current. Take r2 and c2 from the slow voltage drift after a charge, if the datasheet shows it.

## Example

Open the example with the command `file.openExample` and the name `demo:supercap`.

---
Generated by `cargo xtask reference` from the usage texts and parameter specs. Do not edit by hand.
