Variable capacitor

Capacitance set by the input signal.

  • signal
  • electrical
  • Modelica Standard Library
  • 3 ports
  • 1 parameter
BlockVariable capacitorKindvariableCapacitorLibraryElectrical

Description

A capacitor whose capacitance is set by an input signal. The charge is capacitance times voltage, so changing the capacitance at fixed charge changes the voltage.

Example

Variable parts A resistor, an inductor, and a capacitor whose values follow signals, and a potentiometer.

R = 10 + 5 sin 2πtDC 10 VVariable resistori RGround RL = 2 + sin(πt/2)DC 1 VVariable inductori LGround LC₀ = 1 mF+1 mF at 0.5 sCDC 1 mAVariable capacitorv CGround CWiper positionDC 10 V (pot)PotentiometerWiper voltageGround P
In Gradara, select a Variable capacitor block and press F1, then choose Open example. It opens as a new model in My models, ready to run.

Also in this example:DC voltageVoltage sensorCurrent sensorSumConstantStepGroundRampSine waveVariable resistorVariable inductorPotentiometerDC current

Ports

Inputs 1

  • C

    Capacitance, in farads. Must stay 0 or more.

Conserving terminals 2

  • +p

    Positive pin. Current into p is counted as positive.

  • −n

    Negative pin.

Parameters

  • Minimum capacitanceCmin1e-12 F

    ≥ 0

    Lower bound on the capacitance used in the equations, in farads. Keeps the model solvable when the input reaches 0.

Equations

Modelica
v = p.v − n.v, i = p.i, p.i + n.i = 0
Q = max(C, Cmin) · v
i = dQ/dt

Implementation

Modelica Standard Library 4.1.0Modelica.Electrical.Analog.Basic.VariableCapacitor
MSL documentation

Assumptions and limitations

  • The simulation stops with an error if the input goes negative.
  • The initial voltage is not fixed by the block.

See also

Select a block in Gradara and press F1 to open its page offline.