From electrical switched networks to hybrid automata