This Demonstration shows the voltage across a capacitor (blue curve) in an RC circuit with variable resistance and capacitance. The voltage source that powers the circuit is a positive square wave (red curve) with a period of
![](HTMLImages/index.en/1.gif)
, where
![](HTMLImages/index.en/2.gif)
, the time constant of the circuit. The times for the capacitor to be fully charged or fully discharged are both assumed to equal
![](HTMLImages/index.en/3.gif)
. Use the "time" slider to control the progress of the simulation from 0 to 120 seconds, the "swave" slider to adjust the voltage (in volts) of the positive square wave, the "resistance" slider to change the value of the resistance
![](HTMLImages/index.en/4.gif)
(in ohms) of the resistor and the "capacitance" slider to modify the capacitance
![](HTMLImages/index.en/5.gif)
(in microfarads,
![](HTMLImages/index.en/6.gif)
) of the capacitor. The colored grids in the top part of the plot area display the current values of time, voltage vcapacitor across the capacitor, time constant
![](HTMLImages/index.en/7.gif)
of the circuit, period
![](HTMLImages/index.en/8.gif)
and frequency
![](HTMLImages/index.en/9.gif)
(in mHz) of the oscillations and the number of cycles that can be seen in the plot range.