SPICE Export
The SPICE Export functionality creates a SPICE netlist file containing a description of the circuit represented by the physics interface. This functionality can be accessed from the physics interface context menu (right-click the physics interface node and select Export SPICE Netlist). After specifying a file name, the circuit is exported and messages from the export process display in the Messages window. During the export process, a series of operations are performed:
In order to avoid conflicts, each component must be identified by a unique Device name. If one or more components have the same device name, the export operation fails and an error message is displayed. All characters in a Device name that are not letters, digits or underscores are replaced by underscores.
According to the SPICE specification, each circuit must have a node with name 0, which is assumed to be the only ground node. When exporting a circuit, any node with name 0 that is not connected to a Ground component is exported with a different node name. All nodes that are connected to a Ground components are exported as a merged node with name 0. The Messages window shows a log message if these operations are performed, showing the name of the renamed or merged nodes.
Some components (most notably, the External components used to couple to other physics interfaces) cannot be exported to a SPICE netlist. These components are ignored during the export process, and a message is shown in the Messages window. Note that this can change the exported circuit, since some components are then missing.
Subcircuit definitions are added as .subckt statements in the netlist. Semiconductor devices (such as MOSFETs, BJTs, and diodes) are exported as a SPICE device with a corresponding .model statement.
The title of the exported netlist file is the model’s filename, and the time, date, and version of COMSOL Multiphysics is added as a comment in the netlist file.