What this repository is about?
this repository is about modeling circuits as graphs and analyzing them with graph theory algorithms for more detail read this article
How to run this?
How to give Gracc a circuit as an input?
the goal is to give a picture as an input but since hand drawn circuit detection is still underdevelopment we use a text file to do so :-)
How to give Gracc an input via text?
- well, we got to descript a circuit (kirchoff_graph) with a text file to do so:
in the first line of the text write two number, the first one is nodes_number and the second is edges_number
in the next n lines (n = edges_number) you've got to explain the edges details
such that ( x y z a b c ) means that node x and y are
connected with z_ohm resistor , a_volt battery , b_farad capacitor & c_henry inductor - for example consider circuit1 as an input, it is descripting this circuit
- after descripting your circuit as a text locate it Here open the jupyter file and download your circuit by wget like that
How to see the solution of our circut?
- run all the cell in the jupyter file
- parse your text file to create the kirchoff graph by
kg5 = circuit_parser('circuit5.txt')
- plot your input to see your input by
plot_kirchoffgraph(kg5)
- analyze the input by
plot_kirchoffgraph_after_solving(kg5)
- then you will see the solution of your circuit for example for the circuit5 the solution is: