# Capacitor

Linear or nonlinear capacitor with optional tolerance, operational limits and fault behavior

• Library:
• Simscape / Electrical / Passive

• ## Description

The Capacitor block lets you model linear, nonlinear (table-based), and frequency-dependent capacitors, including polar capacitors. Optionally, you can also model the following effects:

You can turn these modeling options on and off independently of each other. When all the additional options are turned off, the component behavior is identical to the Simscape™ Foundation library Capacitor block.

In its simplest form, the Capacitor block models a linear capacitor, described with the following equation:

`$I=C\frac{dV}{dt}$`

where:

• I is the current.

• C is the capacitance.

• V is the voltage.

• t is the time.

To model a nonlinear or polar capacitor, set the Capacitance model parameter to `Lookup table` and provide a lookup table of capacitance-voltage values:

• For polar capacitors, where this lookup table is asymmetric with respect to the applied terminal voltage, set the Symmetric C-V table parameter to ```No - use C-V data as-is```.

• For other types of nonlinear capacitor, ensure symmetry of the capacitance with regards to the applied terminal voltage by setting the Symmetric C-V table parameter to ```Yes - use voltage magnitude when computing C```.

To model a frequency-dependent capacitor with resistive and dielectric losses, set the Capacitance model parameter to ```Dielectric relaxation (Debye)```. The Debye relaxation model considers a collection of noninteracting dipoles in the frequency domain. The result is in terms of a complex permittivity. The real (𝜖′) and imaginary (𝜖′′) parts of the complex permittivity are given by the equations:

`$\epsilon \text{'}={\epsilon }_{\infty }+\frac{{\epsilon }_{s}-{\epsilon }_{\infty }}{1+{\omega }^{2}{\tau }^{2}}$`

`$\epsilon \text{'}\text{'}=\frac{\left({\epsilon }_{s}-{\epsilon }_{\infty }\right)\omega \tau }{1+{\omega }^{2}{\tau }^{2}},$`

where 𝜔 is the radial frequency, 𝜖 is the real permittivity at very high frequency, 𝜖𝑠 is the real permittivity at low frequency and 𝜏 is the relaxation time constant.

In the time-domain, the characteristic equation for a capacitor in the Debye model is

`$\tau i=-q+{C}_{s}\left(\alpha \tau \stackrel{˙}{\nu }+\nu \right),$`

where 𝐶𝑠 is the low-frequency capacitance, 𝛼 = 𝜖/𝜖𝑠, 𝑞 is the charge, 𝑖 is the current and 𝑣 is the voltage across the capacitor.

Most datasheets do not provide explicit values for the complex permittivity nor for the relaxation time; however, often the dissipation factor is provided at two frequencies. The parameters 𝛼 and 𝜏 may be derived from these values as described by the equations:

`$\tau =\frac{D{F}_{1}D{F}_{2}\left({\omega }_{2}^{2}-{\omega }_{1}^{2}\right)+\sqrt{D{F}_{1}^{2}D{F}_{2}^{2}{\left({\omega }_{2}^{2}-{\omega }_{1}^{2}\right)}^{2}+4{\omega }_{1}{\omega }_{2}\left(D{F}_{2}{\omega }_{2}-D{F}_{1}{\omega }_{1}\right)\left(D{F}_{1}{\omega }_{2}-D{F}_{2}{\omega }_{1}\right)}}{2{\omega }_{1}{\omega }_{2}\left(D{F}_{2}{\omega }_{2}-D{F}_{1}{\omega }_{1}\right)}$`

`$\alpha =\frac{{\omega }_{1}\tau -D{F}_{1}}{{\omega }_{1}\tau \left(1+D{F}_{1}{\omega }_{1}\tau \right)},$`

where 𝜔1 and 𝜔2 are two different frequencies, and DF1 and DF2 are the dissipation factors calculated at said frequencies, respectively.

The argument of the square root must be positive for a valid parameterization in the Debye model.

### Tolerances

You can apply tolerances to the nominal value you provide for the Capacitance parameter. Datasheets typically provide a tolerance percentage for a given capacitor type. The table shows how the block applies tolerances and calculates capacitance based on the selected Tolerance application option.

OptionCapacitance Value

```None — use nominal value```

C

`Random tolerance`

Uniform distribution: C · (1 – tol + 2· tol· `rand`)

Gaussian distribution: C · (1 + tol · `randn` / nSigma)

