Cable Resistance / Non-looseless Power Transmission

This are only lists of links to other suggestions!
Search, if your idea has been already suggested.
Post Reply
User avatar
ssilk
Global Moderator
Global Moderator
Posts: 10430
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Cable Resistance / Non-looseless Power Transmission

Post by ssilk » Sat Sep 05, 2015 7:22 pm

This is about energy loss over distance.

First: The point, why I underline "over distance" is, that it makes no sense to add just some power loss per power pole or add different power networks with different voltage and transformers between the networks (just two examples of many ideas). The game-play won't change. The point of this suggestion is, that you need to think about energy distribution to distant points (maybe more than 500 tiles?) and this will not change, if you add just more energy usage. It's the opposite: The bigger you make your (single) electric network, the better. But it will change, if the energy transport via wires is at some point so expensive that you need to find other methods.

The current state of discussion is, that it is not so easy, cause it needs to calculate the flow of energy in the whole network for (nearly) every tick, which is far above the possibilities of current computers.

This is expressed at it's best in this article: viewtopic.php?f=6&t=24951&p=160688#p160031
Rseding91 wrote:I was actually looking at converting the fluid system to work more like the electric network for performance reasons.

Making the electric network operate like the fluid system does now is just not going to happen. The performance implications in doing that would be ridiculous and as the electric network got bigger the performance would drop off quickly.
In other words: Wanted (also by the devs), but not possible yet. (and a lot of work has been flown into the ideas till now, so if you have another idea: PLEASE read the threads below, to see, if there are some similarities).

Other ideas are mentioned in the discussion threads:

viewtopic.php?f=6&t=119 Energy Loss Over Distance (Very old! Nearly everything is said here!)
viewtopic.php?f=6&t=3133 New way for electricity
viewtopic.php?f=6&t=3098&hilit=power+resistance A few ideas that could be implemented.
viewtopic.php?f=6&t=15543 Power Conductor Limit
viewtopic.php?f=6&t=21314 Power Leakage and Electrical Substation
viewtopic.php?f=6&t=24951 Another approach to Cable Resistance (with fluid network)
viewtopic.php?f=6&t=54153 Another try of implementing Power Loss

Related:
With v0.13 we will get a power switch, that enables some interesting usages with the power network. See http://www.factorio.com/blog/post/fff-115

viewtopic.php?f=6&t=1261 Handling different electric networks

viewtopic.php?f=80&t=15546 Cable Resistance / Non-looseless Power Transmission
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...

EditorRUS
Fast Inserter
Fast Inserter
Posts: 118
Joined: Sat Feb 23, 2013 10:32 pm
Contact:

Re: Cable resistance / Non-looseless Power transmission

Post by EditorRUS » Thu Oct 01, 2015 5:31 pm

The current state of discussion is, that it is not so easy, cause it needs to calculate the flow of energy in the whole network for (nearly) every tick, which is far above the possibilities of current computers.
https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm

ratchetfreak
Filter Inserter
Filter Inserter
Posts: 927
Joined: Sat May 23, 2015 12:10 pm
Contact:

Re: Cable resistance / Non-looseless Power transmission

Post by ratchetfreak » Thu Oct 01, 2015 6:35 pm

EditorRUS wrote:
The current state of discussion is, that it is not so easy, cause it needs to calculate the flow of energy in the whole network for (nearly) every tick, which is far above the possibilities of current computers.
https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm
That's shortest path from 1 point to a destination

However for non lossless calculation you need a flow network

User avatar
ssilk
Global Moderator
Global Moderator
Posts: 10430
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Cable resistance / Non-looseless Power transmission

Post by ssilk » Sat Oct 03, 2015 7:09 am

EditorRUS wrote:
The current state of discussion is, that it is not so easy, cause it needs to calculate the flow of energy in the whole network for (nearly) every tick, which is far above the possibilities of current computers.
https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm
As ratchetfreak said, it's not just calculating from one point to all others, it's calculating from all points to all others. :)

Simplifications are possible but don't make sense.
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...

coolEE
Manual Inserter
Manual Inserter
Posts: 1
Joined: Wed Apr 06, 2016 5:43 pm
Contact:

Re: Cable Resistance / Non-looseless Power Transmission

Post by coolEE » Wed Apr 06, 2016 6:44 pm

I'm curious, considering I have little experience with coding for games and resource requirements for doing calculations, the feasibility of using a node-voltage equation matrix to find power loss in an electrical network over the wires at least. Now this may require that people need to be careful about setting up a power network, which I think would be cool. In brief, all that would need to be done is determine the voltage at the source of power, and the resistance over a particular length of wire, then the voltage at the final destination. Doing this simply, we could say it's whatever voltage required by the object +zero. Using the equation, you can find the voltage drop across each length of wire, then use P=V^2/R, you can find the power consumption of the wires in the network. This would open up a purpose for the development of transformers in the game to help mitigate losses over long distances. Then, if you wanted to make it really complicated (cool) introduce voltage drop across other things, like inserters, assembly plants, oil refinery etc. This would add a huge extra level of complexity I imagine, but I think it would be very cool! Then, perhaps even add 1,2and 3 phase inputs and outputs for electricity.

JoonasD6
Burner Inserter
Burner Inserter
Posts: 13
Joined: Mon Jun 27, 2016 6:16 pm
Contact:

Re: Cable Resistance / Non-looseless Power Transmission

