Using SPICE to simulate an electrical circuit is a common enough practice in engineering that “SPICEing a circuit” is a perfectly valid phrase in the lexicon. SPICE as a software tool has been around since the 70s, and its open source nature means there are more SPICE tools around now to count. It also means it is straightforward enough to use with other software as well, like integrating LTspice with Python for some interesting signal processing circuit simulation.
[Michael]’s latest project involves simulating filters in LTspice (a SPICE derivative) and then using Python/NumPy to both provide the input signal for the filter and process the output data from it. Basically, it allows you to “plug in” a graphical analog circuit of any design into a Python script and manipulate it easily, in any way needed. SPICE programs aren’t without their clumsiness, and being able to write your own tools for manipulating circuits is a powerful tool.
This project is definitely worth a look if you have any interest in signal processing (digital or analog) or even if you have never heard of SPICE before and want an easier way of simulating a circuit before prototyping one on a breadboard.
The problem with LTspice is its license is tied to non-commercial use.
A free alternative to LTspice is QUCS.
https://en.wikipedia.org/wiki/Quite_Universal_Circuit_Simulator
QUCS has some extra features, including a lot of RF tools, and can also run Octave scripts natively (Octave is the free alternative to Matlab).
Both LTspice and QUCS are using the same SPICE engine, so they are compatible in parts libraries and simulation models, just that the IDE/GUI/tools are slightly different.
LTspice has more comfort but less freedom.
QUCS might seem cumbersome at first, but is free for all and has more RF goodies.
Both LTspice and QUCS are great tools for simulating electronic circuits, use them both.
:o)
Unfortunately, even QUCS is not 100 % free. There are some files with unclear license, it seems, which prevent QUCS from being packaged for Debian again: https://bugs.debian.org/714836#99
LTspice and Qucs do not use the same engine.
LTspice uses a modified version of berkely SPICE3 that is optimized for dealing with the transients found in switchmode power supplies, and as a consequence it is missing some spice3 circuit models.
Qucs uses qucsator which is incompatible with many of the models from SPICE3, but supports rf/digital work you mentioned.
There is however a fork of QUCS called Qucs-S which can run any SPICE you have access too (ngspice, etc). As far as I know it is not possible to use the modified version of SPICE3 that comes with LTspice outside of LTspice, but in principal you could export the netlists from Qucs-S into LTspice as long as you don’t use any models that are unsupported by LTspice.
I personally use Qucs since I usually do rf work, but for switchmode work it is hard to beat LTspice. Outside of those use cases I would recommend Qucs-S
I was not aware of all the differences, thank you.
So where does QucsStudio fit in? Link:
http://dd6um.darc.de/QucsStudio/about.html
From the QucsStudio “About” page:
“QucsStudio is mainly a circuit simulator that has evolved out of the project Qucs, but isn’t compatible with it. The simulation engine is even a complete new creation. It’s meant to be a test project to create a complete development environment for electrical engineers… More follows.”
LTSpice is not open source, but I’m pretty sure you can use it for free even for commercial purposes. The only thing you can’t use it for is in marketing or promotion if you are a competing semiconductor manufacturer. Do you have a source for this?
IDK, maybe it can be used commercially with their chips only, the license says “solely to evaluate LTC products and also to perform general circuit simulation.” whatever “evaluate” will mean here, but doesn’t look like free to use for any professional/commercial activity.
http://ltwiki.org/index.php?title=License_Agreement_Disclaimer
It is not true to say that LTspice is restricted to non-commercial use.
The only (negotiable!) restriction is:
“This program is specifically not licensed for use by semiconductor manufacturers in the design, promotion, demonstration, development, or sale of their products. Specific permission must be obtained from Analog Devices for the use of LTspice for these applications.”
as stated on:
https://www.analog.com/en/analog-dialogue/articles/get-up-and-running-with-ltspice.html
I don’t know about LTSpice, but QUCS is also cross platform, as of course is Python.
73.
Fabrice Salvaire, a french guy actually talked about Circuit simulation with Python in Paris back in 2017. You can check his talk on YouTube (in french) and his presentation slides.
https://pyspice.fabrice-salvaire.fr/
Speaking of spice, we need an open source alternative to simulink.
SciLab is a free alternative for Simulink, similar as Octave is for Matlab.
https://www.scilab.org/about/scilab-open-source-software
Like xcos but better.
If you are looking for a great model language with capabilities beyond simulink you may want to check out (open)modelica. https://www.openmodelica.org/
Where is the python code?
I tried LTSpice about a year ago. Accuracy was not as good as Berkeley SPICE for my purposes.
Is there any simulation software that will show an animation of current flow like livewire does? (Not online simulator)
Falstad Circuit Simulator has a standalone Java applet, or you can host the Javascript version locally. I can’t speak to the rigor of its simulation engine, but results appear to be correct.
http://www.falstad.com/circuit/
My open-source SPICE-alike (text input) circuit simulator FoxySim – Web-application (written in Go) intended for online simulation DC & AC electric circuits. This app may be used in teaching theoretical electrical engineering.
Live simulator running on address: http://sim.foxylab.com/
GitHub: https://github.com/Dreamy16101976/FoxySim
When teaching theoretical electrical engineering, much attention is paid to the calculation of linear circuits of sinusoidal current in the steady state. In SPICE, the calculation of this mode is not convenient, but for my simulator this is the native mode. Divide the circuit into elements, number the nodes, enter the netlist, press the button Go! and get the currents, voltages, power, readings of ammeters, voltmeters, wattmeters etc.
Supported elements: voltage source, current source, VCVS, CCCS, VCCS, CCVS, resistor, inductance (with inductive coupling), capacitance, complex impedance, RG-line, RGLC-line, Ampermeter, voltmeter, wattmeter, varmeter, phasemeter.
Brief help – http://sim.foxylab.com/help
Hackaday: https://hackaday.io/project/167846-foxysim
SPICE from the Russian journal “Radio” for Python.
http://www.radio-forum.ru/forum/viewtopic.php?f=1&t=13247
https://guitar-gear.ru/forum/topic/6539-%d0%b0%d0%bd%d0%b0%d0%bb%d0%b8%d0%b7-%d0%bb%d0%b8%d0%bd%d0%b5%d0%b9%d0%bd%d1%8b%d1%85-%d1%8d%d0%bb%d0%b5%d0%ba%d1%82%d1%80%d0%b8%d1%87%d0%b5%d1%81%d0%ba%d0%b8%d1%85-%d1%86%d0%b5%d0%bf%d0%b5%d0%b9-%d0%bd%d0%b0-%d1%80%d0%b0%d0%b4%d0%b8%d0%be-86/
Example for Your circuit:
3
R1
1
2
50
C1
2
0
1000
L1
2
3
60
R2
3
0
50
E
input
1
0
output
2
0
freq, Hz
f0 = 10e3
f1 = 20e6
New version.
https://nalexsoft2.blogspot.com/2020/01/spice-for-python.html
Another good tool for circuit simulation with python is LCAPY ( https://lcapy.readthedocs.io/en/latest/index.html )