# Capacitor

Capacitor model including nonlinearity, tolerance, operational limits, and fault behavior

Passive Devices

## Description

The Capacitor block lets you model linear and nonlinear (table-based) 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 Enable table-based capacitance parameter to ```Yes - use table-based capacitance``` 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```.

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

### 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 / τ)

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 (Simscape).

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

## Parameters

### Main

Enable table-based capacitance

Select the type of capacitor:

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

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

Capacitance

The nominal capacitance value for linear capacitor. This parameter is visible only if you select `No - use constant capacitance` for the Enable table-based capacitance parameter. Capacitance value must be greater than zero. The default value is `1` µF.

Capacitance values

The vector of capacitance values, for table lookup based on the corresponding voltage value. This parameter is visible only if you select `Yes - use table-based capacitance` for the Enable table-based capacitance parameter. Capacitance values must be greater than 0. The vector length must be the same as the voltage vector length. The default value is ```[1e-5 1e-6]``` F.

Corresponding voltage values

The input vector of voltage values for table-based capacitance calculation. This parameter is visible only if you select ```Yes - use table-based capacitance``` for the Enable table-based capacitance parameter. The vector length must be greater than or equal to 2, and the values must be strictly monotonic, either increasing or decreasing. The default value is ```[0 10]``` V.

Symmetric C-V table

This parameter is visible only if you select ```Yes - use table-based capacitance``` for the Enable table-based capacitance 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.

Capacitance tolerance (%)

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

Tolerance application

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.

Tolerance distribution

This parameter is visible only if you select ```Random tolerance``` for the Tolerance application parameter. Select the distribution type:

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

• `Gaussian` — Gaussian distribution.

Number of standard deviations for quoted tolerance

Number of standard deviations for calculating the Gaussian random number. This parameter is visible only if you select `Gaussian` for the Tolerance distribution parameter. The default value is `4`.

Series resistance

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 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. The default value is `1` µΩ.

Parallel conductance

Parallel leakage path associated with the capacitor. For capacitors connected in series, the presence of a small parallel conductance can help with convergence. The default value is `0` 1/Ω.

### Operating Limits

Enable 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. The default value is `No`.

Reporting when operating limits exceeded

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.

Working voltage range

Range of voltage values allowed for normal block operation, specified as a vector of size 2. The default value is ```[-25 25]``` V.

Power rating

Maximum instantaneous power dissipation in the resistance and conductance elements associated with the capacitor. The default value is `1` W.

### Faults

Enable faults

Select `Yes` to enable faults modeling. The associated parameters become visible on the Faults tab 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`.

Reporting when a fault occurs

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.

Faulted capacitance as % of unfaulted

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.

Faulted series resistance

Equivalent series resistance of the capacitor when the block is in the faulted state. The default value is `1` mΩ.

Faulted parallel conductance

Parallel leakage conductance of the capacitor when the block is in the faulted state. The default value is `0` 1/Ω.

Fault transition time constant

Time constant associated with the transition to the faulted state, as described in Faults. The default value is `1` ms.

Enable temporal fault trigger

Select `Yes` to enable time-based fault triggering. The default value is `No`.

Simulation time for a fault event

Set the simulation time at which you want the block to start entering the fault state. This parameter is visible only if the Enable temporal fault trigger parameter is set to `Yes`. The default value is `1` s.

Enable behavioral fault trigger

Select `Yes` to enable behavioral fault triggering. The default value is `No`.

Permissible voltage range

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. This parameter is visible only if the Enable behavioral fault trigger parameter is set to `Yes`. The default value is ```[-100 100]``` V.

Time to fail when exceeding voltage range

Set the maximum length of time that the voltage can be outside the permissible voltage range without triggering the fault. This parameter is visible only if the Enable behavioral fault trigger parameter is set to `Yes`. The default value is `1` s.

## Ports

The block has the following ports:

`+`

Positive electrical port

`-`

Negative electrical port