In this paper a method is presented to build an Euler Lagrange model for switching electrical networks in a structured general way, which is also applicable to ideal electrical circuits without switches. The switches make the dynamic models nonlinear. For using the Lagrangian structure for controller design, a preliminary study of the zero-dynamics of such switching network is presented. A case study, where a passivity based controller has been applied, is given for the Ćuk converter.