I am getting an error when I try to check the resistor current in the simulator (Error: vector I(R1) not found!). I already simplified the circuit trying to debug the issue, but it feels that I am doing something wrong. What looks strange to me is that I can get the voltages, and current of the DC source, but not currents of the components in the schematics. Is this a feature of the ngspice or I my mistake?
I have found the answer myself, it required just a bit of googling. I will copy it here, just in the case someone else will have a similar issue
I(element_name) is an extension added only to the commercial SPICE versions. In ngspice (which is based on Berkeley Spice 3) you can only plot currents through (independent) voltage sources. These are the only currents that appear in the circuit equations SPICE works from. If you have a more complex circuit you would need to add a zero volt source (in series) with the component to get its current
Now, with ngspice-40, the command ‘.probe alli’ is doing this for you, so no extra effort is required.
Loading your netlist into standard ngspice, typing ‘run’ and the ‘display’ will reveal r1#branch : current, real, 51 long
among others.
Plotting by plot i(R1)
will show the current.
I run ngspice from KiCAD, and there I still get “vector not found”, even thought I compiled and installed ngspice-40 shared library. I need to check if I did not mess with the library path. Or may it happen that it is somehow related to the KiCAD itself?
Just for information, if someone else will have the same issue.
It turned out that on Ubuntu KiCad uses libngspice-kicad library (I do not really know what is the difference between this one and the ngspice-40). So, because of some reason for me installation of ngspice-40 from the source did not work, but installing libngspice-kicad from Index of /kicad/kicad-dev-nightly/ubuntu did the job, i.e. now the current vectors are there