# LTspice: Including Time Derivative of a Node Voltage in Initial Condition

I am trying to simulate an RLC circuit with the initial condition that V1(0)=2 and V1'(0)=0. I used D(V(V1))=0 in my spice directive, but I don't think the condition on time derivative has actually been implemented.(D(V(V1)) is negative instead of zero at t=0) Are there any suggestions on how I should modify my initial condition? Thanks in advance for any advice!

Edits: At t = 0, d(V(V1))/dt = 0, I(C1) = 0, hence I(L1)= -I(R) = -0.5A. But the I(L1) in the plot still starts at 0, whereas I(C1) = -0.5A. I tried various values of I(L1) in the initial condition and the result remains the same.

• You know the node voltage, a priori. So you know the voltage across $C_1$ and you know the voltage across $R_1$. (You also know the voltage across $L_1$.) Since the time derivative of the node voltage is 0, what does this say about the current in $C_1$? What can you work out about the initial current, therefore, in $L_1$? (You are allowed to specify the initial conditions for an inductor's current.)
– jonk
Commented Jul 9, 2019 at 6:30
• Although in this case it doesn't matter, be aware of the (maybe unexpected) influence of the parasitic parallel and series resistance when using an inductor in LC(R) circuits. Commented Jul 9, 2019 at 6:40
• Thank you Huisman! Yep I have set all the parallel and series resistance to be zero.
– LSY
Commented Jul 9, 2019 at 7:01

I'm not entirely sure about your question. But I think you are having trouble specifying the initial condition for the first derivative of $$\V_1\$$.

If so, I don't know of a method of doing that with LTspice.

However, you are able to specify the initial conditions for any voltage node and for the current in any inductor. And that's how I'd approach this.

You know that $$\V_{1_{t=0}}=2\:\text{V}\$$. You also know that $$\\frac{\text{d}}{\text{d}\,t}\:V_{1_{t=0}}=0\:\frac{\text{V}}{\text{s}}\$$. Given this last bit, you know that the instantaneous current in $$\C_1\$$ must, by definition, also be zero. You can easily calculate the current in $$\R_1\$$, given $$\V_{1_{t=0}}=2\:\text{V}\$$. Therefore, you know the initial current in $$\L_1\$$. (You must easily see what I'm suggesting here.)

So this means you can specify this initial current in $$\L_1\$$ using the ".ic I(L1)=??" card. Yes? Try it out.

• Thank you so much for the suggestion! I tried it, but it seems like LTspice ignored this condition completely. Though I set I(L1) = -0.5A, it still starts at 0 in the plot. I have included the graphs in the question.
– LSY
Commented Jul 9, 2019 at 7:00
• @LSY where did you get that figure for the initial current in L1?
– jonk
Commented Jul 9, 2019 at 7:03
• You should turn off the UIC option. Commented Jul 9, 2019 at 7:16
• @Huisman Thanks a lot for the advice! It works now when I use .tran 0 100 and .ic V(V1) = 2 I(L1) = -0.5 LTspice doesn't allow the initial condition to be current passing through a conductor.
– LSY
Commented Jul 9, 2019 at 7:39
• @jonk Thank you!! It works now. I set I(L1) = -0.5A so I(L1)+ I(R1)= 0
– LSY
Commented Jul 9, 2019 at 7:40