Mathematica 9 is now available

Interfaces to SPICE/PSpice

download notebookDownload this example as a Mathematica notebook.

To execute this notebook you need the add-on package Analog Insydes by ITWM (see copyright message at end of document).


Schematics Import

Analog Insydes provides functions for importing circuit schematics into your Mathematica notebooks for better documentation of your circuit analysis tasks. The Analog Insydes function DXFGraphics displays a DXF file as a native Mathematica graphics object. Consider the following example where the file Buffer.dxf was produced by the DXF export function of MicroSim's Schematics editor.

[Graphics:Images/index_gr_1.gif] 

[Graphics:Images/index_gr_2.gif]
[Graphics:Images/index_gr_3.gif]
[Graphics:Images/index_gr_4.gif] 


Netlist Reader

For circuit analysis and design tasks that combine symbolic and numerical calculations, Analog Insydes features interfaces to the circuit simulator SPICE. Instead of time-consuming manual netlist input, SPICE circuit descriptions can be converted automatically to the Analog Insydes format by applying the external binary executable spice2ai. Additionally, operating-point information can be extracted from the simulator output file. The example below illustrates the import of the SPICE netlist file Buffer.net.

[Graphics:Images/index_gr_5.gif] 

[Graphics:Images/index_gr_6.gif]
[Graphics:Images/index_gr_7.gif]
      Out[4]=//TableForm
VVDD {5,0} Symbolic-> 
VVDD
Type-> VoltageSource Value-> 
VVDD
DC 
->5
DC 
->5
QT1 {3->C, 
1->B, 
2->E}
Selector 
->View
Model-> Q2N2222A "" "" ""
II1 {2,0} Symbolic 
->II1
Type-> CurrentSource Value 
->II1
DC-> 
1/2000
""
VVIN {1,0} Symbolic 
->VVIN
Type-> VoltageSource Value 
->VVIN
DC->3 AC 
->1
II2  {VOUT,0}  Symbolic 
->II2 
Type->CurrentSource  Value 
->II2 
DC-> 
1/1000 
Transient 
->PWLWave[] 
QT3  {3->C, 
4->B, 
5->E} 
Selector 
->View 
Model->Q2N2907A  ""  ""  "" 
QT4  {4->C, 
4->B, 
5->E} 
Selector 
->View 
Model ->Q2N2907A  "" ""  "" 
QT5  {VOUT->C, 
3->B, 
5->E} 
Selector 
->View
Model-> Q2N2907A  ""  ""  "" 
QT2  {4->C, 
VOUT->B, 
2->E} 
Selector 
->View 
Model-> Q2N2222A  ""  ""  "" 


Simulation Data Import

Analog Insydes supports import of simulation data generated by PSpice or HSpice, thus allowing us to use Mathematica's graphical visualization facilities for postprocessing and displaying simulation results. The example below demonstrates the import of the PSpice simulation output file Buffer.csd using the Analog Insydes function CSDFRead. In addition, an example for further postprocessing of the simulation results is shown.

[Graphics:Images/index_gr_10.gif] 

[Graphics:Images/index_gr_11.gif]
[Graphics:Images/index_gr_12.gif]
{"V(VOUT)", "I(VIN)", "I(VDD)"}
[Graphics:Images/index_gr_13.gif]
[Graphics:Images/index_gr_14.gif]
[Graphics:Images/index_gr_15.gif] 
[Graphics:Images/index_gr_16.gif]
[Graphics:Images/index_gr_17.gif]
[Graphics:Images/index_gr_18.gif] 
[Graphics:Images/index_gr_19.gif]


Copyright © 1998 by ITWM e.V.

Written by Thomas Halfmann

Analog Insydes
ITWM (Institut für Techno- und Wirtschaftsmathematik) e.V.
Erwin-Schrödinger-Str.
D-67663 Kaiserslautern, Germany

Analog Insydes is a trademark of ITWM.
Mathematica is a registered trademark of Wolfram Research, Inc.
All other product names are trademarks of their respective owners.

Copying and redistribution of this notebook is welcomed and encouraged, provided that the entire contents of the document, in particular the above copyright notice, are left unchanged and that the file is redistributed free of charge.