```Apply maximum tolerance value```

C · (1 + tol )

```Apply minimum tolerance value```

C · (1 – tol )

In the table,

• C is the Capacitance parameter value, nominal capacitance.

• tol is the fractional tolerance, Capacitance tolerance (%) /100.

• nSigma is the value you provide for the Number of standard deviations for quoted tolerance parameter.

• `rand` and `randn` are standard MATLAB® functions for generating uniform and normal distribution random numbers.

Note

If you choose the `Random tolerance` option and you are in "Fast Restart" mode, the random tolerance value is updated on every simulation if at least one between the fractional tolerance, tol, or the Number of standard deviations for quoted tolerance, nSigma, is set to Run-time and is defined with a variable (even if you do not modify that variable).

### Operating Limits

You can specify operating limits in terms of maximum working voltage and the maximum (instantaneous) power dissipation in the series resistance and in the parallel conductance of the capacitor.

For polar capacitors, you can define the working voltage range in such a way that the block provides a warning, or an error, if the polarity of the applied voltage becomes incorrect.

When an operating limit is exceeded, the block can either generate a warning or stop the simulation with an error. For more information, see Operating Limits.

### Faults

Instantaneous changes in capacitor parameters are unphysical. Therefore, when the Capacitor block enters the faulted state, the capacitance, resistance, and conductance transition to their faulted values over a period of time, according to the following formula:

 `CurrentValue` = `FaultedValue` – ( `FaultedValue` – `UnfaultedValue` ) · `sech` (∆t / τ) (1)

where:

• ∆t is the time since the onset of the fault condition.

• τ is the user-defined time constant associated with the fault transition.

The block can trigger the start of fault transition:

• At a specific time

• When terminal voltage is outside the permissible voltage range for longer than a specific time interval

You can enable or disable these trigger mechanisms separately, or use them together if more than one trigger mechanism is required in a simulation. When more than one mechanism is enabled, the first mechanism to trigger the fault transition takes precedence. In other words, component fails no more than once per simulation.

You can also choose whether to issue an assertion when a fault occurs, by using the Reporting when a fault occurs parameter. The assertion can take the form of a warning or an error. By default, the block does not issue an assertion.

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

The Capacitor voltage variable lets you specify a high-priority target for the initial capacitor voltage at the start of simulation.

## Ports

### Conserving

expand all

Electrical conserving port associated with the capacitor positive voltage.

Electrical conserving port associated with the capacitor negative voltage.

## Parameters

expand all

### Main

Select the type of capacitor:

• `Constant` — Model a linear capacitor, with nominal capacitance defined by the Capacitance parameter value. This is the default.

• `Lookup table` — Model a nonlinear capacitor, where the nominal capacitance value changes based on the value of applied terminal voltage.

• `Dielectric relaxation (Debye)` —Model a frequency-dependent capacitor with resistive and dielectric losses.

The nominal capacitance value for linear capacitor, or the low-frequency capacitance in the Debye parameterization.

#### Dependencies

This parameter is visible only when you select `Constant` or ```Dielectric relaxation (Debye)``` for the Capacitance model parameter.

The vector of capacitance values, for table lookup based on the corresponding voltage value. Capacitance values must be greater than 0. The vector length must be the same as the voltage vector length.

#### Dependencies

This parameter is visible only when you select ```Lookup table``` for the Capacitance model parameter.

The input vector of voltage values for table-based capacitance calculation. The vector length must be greater than or equal to 2, and the values must be strictly monotonic, either increasing or decreasing.

#### Dependencies

This parameter is visible only when you select ```Lookup table``` for the Capacitance model parameter.

Specify how to use the table data:

• ```Yes - use voltage magnitude when computing C``` — Use this option to ensure symmetry of the capacitance with regards to the applied terminal voltage. This is the default.

• `No - use C-V data as-is` — Use this option to model polar capacitors. For example, with default parameter values for table-based capacitance, applied voltage of –10 V would produce nominal capacitance of 1e-6 F. However, if you select ```No - use C-V data as-is``` for the Symmetric C-V table parameter, the resulting capacitance value is 1e-5 F, because the block uses the nearest input value for extrapolation.

#### Dependencies

This parameter is visible only when you select ```Lookup table``` for the Capacitance model parameter.

Frequencies at which the dissipation factors [DF1 DF2] are calculated, in kHz.

#### Dependencies

