Simulation of tuned circuit with initial inductor current gives flat zero

inductorsimulationspice

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 
.end

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.

Best Answer

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.