Tellegen's theorem and electrical networks