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
- 2.1. V1.6.0 (development release)
- 2.2. V1.5.0 (production release) 2021-05-xx
- 2.3. V1.4.3 2020-07-04
- 2.4. V1.4.0 2020-05-05
- 2.5. V1.3.2 2019-03-11
- 2.6. V1.2.0 2018-06-07
- 2.7. V1.1.0 2017-09-06
- 2.8. V1.0.0 2017-09-06
- 2.9. V0.4.2
- 2.10. V0.4.0 2017-07-31
- 2.11. V0.3.2 2017-02-22
- 2.12. V0.3.1 2017-02-22
- 2.13. V0.3.0 2015-12-08
- 2.14. V0 2014-03-21
- 3. Roadmap
- 4. Installation
- 4.1. PySpice Packages
- 4.2. Ngspice on conda-forge
- 4.3. PySpice Continuous Integration
- 4.4. On Windows
- 4.5. On Linux
- 4.6. On OSX
- 4.7. How to get the Examples
- 4.8. Install a more Recent Version from GitHub using pip
- 4.9. Installation from Source
- 4.10. Tips to Set the Development Environment
- 4.11. Dependencies
- 4.12. How to Generate the Documentation
- 4.13. Ngspice Compilation
- 4.14. How to get Xyce ?
- 5. Simulators
- 6. User FAQ
- 6.1. PySpice FAQ
- 6.1.1. How to get help or report an issue ?
- 6.1.2. How to typeset
u_kΩ
oru_μV
in Python code ? - 6.1.3. How to perform division with units ?
- 6.1.4. Is unit API well tested ?
- 6.1.5. Is ground node required ?
- 6.1.6. How to deal with SPICE parameters that clash with Python keywords ?
- 6.1.7. How to pass raw SPICE command ?
- 6.1.8. How to set the simulator ?
- 6.2. Ngspice FAQ
- 6.3. Xyce FAQ
- 6.1. PySpice FAQ
- 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