Anthonny.

Circuit Sim

Circuit Sim is an early Rust electrical-engineering learning project. It is not intended to compete with LTspice or serve as a production circuit design tool. The point is to understand the path from a circuit description to numbers that can be inspected, rather than hiding that path behind a mature simulator. Learning from first principles matters because each equation and assumption remains visible: a learner can connect a circuit description to conservation laws, then to a numerical result, and inspect where a mistaken assumption enters. The emphasis is understanding the reasoning, not treating a simulator as a black box.

The engineering problem

A simulator has to turn components and their connections into a well-defined mathematical problem. A resistor, voltage source, or other component contributes relationships between nodes. Nodes identify connection points, while branches represent component paths between them. Voltage and current sign conventions must be chosen and kept consistent; reversing one convention changes the equations even when the circuit drawing looks the same. The simulator must identify those nodes, choose a consistent reference, assemble the component contributions, solve the resulting system, and map the solution back to voltages and currents. Each boundary is a useful place to learn because an incorrect node identity or sign convention can produce plausible-looking but wrong results.

Learning progression

The intended progression starts with a small circuit description and explicit node and component representations. From there, Kirchhoff's Current Law and Kirchhoff's Voltage Law provide the equations: KCL describes current balance at nodes, while KVL describes the voltage relationships around branches and loops. Nodal analysis expresses unknown node voltages from current balance. Modified Nodal Analysis extends the system so voltage sources and other elements that do not fit a simple nodal admittance contribution can be represented with additional unknowns and equations.

The next steps are matrix or linear-system assembly, a numerical solve, and a result mapping layer that reports node voltages and component currents in the terms used by the original circuit. Small hand-checkable examples are more valuable here than a large component catalogue: they make conservation laws, units, singular systems, and reference-node choices visible.

Scope and status

The project is intentionally early. Parsing, stamping, solving, and a particular component model are learning targets rather than completed features claimed here. Those boundaries describe the current direction: Rust is a bridge between systems programming and electrical engineering in this project, while electrical-engineering concepts remain the primary constraint.

Status: Early development, learning project.

Built with Rust.

Back to work