Simulate Electronic Circuit using Python and the Ngspice / Xyce Simulators¶
Overview¶
PySpice is a free and open source (*) Python module which interface Python to the Ngspice and Xyce circuit simulators.
Ngspice is a fork of the famous SPICE circuit simulator, while Xyce is a SPICE compatible simulator developed by the Sandia National Laboratories.
(*) PySpice is licensed under GPLv3 therms.
PySpice implements a Ngspice binding and provides an oriented object API on top of SPICE, the simulation output is converted to Numpy arrays for convenience.
PySpice requires Python 3 and works on Linux, Windows and OS X.
Installation¶
How to install PySpice on your system
Examples¶
Many examples to learn how to use PySpice. To learn more on how to run theses examples, read the introduction to the examples.
Development & Community¶
How to contribute to the project
API Documentation¶
Technical reference material, for classes, methods, APIs, commands.
How to Refer to PySpice ?¶
Guidelines to cite PySpice
How to Help Further ?¶
If you want to donate to the project or need a more professional support.
Table of Contents¶
- 1. Overview
- 1.1. What is PySpice ?
- 1.2. How is PySpice licensed ?
- 1.3. Are there some papers or talks about PySpice ?
- 1.4. Going further with PySpice
- 1.5. How can PySpice be used for learning ?
- 1.6. Which platforms are supported by PySpice ?
- 1.7. How to install PySpice ?
- 1.8. How does PySpice differ from simulator like LTspice ?
- 1.9. How can a non-GUI simulator be helpful ?
- 1.10. What are the benefits of PySpice over Ngspice / Xyce ?
- 1.11. How is PySpice interfaced with Ngspice ?
- 1.12. How is PySpice interfaced with Xyce ?
- 1.13. How is the netlist defined ?
- 1.14. Can I run Ngspice using interpreter commands ?
- 1.15. How are Spice libraries handled ?
- 1.16. How are units handled ?
- 1.17. Which version of Python is required ?
- 1.18. Which version of Ngspice is required ?
- 1.19. Which version of Xyce is required ?
- 1.20. Which flavours of SPICE are supported ?
- 1.21. What else should you be aware of ?
- 2. News
- 3. Roadmap
- 4. Installation
- 5. Simulators
- 6. User FAQ
- 6.1. How to get help or report an issue ?
- 6.2. How to typeset
u_kΩ
oru_μV
in Python code ? - 6.3. How to perform division with units ?
- 6.4. Is unit API well tested ?
- 6.5. Is ground node required ?
- 6.6. How to deal with SPICE parameters that clash with Python keywords ?
- 6.7. How to pass raw SPICE command ?
- 6.8. How to set the Ngspice library path ?
- 6.9. How to set the Ngspice executable path ?
- 6.10. How to set the Xyce path ?
- 6.11. How to set the simulator ?
- 6.12. Is Xyce 100% compatible with SPICE ?
- 7. Introduction to the Examples
- 8. Examples
- 8.1. Advanced Usages
- 8.2. Basic Usages
- 8.3. Data Analysis
- 8.4. Diode
- 8.5. Electricity
- 8.6. Filter
- 8.7. Kirchhoff’s circuit laws
- 8.8. Ohm’s Law
- 8.9. Simulation using External Sources
- 8.10. NgSpice Interpreter
- 8.11. Operational Amplifier
- 8.12. Passive
- 8.13. Power Supplies
- 8.14. Relay
- 8.15. Resistor
- 8.16. Spice Netlist Parser Bootstrap Example
- 8.17. Kicad Netlist Parser Example
- 8.18. Switched Power Supplies
- 8.19. Transformer
- 8.20. Transistor
- 8.21. Transmission Lines
- 9. Example Wish List
- 10. Design Notes
- 11. API Documentation
- 12. Development & Community
- 13. How to Refer to PySpice ?
- 14. How to Help Further ?
- 15. PySpice on the Web
- 16. Related Projects
- 17. Bibliography