circuit-solver

Convert circuit netlists into Modified Nodal Analysis systems for solving.

Updated Apr 7, 2026
One-click install
npx skills add https://github.com/lgili/skillex --skill circuit-solver
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: circuit-solver
Source: https://github.com/lgili/skillex/tree/main/skills/circuit-solver
Command: npx skills add https://github.com/lgili/skillex --skill circuit-solver

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

It provides a robust framework to convert circuit netlists into solvable Modified Nodal Analysis systems by augmenting node equations with branch currents and enforcing a ground reference, enabling accurate simulation of complex circuits.

Core Features & Use Cases

  • MNA stamping for resistors, capacitors, inductors, voltage and current sources, switches, and controlled elements.
  • Sparse assembly and solve using LU factorization or Newton-Raphson iterations for nonlinear circuits.
  • Debugging and topology changes: re-stamp on switch state changes, validate matrix structure, and diagnose convergence issues.

Quick Start

Provide a circuit netlist and run the solver to obtain node voltages and branch currents.

Frequently Asked Questions about circuit-solver

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I convert a circuit netlist into a Modified Nodal Analysis matrix?

To convert a circuit netlist into a Modified Nodal Analysis matrix, you stamp resistors, capacitors, inductors, and sources into a sparse Y matrix while augmenting node voltages with branch currents. This enforces the ground reference and builds the Y·x = J system for solving.

What is the best way to solve nonlinear circuits using Newton-Raphson iterations?

Solving nonlinear circuits with Newton-Raphson iterations requires assembling a sparse Y matrix and repeatedly restamping elements until convergence is reached. The solver handles nonlinear elements by formulating and iterating through NR steps to calculate node voltages and branch currents.

How do I re-stamp circuit matrices when switch states change during simulation?

Re-stamping circuit matrices during switch state changes involves modifying the sparse Y matrix topology and applying incremental updates. This restamping process ensures the Y·x = J system accurately reflects the new circuit configuration before the next LU factorization.

Does MNA nodal analysis support both voltage and current controlled sources?

Yes, MNA nodal analysis supports voltage and current controlled sources by applying specific stamping rules. These controlled elements are integrated directly into the sparse Y matrix alongside standard components to accurately solve the Y·x = J system.

Why does my sparse matrix LU factorization fail to converge for nonlinear circuits?

Sparse matrix LU factorization fails to converge for nonlinear circuits when stamping rules are inconsistent or the ground reference is improperly enforced. Diagnosing convergence issues requires validating the matrix structure and ensuring proper Newton-Raphson iteration setup.

Can I use sparse matrix assembly for circuit simulation without external dependencies?

Yes, you can use sparse matrix assembly for circuit simulation without external dependencies. The solver independently assembles the sparse Y matrix and performs LU factorization or Newton-Raphson iterations natively using C++ implementations.