I've been working for some time trying to figure out how it might be possible to translate a schematic into something like a node graph, where each node is a component.
I've taken some liberties in creating it due to my limited understanding, but it seems to be working now for basic resistor circuits, for example:
# define the components V1 = Battery(5) R1 = Resistor(100) R2 = Resistor(200) R3 = Resistor(300) # connect the components and graph c = Circuit() c.connect(V1, R1).connect([R2,R3]).ground_all() c.graph()
Now I have a directed graph that solves for the currents at the edges (Everycircuit on the left):
This only handles the most basic cases (nothing time-related, multiple input/output, etc.). A couple questions about this:
- Other than showing current, what additional things would a normal 'current-solver' show or do?
- What seem to be the main ambiguities from the representation of the circuit on the right?