I'm playing with ngspice, and wondered if I could get a signal out of a simple RLC circuit using an inductor with initial current. There are no power or current sources. The results aren't what I expect, probably because I did something blatantly stupid and not seeing it.

My .cir file:

simple RLC with initial inductor current
C1  1 0   22uF
L1  1 0   6mH    IC=1A
R1  1 0   10kOhm 

Using the ngspice command line,

tran 100us 20ms
plot v(1)

But the plot is flat zero. Why is that?

I expect the voltage at node 1 to increase from 0V at t=0, peak, and continue on as an exponentially decaying sine. My tran timing may be whacky off, but I should see something, maybe just a linear initial rise, or a spike.

  • \$\begingroup\$ try running the analysis for 1 second and see what you get. \$\endgroup\$
    – Andy aka
    Nov 29, 2013 at 10:25

1 Answer 1


Found the problem. Need to have "UIC" in the "tran" line.

.tran 50us 30ms 0s  500us UIC

works fine.

Guess I need to spend more time with the spice user manual.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.