I am puzzled by a charge conservation problem of capacitor, and tried a spectre simulation to solve it. What I did is to put an ideal capacitor and an ideal inductor in parallel, set an initial current in inductor, and ran a transient. The tank oscillates, of cause, but with a decaying magnitude. Then I tried the code in
http://www.designers-guide.org/Modeling/varactors.pdfby replacing the nonlinear q = c0∗v + c1∗v1∗ln(cosh((v – v0)/v1)); to a linear q=c0*v. It turns out that this model has the same result as the schematic view result. So I assume this model has same problem with the schematic model, NOT conserving charge. What is the solution then? How to model a charge conserving capacitor?
Thanks~~~~
Ji