SpiceSharp / SpiceSharpGUI

SPICE simulation environment for Windows built with SpiceSharp, SpiceSharpParser and SpiceSharpBehavioral
MIT License
6 stars 2 forks source link

the netlist supported in GUI and SpiceSharpParser #24

Open cmczsa opened 1 year ago

cmczsa commented 1 year ago

I have edited a netlist in SpiceSharpGUI and it runs successfully. Then I want to use SpiceSharpParser to parse the netlist. However, I get several errors when I copy my netlist to the SpiceSharpParser. So is the netlist supported in SpiceSharpGUI different from the one in SpiceSharpParser? Thank you for your help in advance!

marcin-golebiowski commented 1 year ago

Thank you for your message. I would like to help you.

I will update ShareSharpGUI today to use latest packges from SpiceSharp project. In theory a netlist should work the same in GUI and in raw parser. The differences probably are caused by the fact that GUI project was not updated for long time.

cmczsa commented 1 year ago

Thank you for your message. I would like to help you.

I will update ShareSharpGUI today to use latest packges from SpiceSharp project. In theory a netlist should work the same in GUI and in raw parser. The differences probably are caused by the fact that GUI project was not updated for long time.

Oh, This will be of great help to me. Thanks a lot!

marcin-golebiowski commented 1 year ago

SpiceSharpGUI project has been refreshed. Also I've published new version SpiceSharpParser that has one fix. I hope it will solve your problem. Please let me know.

cmczsa commented 1 year ago

Hi, I've tried the new version and I do find that some bugs I met when I edited in GUI have been fixed. But it still has some exceptions when I run the SpiceSharpParser in Visual Studio. I would like to offer some details for you. I move the netlist which runs successfully in GUI to the SpiceSharpParser(version 3.1.5). I compiled it successfully with no error. Then, I run the programe and meet an exception. It is in the part "//Translating netlist model to SpiceSharp". This line, "var spiceSharpModel = reader.Read(netlist);" , has an exception as follows.

SpiceSharp. SpiceSharpException: "Unhandled exception during reading model" ArgumentNullException: The value cannot be null. Arg_ParamName_Name This exception was originally raised in this call stack: [external code]

Does this mean that the netlist I edit in the GUI has some errors? But it does get correct image results in the GUI.

Thanks for helping me on it. I really appreciate it!

marcin-golebiowski commented 1 year ago

There is a typo in Netlist_InParser.txt file. image If you have problems with the projects, please ask and I would be happy to help.

cmczsa commented 1 year ago

I'm terribly sorry that I made such a stupid mistake. When I corrected it and ran it again, I found another exception: "InvalidOperationException: sequence contains no elements". Fortuanately, I found that it was caused by copying the simulation part of Spice#Parser image without involving analysis statements such as ".DC", ".AC", ".TRAN" in the text of netlist. After adding this statement together with another statement ".SAVE", the program ran successfully. I considered that the program could run as long as the circuit was built successfully, ignoring the fact that the simulation part of the Spice#Parser required analysis statements. I am not sure I've found the key, for I've been exposed to Spice and Spice# for less than a week. I sincerely appreciate your kindness.

marcin-golebiowski commented 1 year ago

How can I help?

cmczsa commented 1 year ago

Oh, I'm terribly sorry for not responding to you in a timely manner, as I have just finished all of my exams during the two months. I have already completed a project based on Spice#. In the future, I will teach my students to learn how to build an AC motor circuit using Spice#. To prevent them from copying the circuit netlist I submitted a few months ago, I deleted the netlist file I submitted. In addition, I accidentally clicked the 'close with comment’ button because I am not very familiar with the github interface. I only made these changes. Currently, I haven't encountered any new problems. Thank you very much for your help a few months ago!