0
\$\begingroup\$

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! Circuit Schematic The notation D(V(V1))seems to still work here Voltage response of V(V1)

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. enter image description here enter image description here

\$\endgroup\$
3
  • \$\begingroup\$ 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.) \$\endgroup\$
    – jonk
    Commented Jul 9, 2019 at 6:30
  • \$\begingroup\$ 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. \$\endgroup\$
    – Huisman
    Commented Jul 9, 2019 at 6:40
  • \$\begingroup\$ Thank you Huisman! Yep I have set all the parallel and series resistance to be zero. \$\endgroup\$
    – LSY
    Commented Jul 9, 2019 at 7:01

1 Answer 1

0
\$\begingroup\$

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.

\$\endgroup\$
5
  • \$\begingroup\$ 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. \$\endgroup\$
    – LSY
    Commented Jul 9, 2019 at 7:00
  • \$\begingroup\$ @LSY where did you get that figure for the initial current in L1? \$\endgroup\$
    – jonk
    Commented Jul 9, 2019 at 7:03
  • \$\begingroup\$ You should turn off the UIC option. \$\endgroup\$
    – Huisman
    Commented Jul 9, 2019 at 7:16
  • \$\begingroup\$ @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. \$\endgroup\$
    – LSY
    Commented Jul 9, 2019 at 7:39
  • \$\begingroup\$ @jonk Thank you!! It works now. I set I(L1) = -0.5A so I(L1)+ I(R1)= 0 \$\endgroup\$
    – LSY
    Commented Jul 9, 2019 at 7:40

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.