DC Circuit Solver with Homotopy Convergence
A SPICE-style MNA + Newton DC solver made to converge on a 5-stage ring oscillator with homotopy.
My contribution
I wrote the core solve loop, convergence check and voltage-source stamp, chose the self-bias heuristic and ran and checked the experiments; AI tools implemented the remaining device code.
- Affiliation
- 18-762 Circuit Simulation and Optimization Methods
- Dates
- Fall 2026
- Role
- Individual project on course skeleton code
- Topics
- Optimization and Simulation
- Tools
- Python, Newton-Raphson, MNA
Contents
01
The problem
I built a SPICE-style DC solver (modified nodal analysis plus Newton-Raphson) and had to make it converge on a 5-stage ring oscillator where plain Newton fails. DC operating points are the starting point for every other analysis, so a solver that can't find one is useless on feedback circuits.
02
My contribution
This was an individual project built on course skeleton code. I wrote the core solve loop, the convergence check, and the voltage source stamp myself, with step-by-step tutoring. AI tools implemented the rest of the device code and the self-bias heuristic from a spec we wrote together, which came out of a literature search. I chose the heuristic, ran and checked the experiments, and tested each explanation against the data.
03
Constraints
I used a Level-1 MOSFET model with no leakage, a 200-iteration Newton cap, and a report of about three pages. The homotopy also had to end at exactly zero added conductance, so the final answer solves the original circuit.
04
Design decisions
I used Gmin stepping (conductance from every node to ground) as the baseline and proposed self-bias stepping, which adds a conductance from gate to drain of every MOSFET. It's adapted from the gain-reduction homotopies of Roychowdhury and Melville and the variable-gain homotopy of Yamamura and Kuroki. I rejected step limiting because it would stop the bad first step without removing its cause.
05
What was difficult
The diagnosis surprised me. Newton's first step drove a node to exactly -20 V, which is -1/λ. A saturated transistor was acting as a current source into a high-impedance node. Several of my numerical predictions only partly held: conductance counting predicted a 4x threshold ratio against a measured 9x, and the remaining gap is unexplained. I reported that as partial rather than forcing a fit. The bonus "real world" amplifier turned out to have no unique DC solution at all, which is a different problem from a convergence failure.
06
Evidence
Self-bias converged in 15 iterations against 27 for Gmin, matching SPICE to about 1e-10 V. It also left the SRAM test answer unchanged, which suggests it generalizes. For the bonus, two valid solutions (node 525 at 0 V versus 4.60 V) proved the circuit was ill-posed. Only moving VSS to -1 V truly fixed it.
07
Current status
This is a graded course simulation and is complete.
08
What I would change next
I'd test on asymmetric circuits, because Gmin also works on a symmetric ring, which weakens the comparison. I'd also chase the unexplained part of the threshold ratio and write more of the device stamps myself.
Related work