0

I have to do a DC circuit builder application, something like this or this. I did all the building logic but I dont know how to analyze the generated circuit. The circuit is represented in memory as a graph in which each node is a circuit element (light bulb, resistor..) and I want to know the current through each side to light the bulb if necessary. There's a library in Java that can do this? Or any algorithm? Or someone can explain me how to solve the problem?

I know I have to find the circuit loops (graph loops) and apply Ohm's law, but some loops will share some circuit elements and I can not figure out what to do next.

Jorj
  • 1,291
  • 1
  • 11
  • 32

2 Answers2

1

There are a several models for this kind of computation. https://en.wikipedia.org/wiki/Network_analysis_(electrical_circuits) gives you a nice overview and you can go on from there. I assume this is for a school/university assignment? Then you probably do not need to program a full fledged analyzer, you should probably ask your teacher what exactly you need to do and whether they have a suggestion.

Aside from that, said Wikipedia page should have plenty of keywords for further research.

AnoE
  • 8,048
  • 1
  • 21
  • 36
1

This question is probably better on https://electronics.stackexchange.com/ However, a rough sketch of what you need to do is to apply Kirchhoff's loop laws. https://en.wikipedia.org/wiki/Kirchhoff%27s_circuit_laws This will give you as set of linear equations which you convert to a matrix representation and which you can then solve by the Gaussian elimination algorithm: https://en.wikipedia.org/wiki/Gaussian_elimination

Community
  • 1
  • 1
corriganjc
  • 660
  • 7
  • 21