Idealized modelling of diodes, relays and switches in the framework of linear complementarity is introduced. Within the charge approach, the classical electromechanical analogy is extended to passively and actively switching components in electrical circuits. The associated branch relations are expressed in terms of set-valued functions, which allow to formulate the circuit’s dynamic behaviour as a dierential inclusion. This approach is demonstrated by the example of the DC–DC buck converter. A dierence scheme, known in mechanics as time stepping, is applied for numerical approximation of the evolution problem. The discretized inclusions are formulated as a linear complementarity problem in standard form, which implicitly takes care of all ...