Post by JoonasD6 » Mon Jun 27, 2016 6:29 pm

I also condone this brilliant idea. Worth noticing is that the maths behind it is well-known so there would not be much guessing or empty trials involved!

Specifically, this mechanic would make people train their intuition about inverse (first-order and quadratic) diminishing. Since P=V^2/R and resistance for a wire can be calculated as R=rho•l/A, where rho is material-specific resistivity, l length and A cross-sectional area, we can write power as a function of cable length: P(l)=V^2•A/(rho•l), so the power we get is inversely proportional to cable length. Also, if we're interested in how much the power changes in terms of length (which sounds like a useful quantity if you want to estimate how much the power drops for a given cable), by differentiating the former expression with respect to l, we get dP/dl=-V^2•A/(rho•l^2). So the rate of change of power is inversely proportional to the second power of cable length.

These calculations are quite straightforward ti implement, if the game already tracks cable lengths. For networks of cables (resistors in parallel and series), that takes a little bit more tweaking, but that's pretty much it. The cross-sectional area A can be a fixed constant or it can be incorporated into the calculations for parallel cables (two identical wires next to each other double the area). It would also be pretty amazing to offer the player upgrades; changing the wiring material (changing rho) one can lessen the power loss in a realistic (and easily calculable) way!

Fascinating. And I want this! :D

m44v
Fast Inserter
Fast Inserter
Posts: 108
Joined: Sun May 15, 2016 8:55 pm
Contact:

Re: Cable Resistance / Non-looseless Power Transmission

Post by m44v » Thu Jun 30, 2016 2:30 pm

I also condone this brilliant idea
Is basically just the direct application of the Kirchhoff's laws, kind of the first thing you learn when dealing with circuits. I presume the devs did their homework and got familiar with those laws before discarding the method because is not scalable.

Solving that is basically what SPICE does, solving numerically a NxM matrix equation with N as the number of nodes and M the number of branches (get off my back, I'm typing this by heart). Since each pole represents a node and each wire and factory element a branch, is probably not feasible to compute per game tick.

JoonasD6
Burner Inserter
Burner Inserter
Posts: 13
Joined: Mon Jun 27, 2016 6:16 pm
Contact:

Re: Cable Resistance / Non-looseless Power Transmission

Post by JoonasD6 » Thu Jun 30, 2016 10:39 pm

m44v wrote:
I also condone this brilliant idea
Is basically just the direct application of the Kirchhoff's laws, kind of the first thing you learn when dealing with circuits. I presume the devs did their homework and got familiar with those laws before discarding the method because is not scalable.

Solving that is basically what SPICE does, solving numerically a NxM matrix equation with N as the number of nodes and M the number of branches (get off my back, I'm typing this by heart). Since each pole represents a node and each wire and factory element a branch, is probably not feasible to compute per game tick.
There are certainly many ways to simplify/approximate the calculations without losing the main idea or make it confusing in-game. A very simple hack would be to ignore parallel cabling and just work with the maximum distance between power source and target machine. This would overestimate the power loss, but with appropriate scaling, it would feel quite realistic and would give the player an incentive to make paths shorter. This way multiple branches can be left alone.

tobin42
Manual Inserter
Manual Inserter
Posts: 1
Joined: Sun Oct 29, 2017 9:23 am
Contact:

Re: Cable Resistance / Non-looseless Power Transmission

Post by tobin42 » Sun Oct 29, 2017 10:11 am

Would it be an idea to set a maximum hop count for power delivery and then calculate usage in the covered area the way it's done right now. This way you only need recalculating of the distance/coverage map when power-poles are placed.

Not very realistic but reasonably clear to the players and doesn't need a lot of calculation.. I hope.

EditorRUS
Fast Inserter
Fast Inserter
Posts: 118
Joined: Sat Feb 23, 2013 10:32 pm
Contact:

Re: Cable Resistance / Non-looseless Power Transmission

Post by EditorRUS » Mon Oct 30, 2017 9:25 pm

Minecraft's Industrial Craft implements this in a robust fashion: by sending "packets" of energy through wires. This could be used to implement this system, but it would suffer from the fact that unlike IC, there are many more active energy generators in Factorio per tick and the way they work is incompatible with the packet system. IC's power generators have internal accumulators which are filled by the generator and returning packets (meaning unused packets recharge the accumulator back) and they send discrete amount of energy each tick. Solar panels would wreck the performance unless they were to be grouped and act like a singular power source. However, it would still be a good start.

Power quanta of Factorio seems to be 1 W of energy and we are dealing with millions, even billions of watts in game. This would, obviously, cause major lag and is not suitable as is, so there should a way to discretize energy consumption/production in a power network so that the least amount of packets had to be sent each tick (current?), enough to traverse the entire network (which would look like a directed graph, from sources to sinks) and not too many as you don't want to send packets to null paths. There is also an issue of redundant branches which must be eliminated first. Fortunately, it's quite intuitive that you only need to send exactly the number of sinks of packets at most and if and only if you for some reason decide to create one branch per sink which is exceedingly stupid and won't happen unless you specifically do so.


A similar system was implemented in Factorissimo which has you set the input/output wattage for a building and each building has an internal accumulator the capacity of which depends on the wattage set. It's for a different purpose, sure, but it works similarly.

Post Reply

Return to “Frequently Suggested / Link Collections”

Who is online

Users browsing this forum: No registered users and 1 guest