5
\$\begingroup\$

I try to model a simple RC circuit with input of 2 A DC and I get an out voltage (Vc) of 2 TV. I am not sure what I am doing wrong.

enter image description here

EDIT: This is for MacOS

\$\endgroup\$
4
  • 1
    \$\begingroup\$ When you run a simulator mark the option “start voltage source from zero”. \$\endgroup\$ Commented Jan 25 at 23:43
  • \$\begingroup\$ Also, your circuit would make more sense if you used a voltage source instead of a current source. \$\endgroup\$
    – user69795
    Commented Jan 25 at 23:52
  • 1
    \$\begingroup\$ Just for completeness here I can explain why you get the result you do. LTspice's topology checker is detecting that node Vc is floating and therefore automatically adds (behind the scenes) a 1 teraohm resistor to ground. So 2A into 1 teraohm is equal to 2 teravolts. As explained in the answers, if you don't put an initial condition on the voltage across the capacitor then the simulation will begin with the capacitor fully charged and therefore an open circuit. So you just have I1, R1, and the "hidden" 1 teraohm resistor. Hope that makes sense. \$\endgroup\$
    – Ste Kulov
    Commented Jan 26 at 19:30
  • \$\begingroup\$ You need to connect a 5 G Ohm resistor across the capacitor. \$\endgroup\$ Commented Feb 4 at 5:31

2 Answers 2

6
\$\begingroup\$

note 1 about the .TRAN card

I guess, first off, your .TRAN card is providing \$10\:\text{s}\$ as an initial step-size guess (as well as a plotting increment.) This is unusual. But it's fine, too. I'm just being pedantic to note it here.

note 2 about the .TRAN card

You are specifying an end-time of \$100\:\text{s}\$ for the run. Again, just being pedantic for now.

initial transient solution

Spice simulators will usually first try to find the DC operating point of the circuit. This is called the "initial transient solution" step (sometimes shortened to ITS), which takes place immediately prior to \$t=0\$.

There is an option called UIC on the .TRAN card that will tell Spice to avoid this initial ITS step.

The use of UIC on the .TRAN card means that Spice will not go through the ITS step.

Instead, when using this option, the initial value of every single energy storage (voltage/capacitor and current/inductor) device to be treated as zero -- except for those which are explicitly provided using the .IC card. (You can add as many .IC cards as you feel you need.)

your situation, as given

So, without the UIC option on the .TRAN card, Spice will go through the ITS step.

(In doing so, it will still look for specific .IC cards and set things as indicated. But aside from any modifications by .IC cards, the other energy storage devices (inductors and capacitors) will be initialized with zero stored energy.)

This means it will attempt to find a \$t\to\infty\$ solution before starting the run. And in your case, this means finding a very large result as the starting point of the run.

This isn't what you want.

So check off the UIC option of the .TRAN card. This will avoid the ITS step.

results

If you do as I suggested, then you will expect to see \$\frac{\text{d}\,V}{\text{d}t}=\frac{I}{C}=\frac{2\:\text{A}}{20\:\mu\text{F}}=100\:\text{k}\frac{\text{V}}{\text{s}}\$. So, in \$t=100\:\text{s}\$ you would expect to see \$10\:\text{MV}\$ at the output.

Let's see:

enter image description here

Yup! Looks right to me!

\$\endgroup\$
1
  • 1
    \$\begingroup\$ If I recall correctly (been a while since I used it), the Mac version is lacking in a lot of the GUI hand-holding menus that the Windows version has. So I don't think there is a simulation command menu, and therefore no checkboxes to check. The user has to type in the .tran command directly, which also explains why they ended up with a strange .tran command. Usually it's either 1, 3, or 4 time parameters. Never 2. Anyway, in one of Mike Engelhardt's live talks he boasted about this "new" UI in the Mac version. It seems like this same non-hand holding approach made its way over to QSPICE. \$\endgroup\$
    – Ste Kulov
    Commented Jan 26 at 19:25
3
\$\begingroup\$

The problem is the simulation does a DC operating point, and so it runs the circuit and figures out the starting voltage. Sometimes it can get confused

"Ctrl-RightClick on the capacitor. In the SpiceLine cell, type "IC=0", for example, to set its initial voltage to 0V"

Changed 2V to 0V where applicable

Source: How to define the initial charge of a capacitor in SPICE

\$\endgroup\$
2
  • 1
    \$\begingroup\$ Doesn't work for me on MacOS \$\endgroup\$
    – user510
    Commented Jan 26 at 4:14
  • 1
    \$\begingroup\$ @user510 It should work, so I'm assuming on the Mac version it's a different key-command to get into "super expert mode" to change the SpiceLine field. Alternatively, you can just add the IC=0 right after the capacitance value such that it reads like this: 20u IC=0. \$\endgroup\$
    – Ste Kulov
    Commented Jan 26 at 19:17

Not the answer you're looking for? Browse other questions tagged or ask your own question.