{"action":"created","issue":{"url":"https://api.github.com/repos/Qucs/qucs/issues/77","labels_url":"https://api.github.com/repos/Qucs/qucs/issues/77/labels{/name}","comments_url":"https://api.github.com/repos/Qucs/qucs/issues/77/comments","events_url":"https://api.github.com/repos/Qucs/qucs/issues/77/events","html_url":"https://github.com/Qucs/qucs/issues/77","id":46999513,"number":77,"title":"Spice4qucs. A tool to simulate Qucs circuit with ngspice","user":{"login":"ra3xdh","id":4920080,"avatar_url":"https://avatars.githubusercontent.com/u/4920080?v=3","gravatar_id":"","url":"https://api.github.com/users/ra3xdh","html_url":"https://github.com/ra3xdh","followers_url":"https://api.github.com/users/ra3xdh/followers","following_url":"https://api.github.com/users/ra3xdh/following{/other_user}","gists_url":"https://api.github.com/users/ra3xdh/gists{/gist_id}","starred_url":"https://api.github.com/users/ra3xdh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ra3xdh/subscriptions","organizations_url":"https://api.github.com/users/ra3xdh/orgs","repos_url":"https://api.github.com/users/ra3xdh/repos","events_url":"https://api.github.com/users/ra3xdh/events{/privacy}","received_events_url":"https://api.github.com/users/ra3xdh/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Qucs/qucs/labels/enhancement","name":"enhancement","color":"e11d21"}],"state":"open","locked":false,"assignee":{"login":"ra3xdh","id":4920080,"avatar_url":"https://avatars.githubusercontent.com/u/4920080?v=3","gravatar_id":"","url":"https://api.github.com/users/ra3xdh","html_url":"https://github.com/ra3xdh","followers_url":"https://api.github.com/users/ra3xdh/followers","following_url":"https://api.github.com/users/ra3xdh/following{/other_user}","gists_url":"https://api.github.com/users/ra3xdh/gists{/gist_id}","starred_url":"https://api.github.com/users/ra3xdh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ra3xdh/subscriptions","organizations_url":"https://api.github.com/users/ra3xdh/orgs","repos_url":"https://api.github.com/users/ra3xdh/repos","events_url":"https://api.github.com/users/ra3xdh/events{/privacy}","received_events_url":"https://api.github.com/users/ra3xdh/received_events","type":"User","site_admin":false},"milestone":null,"comments":17,"created_at":"2014-10-28T08:14:10Z","updated_at":"2015-01-27T17:21:15Z","closed_at":null,"body":"There may be way to overcome #34 and #41. \r\nI started implementation of `spice4qucs` extension. This extension allows you to switch between `qucsator` simulation kernel and `ngspice` simulation kernel. You can simulate your Qucs circuits with `ngspice` using this extension. I am planning to add menu entry `Simulation->Simulate with spice`. Spice simulation will be available after execution of this menu. Spice simulation results will be converted to Qucs simulation data and diagrams will be available from the display page. With spice4qucs you can use good old spice to simulate Qucs circuits with it.\r\n\r\nYou can see current state of work at https://github.com/ra3xdh/qucs/tree/spice4qucs \r\n\r\nNow implemented only conversion of the Qucs circuit to Spice netlist.\r\n\r\nNot all components conversion is implemented. The list of spice-compatible components:\r\n- RCL passive components\r\n- Sine voltage source\r\n- DC source\r\n- Pulse source\r\n- Relay\r\n- Diode\r\n- BJT\r\n- JFET\r\n- MOSFET\r\n\r\n\r\nThe list of supported simulations:\r\n- AC analysis\r\n- Transient analysis\r\n\r\nSample schematic is available here: https://gist.github.com/ra3xdh/6c554e32e531c25e6e6b\r\n\r\nTo test `spice4qucs` open this schematic with Qucs, then execute `Simulation->Simulate with spice`. Spice netlist is located at `$HOME/.qucs/spice4qucs.cir`. Now switch to system terminal and execute `ngspice`:\r\n~~~~\r\nngspice $HOME/.qucs/spice4qucs.cir\r\n~~~~\r\nThen run simulation and see waveforms:\r\n~~~~\r\nrun\r\nplot v(drain)\r\n~~~~\r\nThe simulation fails for this schematic with Qucs, but ngspice simulates it correctly.\r\n\r\nHave you any suggestions? Should I continue work in this direction?\r\n\r\nMy current task list:\r\n - [x] implement basic ngspice netlist genrartor\r\n - [x] implement spice output results parser\r\n - [ ] add parameter sweep support\r\n - [ ] implement DC operation point on schematic show\r\n - [ ] optimize ngspice output results parser performance\r\n - [x] add nonlinear devices support\r\n - [ ] add subcircuits support\r\n - [ ] add library components support\r\n - [ ] add file components support\r\n - [ ] add qucs equations support\r\n - [ ] add direct import of spice components\r\n - [ ] add spice-specific equations support\r\n - [ ] add other spice-compatible backends support (for example Xyce)\r\n"},"comment":{"url":"https://api.github.com/repos/Qucs/qucs/issues/comments/71688016","html_url":"https://github.com/Qucs/qucs/issues/77#issuecomment-71688016","issue_url":"https://api.github.com/repos/Qucs/qucs/issues/77","id":71688016,"user":{"login":"ra3xdh","id":4920080,"avatar_url":"https://avatars.githubusercontent.com/u/4920080?v=3","gravatar_id":"","url":"https://api.github.com/users/ra3xdh","html_url":"https://github.com/ra3xdh","followers_url":"https://api.github.com/users/ra3xdh/followers","following_url":"https://api.github.com/users/ra3xdh/following{/other_user}","gists_url":"https://api.github.com/users/ra3xdh/gists{/gist_id}","starred_url":"https://api.github.com/users/ra3xdh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ra3xdh/subscriptions","organizations_url":"https://api.github.com/users/ra3xdh/orgs","repos_url":"https://api.github.com/users/ra3xdh/repos","events_url":"https://api.github.com/users/ra3xdh/events{/privacy}","received_events_url":"https://api.github.com/users/ra3xdh/received_events","type":"User","site_admin":false},"created_at":"2015-01-27T17:21:15Z","updated_at":"2015-01-27T17:21:15Z","body":"I have implemented library components support. I added simple regexp-based netlist converter. It is located in `extsimkernels/qucs2spice.cpp` `extsimkernels/qucs2spice.h`. Now circuits with library components could be simulated. It's need to add Xyce support. Here is an example circuit. This circuit could not be simulated with `qucsator` \r\n![irfz44](https://cloud.githubusercontent.com/assets/4920080/5923059/973cafd4-a661-11e4-9ca2-25d575208254.png)\r\n"}}