ra3xdh / qucs_s

Qucs-S is a circuit simulation program with Qt-based GUI
https://ra3xdh.github.io/
GNU General Public License v2.0
867 stars 111 forks source link

Qucs-S reports wrong ngspice log data - Getting Spice model to work #1001

Open tomhajjar opened 1 week ago

tomhajjar commented 1 week ago

I have been trying to get a complex library of IGBT Spice models to work in Qucs. The Library works in LTspice as-is.

The original lib file "IGBT_600V_HighSpeed3_L1.lib" doesn't work so was simplified to "IGP20N60H3.cir" hoping to get Qucs/ngspice to work. Unfortunately I get a conflicting "Qucs-S Message", Simulator crashed! and Simulator successful.

I then sent the netlist to ngspice via DuSpice and get a totally different "Message" in the ngspice file log, "IGP20N60H3_DC_sweep.log".

1) Are the two "Formula() error." in the Log confusing Qucs-S?

2) Would it be useful to allow the User to see both Qucs "Message" and ngspice "Log" Files?

3) What is the proper way to handle complex Spice Libraries like "IGBT_600V_HighSpeed3_L1.lib"? I'm sure my editing of the file to create "IGP20N60H3.cir" wasn't done 100%.

2024-10-18_182903 2024-10-18_183434

IGBT_prj.zip IGBT_LTspice.zip

ra3xdh commented 1 week ago

Would it be useful to allow the User to see both Qucs "Message" and ngspice "Log" Files?

Qucs-S doesn't apply any filters to log files and doesn't hide the log data from user. The problem is more complicated. The problem may be in Qt itself. The QProcess::readAllStandardOutput returns an empty string if the child process is terminated with error code. And Qt cannot obtain the log if the Ngspice is terminated with error code. The simulation process has merged stdout and stderr channels. Need further investigation. I didn't understand what happens. Don't expect a quick fix.

What is the proper way to handle complex Spice Libraries like "IGBT_600V_HighSpeed3_L1.lib"?

You have to extract all dependent parameters and child subcircuit in the single *.cir file. Also wait until #944 will be implemented.