Electronic – How to import a spice model into QUCS

modelpspicequcsspice

I am trying to import one of the spice models (from here) into QUCS.

I haven't been able to find much documentation about this except for vague hints that it is possible.

Best Answer

http://qucs.sourceforge.net/docs/tutorial/spicetoqucs.pdf

One area where Qucs and SPICE differ significantly is in their circuit file netlist formats which are very different. Qucs cannot directly simulate standard SPICE circuit netlists but requires them to be converted to their Qucs equivalent prior to simulation. ... Although Qucs cannot directly simulate SPICE netlists the software does contain a SPICE to Qucs netlist conversion program called QUCSCONV. This routine takes as input a SPICE netlist file and outputs an equivalent Qucs formatted netlist file. The Qucs netlist file can be read and simulated by the Qucs simulation engine. To make the process transparent, and indeed straightforward for users, the conversion stage in simulating SPICE netlist files 5 has been automated via the Qucs GUI simulate command (F2 key).

You cannot edit the SPICE block's symbol, though, so it recommends putting the SPICE subcircuit inside a QUCS subcircuit. So the steps would be something like this:

(This doesn't actually work for me, but maybe it will get you closer to an answer)

  1. Create a new project
  2. Create a new schematic.
  3. Draw parts of the schematic that don't depend on the SPICE model
  4. Create and save a new schematic which will be the subcircuit with custom symbol.
  5. From the Components → File Components menu, create a SPICE netlist component.
  6. Double-click it to bring up Properties
  7. Give the part a name
  8. In the File box, Browse to the SPICE netlist file. (Then I get spice notice, no .END directive found, continuing even though a subcircuit should end in .ENDS, not .END, and the file does?)
  9. In the SPICE net nodes box, probably want to press Add>> for all the nodes, to put ports on them in the box. Press Ok.
    Edit SPICE Component Properties
  10. Then under "Components → lumped components", choose "Subcircuit Port" and create enough for each SPICE port. Connect them up. You can double-click the ports to give them meaningful names and pin numbers that match the physical part, too.
    actual part pin numbers
  11. It also creates a Ref port, which I don't think does anything? Connect it to ground?
    JFET subcircuit
  12. Now you can create the subcircuit symbol. Go to File menu and Edit Circuit Symbol.
  13. Draw the symbol you want, with the connections in the place you want them. I don't know of any way to use existing component symbols.
  14. After saving the subcircuit, go back to the main circuit.
  15. From Components → file components, create Subcircuit.
  16. Give it a reference designator and select the .sch file you just created.
    Edit Component Properties

And when you've done all this... it doesn't work. But that's how you do it. If I figure out how to make it work, I'll update it.

What does work is to redraw the entire subcircuit using native components, but that's even more tedious.