Initial conditions in the circuit can be set in two ways. First we can put an .ic statement,
which defines node voltages at time
Or second we can set an ic parameter of a device
instance (for example capacitor or inductor), which defines initial instance voltage or current.
Let us examine a simple circuit with one capacitor and two resistances.
r1 1 0 1
r2 2 0 1
c1 1 2 1
If we define an initial state with only one nodal voltage by .ic statement
.ic v(1)=1V
then the initial voltage
.ic v(1)=2V v(2)=1V
Again the initial voltage on capacitor c1 is 1V. Both examples are equivalent to defining initial capacitor voltage by
c1 1 2 1 ic=1V
If there is a nonsense like
c1 1 2 1 ic=1V
.ic v(1)=10V v(2)=1V
then ic parameter at element instance definition is considered.
So the initial capacitor voltage
All four results are wrong. The only way to get a correct result for
.ic v(1)=0.5V v(2)=-0.5V
In the first time point
t = t1, n = 1
un - 1 = ut = 0
... initial capacitor voltage, in our case 1V
Dt = t1 - t0 = t1
Solving this circuit gives a correct results for
So if the user wants to have a correct initial value in the resulting plot (solution vectors), than he has to include an appropriate .ic statement or he has to set the icstep simulator parameter. In the first case he has to know the initial node voltages, which is not usual. In the second case the simulator will work transparently and the initial node voltages will be at least very near to the right ones. In our example circuit we would reach this goal by issuing following line
.options icstep=1e9
icstep simulator parameter can also be changed through set command like all other parameters.