This parameter is visible only when you select `Dielectric relaxation (Debye)` for the Capacitance model parameter.

Ratio between the equivalent series resistance and the capacitive reactance, or the tangent of the loss angle. Dissipation factors are a common metric for capacitors.

#### Dependencies

This parameter is visible only when you select `Dielectric relaxation (Debye)` for the Capacitance model parameter.

The capacitor tolerance as defined on the manufacturer datasheet. For table-based capacitors, this tolerance is applied to the entire table at once.

Select how to apply tolerance during simulation:

• `None — use nominal value` — The block does not apply tolerance, uses the nominal capacitance value. This is the default.

• `Random tolerance` — The block applies random offset to the capacitance value, within the tolerance value limit. You can choose Uniform or Gaussian distribution for calculating the random number by using the Tolerance distribution parameter.

• `Apply maximum tolerance value` — The capacitance is increased by the specified tolerance percent value.

• `Apply minimum tolerance value` — The capacitance is decreased by the specified tolerance percent value.

Select the distribution type:

• `Uniform` — Uniform distribution. This is the default.

• `Gaussian` — Gaussian distribution.

#### Dependencies

This parameter is visible only when you select ```Random tolerance``` for the Tolerance application parameter.

Number of standard deviations for calculating the Gaussian random number.

#### Dependencies

This parameter is visible only when you select `Gaussian` for the Tolerance distribution parameter.

Simulation of some circuits may require the presence of the small series resistance. Equivalent series resistance (ESR) is sometimes specified on manufacturer datasheets. If not, you can define this resistance for a linear capacitor via the dissipation factor (DF), which is also shown on many datasheets. The relationship is `DF` = 2π· `f`· `C`· `ESR`, where `f` is signal frequency. For a Debye capacitor, the Dissipation factors (%) at f1 and f2 [DF1 DF2] are corrected for this additional series resistance prior to computing 𝛼 and 𝜏.

Parallel leakage path associated with the capacitor. For capacitors connected in series, the presence of a small parallel conductance can help with convergence.

Averaging period for power logging, in s.

Note

If this parameter is set to `0`, the output is the instantaneous power.

#### Dependencies

This parameter is visible only when you select `Dielectric relaxation (Debye)` for the Capacitance model parameter.

### Operating Limits

Select `Yes` to enable reporting when the operational limits are exceeded. The associated parameters become visible on the Operating Limits tab to let you select the reporting method and specify the operating limits in terms of power and working voltage.

Select what happens when an operating limit is exceeded:

• `Warn` — The block issues a warning. This is the default.

• `Error` — Simulation stops with an error.

Range of voltage values allowed for normal block operation, specified as a vector of size 2.

Maximum instantaneous power dissipation in the resistance and conductance elements associated with the capacitor.

### Faults

Select `Yes` to enable faults modeling. The associated Faults parameters become visible to let you select the reporting method and specify the trigger mechanism (temporal or behavioral). You can enable these trigger mechanisms separately or use them together. The default value is `No`.

Choose whether to issue an assertion when a fault occurs:

• `None` — The block does not issue an assertion. This is the default.

• `Warn` — The block issues a warning.

• `Error` — Simulation stops with an error.

Relative change in the capacitance when the block is in the faulted state, as compared to the unfaulted state. For table-based capacitances, the relative change is applied to all elements of the vector. The default value is `100`, which means that the faulted capacitance is equal to the unfaulted capacitance.

Equivalent series resistance of the capacitor when the block is in the faulted state.

Parallel leakage conductance of the capacitor when the block is in the faulted state.

Time constant associated with the transition to the faulted state, as described in Faults.

Select `Yes` to enable time-based fault triggering.

Set the simulation time at which you want the block to start entering the fault state.

#### Dependencies

This parameter is visible only when you select `Yes` for the Enable temporal fault trigger parameter.

Select `Yes` to enable behavioral fault triggering.

Specify the minimum and maximum permissible voltage. If the voltage value is outside this range for longer than the Time to fail when exceeding voltage range parameter value, then the block starts entering the fault state.

#### Dependencies

This parameter is visible only when you select `Yes` for the Enable behavioral fault trigger parameter.

Set the maximum length of time that the voltage can be outside the permissible voltage range without triggering the fault.

#### Dependencies

This parameter is visible only when you select `Yes` for the Enable behavioral fault trigger parameter.

## Version History

Introduced in R2016a