For RLC and diode circuit:V_C=V_{diode}+V_L+V_R,
where V_L=L\frac{dI}{dt}, V_R=IR,V_C=Q_C/C , I=-\frac{dQ_C}{dt}

For example:
At t=0; V_L=V_C-I R-V_{diode}=20-0.12*(9+1)-0.8
this can be used to calculate \frac{dI}{dt}=V_L/L which will give us I(t+dt).
With I(t) we can calculate Q_C(t+dt)=Q_C(t=0)-I dt
We can repeat the above step to calculate the charge Q(t+dt) and current I(t+dt) for each time step t.

/htdocs/ntnujava/ejsuser/2/users/ntnu/fkh/RLCdiode_pkg/RLCdiode.propertiesFull screen applet or Problem viewing java?Add http://www.phy.ntnu.edu.tw/ to exception site list
Press the Alt key and the left mouse button to drag the applet off the browser and onto the desktop. This work is licensed under a Creative Commons Attribution 2.5 Taiwan License
Download EJS jar file(1379kB):double click downloaded file to run it. (56 times by 31 users) , Download EJS source (12 times by 9 users) View EJS source