Universal-Electricity/Universal-Electricity — pull request #122 by unpairedbracket (2013-08-23 03:38:35+00:00)
Title: Improve ElectricityNetwork's ohmic loss calculations

The new calculation isn't exactly _physical_ but it's certainly closer than the old one, and allows for expansion into machines having configurable resistances of their own, which might be useful, I guess.

There is a method I thought of a while ago of implementing resistance in these types of network (using nodal analysis) that would give physically accurate results but it's way more complicated and requires linear algebra solvers to be done efficiently. It would get rid of those weird anomalies where the whole network's resistance is used for 2 machines right next to each other, but it would also force us to abandon the notion of machines being able to emit an arbitrary power at an arbitrary voltage into a network of arbitrary resistance (that's not realistic anyway, there's only 2 degrees of freedom in the system, so setting the resistance and the voltage fixes the power to one specific value, and vice versa for the other pairs of quantities). People seem to like it though, so whatever. Maybe some day I'll try and implement the realistic system, but today is not that day.