
A simple series RLC circuit with a voltage source Vs.
The RLC Circuit with Function Generator model simulates a resistor R, a capacitor C, and an inductor L in series with either a sinusoidal or a square wave source voltage Vs(t) and plots the time dependence of the voltage drops across the source, the resistor, and the capacitor. The differential equation for the charge on the capacitor Q can be found by applying Kirchhoff's loop rule.

Because we are solving a dynamical model, transients are observed when the program is run. The resistance, capacitance, inductance and source frequency can also be varied at runtime.
Robert A. Morse, "Conceptualizing ideal circuit elements in the AP Physics C syllabus," The Physics Teacher 43 (8), pages 540-543 (2005)
Yaakov Kraftmakher, "Demonstrations with an LCR Circuit," The Physics Teacher, 49(3) pages 168-170 (2011).
The RLC Circuit with Function Generator model was developed by Wolfgang Christian using version 4.3 of the Easy Java Simulations (EJS) authoring and modeling tool. You can examine and modify a compiled EJS model if you run the program by double clicking on the model's jar file. Right-click within the running program and select "Open EJS Model" from the pop-up menu to copy the model's XML description into EJS. You must, of course, have EJS installed on your computer.
Information about Ejs is available at: <http://www.um.es/fem/Ejs/> and in the OSP comPADRE collection <http://www.compadre.org/OSP/>.