Hi,

Currently, I'm trying to represent some circuits to their differentials equations. These circuits have some non-linearities which I have some problems, not in ngspice, but in Matlab or Octave when I try to solve them with numerical methods. For instance consider this circuit:

V1 1 0 SIN(0 10 10)

L1 1 2 10u

B1 2 0 V=(1/i(V1))*v(6)

B3 0 6 I=abs(i(V1))

C1 6 0 10u

R1 6 0 10

.tran 0.1us 100ms UIC

.end

Translating this circuit to differentials equations gives

1) dx/dt = -x/(RC) + abs(y)/C

2) dy/dt = -x/(abs(x)*L) + V1/L

x is the capactor's voltage and y is the inductor's current. If I try to solve these equations on Matlab, It will give an error because the second equation will have a division by zero with initial conditions set as zero. My question is: Does ngspice set initial conditions different from zero in order to simulate the circuit? because I think the circuit's initial conditions should be zero.

Thanks for taking the time to read this, I know it is a long post, but I really want to know how ngspice works.