Energy methods in electrical networks