Symbolic
Circuit Solver — Closed-Form Transfer Functions From SPICE-Like
Netlists
Open-source tool. Repository: github.com/anovickis/symbolic-circuit-solver.
Why symbolic
Numerical simulators — LTspice, ngspice, Spectre — tell you
what a circuit does at a specific set of component values. They
give you a waveform. Useful, but they hide the structure of the
result.
Symbolic analysis tells you why. Instead of a waveform you
get an algebraic expression:
−g_m · R_L
H(s) = ─────────────
1 + s·R_L·C_gd
You can read off the gain, the dominant pole, the parameter
sensitivities, and the design equations — directly from the transfer
function. No parameter sweep required. No re-simulating to see what
changes when R_L doubles.
For circuit design, teaching, and documentation, that’s a different
and often more useful answer than the numerical one.
What the tool does
Symbolic Circuit Solver takes a SPICE-like netlist and produces
closed-form algebraic results using Modified Nodal Analysis
(MNA) built on SymPy.
Component types (14): R, L, C, V, I, diode, MOSFET,
BJT, op-amp, all four controlled sources (VCVS / VCCS / CCVS / CCCS),
coupled inductors.
Analysis commands (14): transfer functions, Bode
plots, pole-zero maps, step response, noise analysis, sensitivity,
Thévenin and Norton equivalents, impedance analysis, and more.
Outputs: – Symbolic transfer functions, poles,
zeros, impedances – SVG schematic diagrams (Manhattan-routed, dark
theme) generated from the netlist – Publication-ready LaTeX reports for
inclusion in papers – Python API with a Circuit class for
scripting and Jupyter use – Hybrid symbolic/numerical mode: specify a
value and it stays a number; omit it and it stays a symbol
Backends: Pure SymPy by default. Optional
WolframScript backend for large symbolic systems where SymPy is too
slow.
Examples: 30 worked circuits in the repo — from RC
low-pass filters to cascode amplifiers to PLL loop filters.
When this is the right tool
- Circuit design. Derive the gain, bandwidth, and
stability expressions before you commit component values. Sensitivity
analysis tells you which parameters matter most — and which you can
leave loose. - Teaching. Show students the closed-form result
instead of a screen of numerical output. The algebra makes the physics
legible. - Design space exploration. When you need to know how
the answer depends on temperature, supply voltage, or process corner —
without re-running the simulator a thousand times. - Documentation. LaTeX export drops directly into a
design report or a paper.
When it’s not
- Highly nonlinear circuits. SPICE wins on Class-AB
output stages, switch-mode converters in steady state, and anything
where the operating point requires an iterative solve. Symbolic analysis
gives you small-signal results around an operating point you’ve already
chosen. - Large designs. The tool is built for the kind of
subcircuit you’d review by hand — tens of nodes, not thousands. SPICE
remains the right tool for full-chip simulations. - Time-domain mixed-signal. Frequency-domain transfer
functions are the natural output. For mixed-signal time-domain
behaviour, run a numerical simulator.
The right workflow is usually: symbolic for design and
review, numerical for verification. They complement rather than
compete.
Quick start
pip install sympy matplotlib numpy
# Run a built-in example
python symbolic_solver.py --example rc_lowpass
# Solve your own netlist
python symbolic_solver.py my_circuit.cir
# Generate SVG schematic + LaTeX report
python symbolic_solver.py my_circuit.cir --svg --latex
Single Python file. No compilation step. MIT-licensed.
Why I built it
Most of the circuits I review professionally — analog front-ends,
power supplies, clocking trees — have a transfer function that fits on
one line, but only after you’ve slogged through SPICE output and
reverse-engineered which parameters dominate. The slog is wasteful. The
closed-form expression was always there; the simulator just wasn’t going
to print it for you.
This tool prints it.
Get it
- Repository: github.com/anovickis/symbolic-circuit-solver
- License: MIT
- Issues / PRs welcome.
Want help applying symbolic analysis to your circuit, or want a
closed-form review of an existing design? Get in touch.
#CircuitDesign #SPICE #SymbolicAnalysis #OpenSource #Python #SymPy
#AnalogDesign #ElectronicsEngineering