Feel free to read the full explanation on a pretty awesome example: https://en.wikipedia.org/wiki/Donaudampfschiffahrtselektrizi...