0
\$\begingroup\$

enter image description here For the above question, after solving the circuit in frequency domain, I got the value of $$i_0(t) = 1.14\cos(3000t-55.3) mA $$ approximately (The calculations in the middle of steps was not approximated.)

Now, when I stimulate this in LTspice I get the following: enter image description here The peak is approximately 1.056 mA of the current. There is a slight difference between the theoretical value and the value LTspice displays.

This did not happen only in this question, but many questions, where there always is a difference of about the second digit. (For instance, 840 V vs 865 V)

The circuit that was simulated: enter image description here

So my question is, what is causing the difference and how is it possible to fix it?

\$\endgroup\$
7
  • 1
    \$\begingroup\$ LTspice puts a 1 mOhm DCR (DC resistance) in series with the inductors, if you don't specify. Can't remember at the moment but there must be a similar thing for the capacitors as well (ESR). I'm not sure if you can put 0 (zero) but at least you can try with much lower numbers (e.g. 1p). There are also parallel resistors, although they are really big they may or may not show a substantial effect. \$\endgroup\$ Commented Jan 14 at 15:13
  • \$\begingroup\$ Ohh first ime I notice that It wrote 1mOhm by default, thanks! Now I tried putting SR = 0 when right clicking on the inductor and trying but approximately the same value ~1.05mA. \$\endgroup\$
    – Nero
    Commented Jan 14 at 15:29
  • 3
    \$\begingroup\$ The simulation time step is too low. Try to increase the maximum timestep to 1us. Change tran to .tran 0 0.8 0 1u \$\endgroup\$
    – G36
    Commented Jan 14 at 15:37
  • 2
    \$\begingroup\$ @Nero From your own chart, you can readily see that it is a numerical problem. Those straight-line segments there on the curve tell you explicitly where the points are calculated. And it's starkly obvious that there isn't sufficient data to fill in where you need it. Even with the added missing samples, LTspice also automatically (by default) compresses the data, too. (Lossy compression.) You can turn that off with a .OPTION PLOTWINSIZE=0 card. And Spice programs take many shortcuts. In short, don't expect perfection when running simulators. That is expecting too much from them. \$\endgroup\$ Commented Jan 14 at 23:36
  • 2
    \$\begingroup\$ @periblepsis I just started AC circuits, so my use of simulators was limited to DC and it was always lines and matching exactly with theoretical results; thus, I did not know in AC that it uses many approximations, and will try to turn off the lossy compression. Thanks a lot! \$\endgroup\$
    – Nero
    Commented Jan 15 at 4:12

1 Answer 1

1
\$\begingroup\$

Well, we are trying the analyze the following circuit:

schematic

simulate this circuit – Schematic created using CircuitLab

When we use and apply KCL, we can write the following set of equations:

$$ \begin{cases} \begin{alignat*}{1} \text{I}_1+\text{I}_5&=\text{I}_2+\text{I}_3\\ \\ \text{I}_1&=\text{I}_2+\text{I}_4\\ \\ \text{I}_3&=\text{I}_4+\text{I}_5 \end{alignat*} \end{cases}\tag1 $$

When we use and apply Ohm's law, we can write the following set of equations:

$$ \begin{cases} \begin{alignat*}{1} \text{I}_1&=\frac{\displaystyle\text{V}_\text{i}-\text{V}_1}{\displaystyle\text{R}_1}\\ \\ \text{I}_2&=\frac{\displaystyle\text{V}_1-0}{\displaystyle\text{R}_2}\\ \\ \text{I}_3&=\frac{\displaystyle\text{V}_1-\text{V}_2}{\displaystyle\text{R}_3}\\ \\ \text{I}_3&=\frac{\displaystyle\text{V}_2-0}{\displaystyle\text{R}_4}\\ \\ \text{I}_5&=\frac{\displaystyle\text{n}\cdot\text{V}_2-\text{V}_1}{\displaystyle\text{R}_5} \end{alignat*} \end{cases}\tag2 $$

Now, we can subsitute \$\displaystyle\left(2\right)\$ into \$\displaystyle\left(1\right)\$ in order to rewrite \$\displaystyle\left(1\right)\$:

$$ \begin{cases} \begin{alignat*}{1} \frac{\displaystyle\text{V}_\text{i}-\text{V}_1}{\displaystyle\text{R}_1}+\frac{\displaystyle\text{n}\cdot\text{V}_2-\text{V}_1}{\displaystyle\text{R}_5}&=\frac{\displaystyle\text{V}_1-0}{\displaystyle\text{R}_2}+\frac{\displaystyle\text{V}_1-\text{V}_2}{\displaystyle\text{R}_3}\\ \\ \frac{\displaystyle\text{V}_\text{i}-\text{V}_1}{\displaystyle\text{R}_1}+\frac{\displaystyle\text{n}\cdot\text{V}_2-\text{V}_1}{\displaystyle\text{R}_5}&=\frac{\displaystyle\text{V}_1-0}{\displaystyle\text{R}_2}+\frac{\displaystyle\text{V}_2-0}{\displaystyle\text{R}_4}\\ \\ \frac{\displaystyle\text{V}_\text{i}-\text{V}_1}{\displaystyle\text{R}_1}&=\frac{\displaystyle\text{V}_1-0}{\displaystyle\text{R}_2}+\text{I}_4\\ \\ \frac{\displaystyle\text{V}_1-\text{V}_2}{\displaystyle\text{R}_3}&=\text{I}_4+\frac{\displaystyle\text{n}\cdot\text{V}_2-\text{V}_1}{\displaystyle\text{R}_5}\\ \\ \frac{\displaystyle\text{V}_2-0}{\displaystyle\text{R}_4}&=\text{I}_4+\frac{\displaystyle\text{n}\cdot\text{V}_2-\text{V}_1}{\displaystyle\text{R}_5} \end{alignat*} \end{cases}\tag3 $$

Now, you can use Laplace transform to write:

$$\text{R}_2=\frac{\displaystyle1}{\displaystyle\text{sC}},\space\text{R}_3=\text{sL}\tag4$$

And:

$$\text{v}_\text{i}\left(\text{s}\right)=\mathscr{L}_t\left[\hat{\text{u}}_\text{i}\cos\left(\omega t\right)\right]_{\left(\text{s}\right)}=\frac{\displaystyle\hat{\text{u}}_\text{i}\text{s}}{\displaystyle\text{s}^2+\omega^2}\tag5$$

Now, for your case you need to solve for \$\displaystyle-\text{I}_5\$ in order to find your \$\displaystyle i_o\$.

\$\endgroup\$
1
  • \$\begingroup\$ Nice technique, will keep it in mind. Though I think in this case it is faster to solve it in frequency domain directly. \$\endgroup\$
    – Nero
    Commented Jan 17 at 14:23

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.