Symbolic Modified Nodal Analysis
using Python

Author

Tiburonboy

Published

30 June 2024

Note
  • This book is a draft copy, many sections are still under construction.
  • Spelling and grammar checks have not been completed.
  • This book is posted for testing only.

About this book

This website is my online book - Symbolic Modified Nodal Analysis using Python. Symbolic circuit analysis is a circuit analysis method that derives network equations with the circuit elements represented by symbols and the topology of the circuit described by a netlist. Python is a general purpose programming language with a large standard library and packages.

One of the first topics taught to electrical engineering students is basic electrical circuit analysis. This can be thought of as EE 101, and deals with circuit models not physical circuits. The current to voltage relationship for resistors is described by Ohm’s law, \(V=IR\), and current to voltage relationships for capacitors and inductors can be described by the following differential equations: \[i(t) = C \frac {\mathrm d v(t)}{\mathrm d t}\] \[v(t)=L \frac {\mathrm d i(t)}{\mathrm d t}\] Since differential equations are used to model capacitors and inductors, EE 101 is usually taught after courses in calculus and differential equations. If an electrical network has several branches or loops, then there is a family of equations that describe the circuit, and these are a system of differential equations. Most of the problems presented in textbooks are relatively simple since developing the differential equations and solving them in the time domain with pencil and paper is laborious. After subjecting their students to the rigors of time domain analysis, professors introduce phasors and frequency domain analysis using Laplace transformed circuit elements. Here the problem turns into an algebra problem and students wonder why so much classroom effort was placed on obtaining solutions by solving differential equations.

The circuit analysis technique presented in this book analyzes electrical circuits in the frequency domain. The inductors and capacitors in the circuit are replaced by their transformed values. Inductors are replace by their steady state Laplace value, \(sL\), where L is the value of the inductor with units of henrys (named after Joseph Henery) and \(s\) is the Laplace variable equal to \(j \omega\) where \(j\) is the imaginary number and \(\omega\) is the radian frequency. Capacitors in the circuit are replace by their steady state Laplace value, \(\frac {1}{sC}\) where C is the value of the capacitor with units in farads (named after Micheal Faraday).

There are 15 code validation test circuits followed by example problems. The chapters for these circuits can be referenced as examples on how to use my Python code to analyze electrical circuits.

This book was written in R MarkDown using plain text files and JupyterLab notebooks. The source files were rendered into a book using Quarto, an open-source scientific and technical publishing system. Quarto does a good job of formatting the documents into web pages for a book. Some of the lines of code and mathematical expressions are wider than the page and Quarto inserts a slider bar in the code or equation windows. Chapter and paragraph numbering are automatically generated by Quarto as well as the numbering of figures and tables.

I don’t have a proof reader or professional editor for this project. Instead, I’m relying on the LibreOffice spell checker and the grammar and spell checker of Google Docs to help me with this part of the writing process.

Source code for this book is available here and related material is located here

Python module version

The following versions were used in this book.

Table 1: Library versions
Package version
Python 3.10.9
JupyterLab 3.5.3
IPython 8.10.0
NumPy 1.23.5
SymPy 1.11.1
SciPy 1.10.0
Pandas 1.5.3
Tabulate 0.8.10
matplotlib 3.7.0
LTSpice 17.1.8
Quarto 1.4.553

The Jupyter notebooks are available from my GitHub repository. The results presented in this book should be reproducible if the libraries and modules have the same version numbers.

Update History

This book will be updated occasionally to fix typos, spelling and grammar mistakes. Additionally, new content will be added as new chapters in the Example Problems section.

date description
29 Dec 2023 test version
26 Jan 2023 various updates to draft
27 Apr 2024 adding/removing example problems
1 May 2024 rendering book with Quarto 1.4
Published date
show above
see Table B.2

About the author

This book is published under the pseudonym Tiburonboy.

When I was about ten years old, my parents gave me an electronics kit for Christmas. It was a collection of resistors, capacitors, transistors and other assorted electronic components. The kit included about ten plans to build various circuits like an AM radio and audio oscillator. Ever since then I have been interested in radios and electronics.

After graduating from high school, my Dad asked me what I was going to study in college and I told him mathematics. He suggested that I study electrical engineering since engineers were more in demand than mathematicians and electrical engineering was very math oriented. This turned out to be the best advice he gave me, because for the next 37 years my interest in electronics has turned into a very rewarding career as an electrical engineer.

My first job after graduating from college was working as a civilian for the US Navy. For more than 40 years I have been designing electronic circuits for instrumentation and telemetry systems. I have five Patents and have published seven technical papers.

License

This work (includes python code, documentation, test circuits, etc.) is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

  • Share — Copy and redistribute the material in any medium or format.
  • Adapt — Remix, transform, and build upon the material for any purpose, even commercially.
  • Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • ShareAlike — If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original.

Creative Commons License