Main Content

Capacitor

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

  • Capacitor block

Libraries:
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=CdVdt

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:

ε'=ε+εsε1+ω2τ2

ε''=(εsε)ωτ1+ω2τ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

τi=q+Cs(ατν˙+ν),

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:

τ=DF1DF2(ω22ω12)+DF12DF22(ω22ω12)2+4ω1ω2(DF2ω2DF1ω1)(DF1ω2DF2ω1)2ω1ω2(DF2ω2DF1ω1)

α=ω1τDF1ω1τ(1+DF1ω1τ),

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.

Model Thermal Effects

Since R2024a

You can expose the thermal port to observe the power loss and the change in temperature of the capacitor and to set the thermal mass. To expose the thermal port, in the Thermal section, select the Model thermal port parameter.

Exposing the thermal port also enables a parameter, Temperature, in the Operating Limits section, that defines the maximum valid temperature for the block operation.

Use the Variables tab to set the initial temperature target.

Faults

To model a fault in the Capacitor block, in the Faults section, click the Add fault hyperlink next to the fault that you want to model. In the Add Fault window, specify the fault properties. For more information about fault modeling, see Fault Behavior Modeling and Fault Triggering.

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 – (FaultedValueUnfaultedValue) · 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.

If you want to trigger a fault at a specific time, in the Fault Inspector window, set Trigger type to Timed. If you want to determine whether a system fails and, if so, when it fails, in the Fault Inspector window, set Trigger type to Behavioral.

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.

The Temperature variable lets you specify a high-priority target for the temperature at the start of simulation. To enable this variable, in the Thermal section, select the Model thermal port parameter. (since R2024a)

Examples

Ports

Conserving

expand all

Electrical conserving port associated with the capacitor positive voltage.

Electrical conserving port associated with the capacitor negative voltage.

Since R2024a

Thermal conserving port associated with the capacitor thermal mass.

Parameters

expand all

Main

Select the type of capacitor:

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

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

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

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

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

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

Since R2024a

Maximum permissible temperature. If the temperature of the capacitor is greater than this value, the block throws a warning or an error.

Dependencies

To enable this parameter, in the Thermal section, select the Model thermal port parameter.

Thermal

Since R2024a

Option to model a thermal port in the Capacitor block.

Since R2024a

Thermal mass associated with the thermal port H. It represents the energy required to raise the temperature of the thermal port by one degree.

Dependencies

To enable this parameter, select the Model thermal port parameter.

Faults

Option to model a fault in the Capacitor block.

To add a fault, click the Add fault hyperlink.

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.

Dependencies

To enable this parameter, add a fault to the Capacitor block by clicking the Add fault hyperlink in the Capacitor fault parameter.

After you create the fault, you can change the properties in the Fault Inspector window. When you open a block that has a fault, the Open Fault Inspector hyperlink appears instead of the Add fault hyperlink. For an example that shows how to include faults, see Analyze a DC Armature Winding Fault.

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

Dependencies

To enable this parameter, add a fault to the Capacitor block by clicking the Add fault hyperlink in the Capacitor fault parameter.

After you create the fault, you can change the properties in the Fault Inspector window. When you open a block that has a fault, the Open Fault Inspector hyperlink appears instead of the Add fault hyperlink. For an example that shows how to include faults, see Analyze a DC Armature Winding Fault.

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

Dependencies

To enable this parameter, add a fault to the Capacitor block by clicking the Add fault hyperlink in the Capacitor fault parameter.

After you create the fault, you can change the properties in the Fault Inspector window. When you open a block that has a fault, the Open Fault Inspector hyperlink appears instead of the Add fault hyperlink. For an example that shows how to include faults, see Analyze a DC Armature Winding Fault.

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

Dependencies

To enable this parameter, add a fault to the Capacitor block by clicking the Add fault hyperlink in the Capacitor fault parameter.

After you create the fault, you can change the properties in the Fault Inspector window. When you open a block that has a fault, the Open Fault Inspector hyperlink appears instead of the Add fault hyperlink. For an example that shows how to include faults, see Analyze a DC Armature Winding Fault.

Simulation time at which the block enters the faulted state.

Dependencies

To enable this parameter, in the Fault Inspector window, set Trigger Type to Timed.

This parameter appears in the Trigger section of the Fault Inspector window. For more information, see Set Fault Triggers.

Since R2024a

Maximum permissible temperature. If the temperature value is outside this value for longer than the Time to fail when exceeding maximum temperature parameter value, then the block starts entering the fault state.

Dependencies

To enable this parameter, in the Fault Inspector window, set Trigger Type to Behavioral.

This parameter appears in the Trigger section of the Fault Inspector window. For more information, see Set Fault Triggers.

Since R2024a

Maximum length of time that the temperature can be outside the permissible temperature range without triggering the fault.

Dependencies

To enable this parameter, in the Fault Inspector window, set Trigger Type to Behavioral.

This parameter appears in the Trigger section of the Fault Inspector window. For more information, see Set Fault Triggers.

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

To enable this parameter, in the Fault Inspector window, set Trigger Type to Behavioral.

This parameter appears in the Trigger section of the Fault Inspector window. For more information, see Set Fault Triggers.

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

Dependencies

To enable this parameter, in the Fault Inspector window, set Trigger Type to Behavioral.

This parameter appears in the Trigger section of the Fault Inspector window. For more information, see Set Fault Triggers.

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.

Version History

Introduced in R2016a

expand all

See Also

| |