5
\$\begingroup\$

I would like to simulate a circuit with a capaciot in LTSPICE. In the first hand, I have tried to charge the capacitors in a period of time. However, the charging current is very high and I am not sure whether the capacitor will be completely charged or not.

Therefore, I am looking for a way to initiate the initial state of charge of a capacitor in SPICE.

\$\endgroup\$
  • \$\begingroup\$ Did you try looking at the documentation and the initial voltage setting? \$\endgroup\$ – PlasmaHH May 31 '16 at 8:23
8
\$\begingroup\$

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

\$\endgroup\$
  • \$\begingroup\$ this method only works with certain OS's, doesn't work with OSX, even when you remember that CTRL is usually replaced by that weird flowery symbol key (the windoze key on a standard keyboard) \$\endgroup\$ – Neil_UK May 31 '16 at 9:13
  • \$\begingroup\$ Neil_UK: Did you try [ctrl]-two-finger-click on the trackpad? One of common sources of complaint in OSX meets LTSpice is that that [cltr]-click is one style of "right click", two-finger-click is another form of "right click" In LTSpice, it makes a difference. \$\endgroup\$ – fearless_fool Nov 7 '16 at 4:11
3
\$\begingroup\$

Look up help on .IC, initial conditions. This is a directive you drop on the schematic (it finds its way into the spice file when it runs), that allows you to specify initial capacitor voltages and inductor currents, amongst other things.

This is in OSX, I think the GUI in different OS's may be different.

Remember the GUI is a front end for (more or less) standard SPICE. Anything that SPICE can do can be done in LTSPICE, just look at the help for exactly how to do it.

\$\endgroup\$
  • 1
    \$\begingroup\$ You can use ic on individual components too \$\endgroup\$ – PlasmaHH May 31 '16 at 8:28
  • \$\begingroup\$ Nobody will disagree that LTspice is a bit clunky (although I really thank Linear to give it for free). But your post looks more like a rant against LTspice than a real answer to the question... \$\endgroup\$ – dim May 31 '16 at 9:03
  • \$\begingroup\$ @Neil_UK is correct. I just want to add that if the capacitor isn't connected to ground but at some floating potential, you are better off defining both ports of the capacitor to individual names and forcing both ports to some voltage relative to ground and the difference between them being the voltage you want on your capacitor. \$\endgroup\$ – winny May 31 '16 at 9:04
  • \$\begingroup\$ @dim that wasn't my intention, I'll edit my answer to make it look less ranty. I was so blown away by the silky smoothness of Simetrix (notice I did not mention them in my answer) that I am really pi..ed that they cripple it to 140 nodes and no scripting for the free version. LTSpice might as well be a straight DOS app in comparison, but it works, anywhere, for any sized circuit, so you just have to suck up the learning curve and live with it. \$\endgroup\$ – Neil_UK May 31 '16 at 9:08
  • \$\begingroup\$ No problem... I totally agree anyway. To be honest, I never really had the opportunity to use anything else, but I can easily imagine that other softwares are way better in terms of useability. Ah, yes, I tried to use Tina-TI: it looks nice, but I couldn't even find a way to get a simple graph of an arbitrary voltage node after the simulation had run. Also, simply running wires between pins made me mad. So I thought that, after all, LTspice wasn't that bad. \$\endgroup\$ – dim May 31 '16 at 9:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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