# A variational approach for modelling and simulating electrical circuits

Variational integrators are based on a discrete variational formulation of the underlying system, e.g. based on a discrete version of Hamilton’s principle for conservative mechanical systems. The resulting integrators are symplectic and momentum preserving and have an excellent long-time energy behavior. So far, variational integrators have been mainly developed and used for a wide variety of mechanical systems. However, considering real-life systems, these are in general not of purely mechanical character. In fact, more and more systems become multidisciplinary in the sense, that not only mechanical parts, but also electrical and software subsystems are involved, resulting into a mechatronic systems. Since the integration of these systems with a unified simulation tool is desirable, the aim is to extend the applicability of variational integrators to mechatronic system.

In this talk, we develop a variational integrator for the simulation of electrical circuits as first step towards a unified simulation of electro-mechanical systems. When considering the dynamics of an electrical circuit, one is faced with three special situations that lead to a special treatment within the variational formulation and thus the construction of appropriate variational integrators: 1. The system involves external (control) forcing through external (controlled) voltage sources. 2. The system in constrained via the Kirchhoff current (KCL) and voltage laws (KVL). 3. The Lagrangian is degenerate.

A comparison of a variational integrator based on the discrete constrained Lagrange-d’Alembert-Pontryagin principle with a simple BDF method (which is usually the method of choice for the simulation of electrical circuits) shows that even for simple LCR circuits a better energy behavior can be observed for the variational integrator, whereas the BDF method (non-symplectic) fails in capturing the energy preservation (LC circuits) or, in the presence of resistors (LCR circuits), the correct energy decay. In addition, from numerical experiments we observe that using a variational integrator, also the current frequencies are much better preserved than for standard Runge-Kutta or BDF schemes without taking adaptive time stepping into account.

This is joint work with Jerry Marsden, Houman Owhadi and Molei Tao from CalTech.

This talk is part of the Applied and Computational Analysis series.