arxiv: v1 [math.na] 8 Mar 2011

Similar documents
Variational Integrators for Electrical Circuits

Variational integrators for electric and nonsmooth systems

Implicit-explicit variational integration of highly oscillatory problems

Symmetry Labeling of Molecular Energies

MA455 Manifolds Solutions 1 May 2008

Discrete Dirac Mechanics and Discrete Dirac Geometry

Lecture 2: Symplectic integrators

Polynomial Interpolation

Dirac Structures and the Legendre Transformation for Implicit Lagrangian and Hamiltonian Systems

SECTION 3.2: DERIVATIVE FUNCTIONS and DIFFERENTIABILITY

Chapter 5 FINITE DIFFERENCE METHOD (FDM)

Generic maximum nullity of a graph

A First-Order System Approach for Diffusion Equation. I. Second-Order Residual-Distribution Schemes

A h u h = f h. 4.1 The CoarseGrid SystemandtheResidual Equation

LIMITATIONS OF EULER S METHOD FOR NUMERICAL INTEGRATION

Chapter 4: Numerical Methods for Common Mathematical Problems

THE STURM-LIOUVILLE-TRANSFORMATION FOR THE SOLUTION OF VECTOR PARTIAL DIFFERENTIAL EQUATIONS. L. Trautmann, R. Rabenstein

How to Find the Derivative of a Function: Calculus 1

Recent Progress in the Integration of Poisson Systems via the Mid Point Rule and Runge Kutta Algorithm

5 Ordinary Differential Equations: Finite Difference Methods for Boundary Problems

Discontinuous Galerkin Methods for Relativistic Vlasov-Maxwell System

Polynomial Interpolation

ETNA Kent State University

Quasiperiodic phenomena in the Van der Pol - Mathieu equation

Travelling waves for a thin liquid film with surfactant on an inclined plane

ch (for some fixed positive number c) reaching c

Material for Difference Quotient

Parameter Fitted Scheme for Singularly Perturbed Delay Differential Equations

4. The slope of the line 2x 7y = 8 is (a) 2/7 (b) 7/2 (c) 2 (d) 2/7 (e) None of these.

1 The concept of limits (p.217 p.229, p.242 p.249, p.255 p.256) 1.1 Limits Consider the function determined by the formula 3. x since at this point

New Streamfunction Approach for Magnetohydrodynamics

Arbitrary order exactly divergence-free central discontinuous Galerkin methods for ideal MHD equations

2.8 The Derivative as a Function

Flavius Guiaş. X(t + h) = X(t) + F (X(s)) ds.

Quantum Theory of the Atomic Nucleus

Consider a function f we ll specify which assumptions we need to make about it in a minute. Let us reformulate the integral. 1 f(x) dx.

Efficient algorithms for for clone items detection

A classical particle with spin realized

3 Parabolic Differential Equations

MATH745 Fall MATH745 Fall

Quantum Numbers and Rules

Solving Continuous Linear Least-Squares Problems by Iterated Projection

Digital Filter Structures

1. Questions (a) through (e) refer to the graph of the function f given below. (A) 0 (B) 1 (C) 2 (D) 4 (E) does not exist

A = h w (1) Error Analysis Physics 141

Quantum Mechanics Chapter 1.5: An illustration using measurements of particle spin.

Dedicated to the 70th birthday of Professor Lin Qun

MODIFIED DIFFERENTIAL EQUATIONS. Dedicated to Prof. Michel Crouzeix

= 0 and states ''hence there is a stationary point'' All aspects of the proof dx must be correct (c)

Differentiation in higher dimensions

Solutions to the Multivariable Calculus and Linear Algebra problems on the Comprehensive Examination of January 31, 2014

1 Calculus. 1.1 Gradients and the Derivative. Q f(x+h) f(x)

A Hybrid Mixed Discontinuous Galerkin Finite Element Method for Convection-Diffusion Problems

THE IDEA OF DIFFERENTIABILITY FOR FUNCTIONS OF SEVERAL VARIABLES Math 225

Numerical Differentiation

LIMITS AND DERIVATIVES CONDITIONS FOR THE EXISTENCE OF A LIMIT

Exam 1 Review Solutions

A SHORT INTRODUCTION TO BANACH LATTICES AND

lecture 26: Richardson extrapolation

Volume 29, Issue 3. Existence of competitive equilibrium in economies with multi-member households

The Verlet Algorithm for Molecular Dynamics Simulations

A geometric Birkhoffian formalism for nonlinear RLC networks

ERROR BOUNDS FOR THE METHODS OF GLIMM, GODUNOV AND LEVEQUE BRADLEY J. LUCIER*

Mass Lumping for Constant Density Acoustics

A Mixed-Hybrid-Discontinuous Galerkin Finite Element Method for Convection-Diffusion Problems

Quaternion Dynamics, Part 1 Functions, Derivatives, and Integrals. Gary D. Simpson. rev 01 Aug 08, 2016.

Blanca Bujanda, Juan Carlos Jorge NEW EFFICIENT TIME INTEGRATORS FOR NON-LINEAR PARABOLIC PROBLEMS

More on generalized inverses of partitioned matrices with Banachiewicz-Schur forms

Finite Difference Method

Recall from our discussion of continuity in lecture a function is continuous at a point x = a if and only if

Application of numerical integration methods to continuously variable transmission dynamics models a

THE DISCRETE PLATEAU PROBLEM: CONVERGENCE RESULTS

Finite Difference Methods Assignments

OSCILLATION OF SOLUTIONS TO NON-LINEAR DIFFERENCE EQUATIONS WITH SEVERAL ADVANCED ARGUMENTS. Sandra Pinelas and Julio G. Dix

MAT244 - Ordinary Di erential Equations - Summer 2016 Assignment 2 Due: July 20, 2016

Superconvergence of energy-conserving discontinuous Galerkin methods for. linear hyperbolic equations. Abstract

On convexity of polynomial paths and generalized majorizations

MIXED DISCONTINUOUS GALERKIN APPROXIMATION OF THE MAXWELL OPERATOR. SIAM J. Numer. Anal., Vol. 42 (2004), pp

AMS 147 Computational Methods and Applications Lecture 09 Copyright by Hongyun Wang, UCSC. Exact value. Effect of round-off error.

Solution for the Homework 4

Fast Explicit and Unconditionally Stable FDTD Method for Electromagnetic Analysis Jin Yan, Graduate Student Member, IEEE, and Dan Jiao, Fellow, IEEE

Continuity and Differentiability Worksheet

Click here to see an animation of the derivative

Taylor Series and the Mean Value Theorem of Derivatives

arxiv: v2 [math.na] 11 Dec 2016

arxiv: v1 [math.na] 28 Apr 2017

Preconditioning in H(div) and Applications

Energy-preserving variant of collocation methods 1

Analysis of A Continuous Finite Element Method for H(curl, div)-elliptic Interface Problem

arxiv: v1 [math.ag] 13 Jan 2019

Copyright c 2008 Kevin Long

The Laplace equation, cylindrically or spherically symmetric case

CONVERGENCE ANALYSIS OF YEE SCHEMES FOR MAXWELL S EQUATIONS IN DEBYE AND LORENTZ DISPERSIVE MEDIA

arxiv: v1 [math.oc] 18 May 2018

WYSE Academic Challenge 2004 Sectional Mathematics Solution Set

Poisson Equation in Sobolev Spaces

arxiv: v1 [math.na] 7 Mar 2019

CONVERGENCE ANALYSIS OF YEE SCHEMES FOR MAXWELL S EQUATIONS IN DEBYE AND LORENTZ DISPERSIVE MEDIA

5.74 Introductory Quantum Mechanics II

Weierstraß-Institut. im Forschungsverbund Berlin e.v. Preprint ISSN

Transcription:

Variational integrators for electric circuits Sina Ober-Blöbaum a, Molei Tao b, Mulin Ceng c, Houman Owadi b,c, Jerrold E. Marsden b,c, a Computational Dynamics and Optimal Control, University of Paderborn, Germany b Control and Dynamical Systems, California Institute of Tecnology, USA c Applied and Computational Matematics, California Institute of Tecnology, USA arxiv:3.859v [mat.na] 8 Mar Abstract In tis contribution, we develop a variational integrator for te simulation of (stocastic and multiscale) electric circuits. Wen considering te dynamics of an electrical circuit, one is faced wit tree special situations:. Te system involves external (control) forcing troug external (controlled) voltage sources and resistors.. Te system is constrained via te Kircoff current (KCL) and voltage laws (KVL). 3. Te Lagrangian is degenerate. Based on a geometric setting, an appropriate variational formulation is presented to model te circuit from wic te equations of motion are derived. A -discrete variational formulation provides an iteration sceme for te simulation of te electric circuit. Dependent on te discretization, te intrinsic degeneracy of te system can be canceled for te discrete variational sceme. In tis way, a variational integrator is constructed tat gains several advantages compared to standard integration tools for circuits; in particular, a comparison to BDF metods (wic are usually te metod of coice for te simulation of electric circuits) sows tat even for simple LCR circuits, a better energy beavior and frequency spectrum preservation can be observed using te developed variational integrator. Keywords: structure-preserving integration, variational integrators, degenerate systems, electric circuits, noisy systems, multiscale integration. Introduction Variational integrators ave mainly been developed and used for a wide variety of mecanical systems. However, real-life systems are generally not of purely mecanical caracter. In fact, more and more systems become multidisciplinary in te sense, tat not only mecanical parts, but also electric and software subsystems are involved, resulting in mecatronic systems. Since te integration of tese systems wit a unified simulation tool is desirable, te aim of tis work is to extend te applicability of variational integrators to mecatronic systems. In particular, as te first step towards a unified simulation, we develop a variational integrator for te simulation of electric circuits. Overview. Variational integrators [3] are based on a discrete variational formulation of te underlying system, e.g. based on a discrete version of Hamilton s principle for conservative mecanical systems. Te resulting integrators given by te discrete Euler-Lagrange equations are symplectic and momentum-preserving and ave an excellent long energy beavior. Coosing different variational formulations (e.g. Hamilton, Lagrange-d Alembert, Hamilton- Pontryagin, etc.), variational integrators ave been developed for classical conservative mecanical systems (for an overview see [4, 5]), forced [8] and controlled [34] systems, constrained systems (olonomic [6, 7] and nonolonomic systems [9]), nonsmoot systems [], stocastic systems [6], and multiscale systems [39]. Most of tese systems sare te assumption, tat tey are non-degenerate, i.e. te Legendre transformation of te corresponding Lagrangian is a diffeomorpism. Applying Hamilton s principle to a regular Lagrangian system, te resulting Euler-Lagrange equations are ordinary differential equations of second order and equivalent to Hamilton s equations. Preprint submitted to Journal of Computational Pysics deceased Preprint submitted to Elsevier Marc,

Te Lagrangian formulation for LC circuits is based on te electric and magnetic energies in te circuit and te interconnection constraints expressed in te Kircoff laws. Tere exist a large variety of different approaces for a Lagrangian or Hamiltonian formulation of electric circuits (see e.g. [9,,,, 38] and references terein). All of teses autors treat te question of wic coice of te Lagrangian coordinates and derivatives is te most appropriate one. Several settings ave been proposed and analyzed, e.g. a variational formulation based on capacitor carges and currents, on inductor fluxes and voltages, and a combination of bot settings, as well as formulations based on linear combinations of te carges and flux linkages. Typically, one wants to find a set of generalized coordinates, suc tat te resulting Lagrangian is non-degenerate. However, witin suc a formulation, te variables are not easily interpretable in terms of original terms of a circuit. A recently-considered alternative formulation is based on a redundant set of coordinates resulting in a Lagrangian system for wic te Lagrangian is degenerate. For a degenerate Lagrangian system, i.e. te Legendre transform is not invertible, te Euler-Lagrange equations involve additional idden algebraic constraints. Ten, te equations do not ave a unique solution, and additional constraints are required for unique solvability of te system. For te circuit case, tese are provided by te Kircoff Current Law (KCL). From a geometric point of view, te KCL provides a constraint distribution tat induces a Dirac structure for te degenerate system. Te associated system is ten denoted by an implicit Lagrangian system. In [4] and [4], it was sown tat nonolonomic mecanical systems and LC circuits as degenerate Lagrangian systems can be formulated in te context of induced Dirac structures and associated implicit Lagrangian systems. Te variational structure of an implicit Lagrange system is given in te context of te Hamiltonian-Pontryagin-d Alembert principle, as sown in [43]. Te resulting Euler-Lagrange equations are called te implicit Euler-Lagrange equations [4, 43, 3], wic are semi-explicit differential-algebraic equations tat consist of a system of first order differential equations and an additional algebraic equation tat constrains te image of te Legendre transformation (called te set of primary constraints). Tus, te modeling of electric circuits involves bot primary constraints as well as constraints coming from Kircoff s laws. In [7], an extension towards te interconnection of implicit Lagrange systems for electric circuits is demonstrated. For completeness, we ave to mention tat te corresponding notion of implicit Hamiltonian systems and implicit Hamiltonian equations was developed earlier by [3, 3, 4]. An intrinsic Hamiltonian formulation of dynamics of LC circuits as well as interconnections of Dirac structures ave been developed, e.g. in [3] and [8], respectively. Tere are only a few works dealing wit te variational simulation of degenerate systems, e.g. in [36], variational integrators wit application to point vertices as a special case of degenerate Lagrangian system are developed. Altoug tere exists a variety of different variational formulations for electric circuits, variational integrators for teir simulation ave not been concretely investigated and applied tus far. In [], a framework for te description of te discrete analogues of implicit Lagrangian and Hamiltonian systems is proposed. Tis framework is te foundation for te development of an integration sceme. However, no concrete simulation scenarios ave yet been performed. Furtermore, te discrete formulation of te variational principle is sligtly different from te approac presented in tis work, tus resulting in a different sceme. Contribution. In tis work, we present a unified variational framework for te modeling and simulation of electric circuits. Te focus of our analysis is on te case of ideal linear circuit elements, consisting of inductors, capacitors, resistors and voltage sources. However, tis is not a restriction of tis approac, and te variational integrators can also be developed for nonlinear circuits, wic is left for future work. A geometric formulation of te different possible state spaces for a circuit model is introduced. Tis geometric view point forms te basis for a variational formulation. Rater tan dealing wit Dirac structures, we work directly wit te corresponding variational principle, were we follow te approac introduced in [43]. Wen considering te dynamics of an electric circuit, one is faced wit tree specific situations tat lead to a special treatment witin te variational formulation and tus te construction of appropriate variational integrators:. Te system involves external (control) forcing troug external (controlled) voltage sources.. Te system is constrained via te Kircoff current (KCL) and voltage laws (KVL). 3. Te Lagrangian is degenerate leading to primary constraints. For te treatment of forced systems, te Lagrange-d Alembert principle is te principle of coice. Involving constraints, one as to consider constrained variations resulting in a constrained principle. Te degeneracy requires te use of te Pontryagin version; tus, te principle of coice is te constrained Lagrange-d Alembert-Pontryagin principle [43]. Two variational formulations are considered: First, a constrained variational formulation is introduced for wic te KCL constraints are explicitly given as algebraic constraints, wereas te KVL are given by te resulting Euler-Lagrange equations. Second, an equivalent reduced

constrained variational principle is developed, for wic te KCL constraints are eliminated due to a representation of te Lagrangian on a reduced space. In tis setting, te carges and flux linkages are te differential variables, wereas te currents play te role of algebraic variables. Te number of inductors in te circuit and te circuit topology determine te degree of degeneracy of te system. For te reduced version, we sow for wic cases te degeneracy of te system is canceled via te KCL constraints. Based on te variational formulation, a variational integrator for electric circuits can be constructed. For te case of a degenerate system, te applicability of te variational integrator is dependent on te coice of discretization. Based on te type and order of te discretization, te degeneracy of te continuous system is canceled for te resulting discrete sceme. Tree different integrators and teir applicability to different electric circuits are investigated. Te generality of a unified geometric (and discrete) variational formulation is advantageous for te analysis for very complex circuits in particular. Using te geometric approac, te main structure-preserving properties of te (discrete) Lagrangian system can be derived. In particular, good energy beavior and preservation of te spectrum of ig frequencies of te solutions can be observed. Furtermore, preserved momentum maps due to symmetries of te Lagrangian system can be derived. Going one step furter, we extend te approac to a stocastic and multiscale setting. Due to te variational framework, te resulting stocastic integrator will well capture te statistics of te solution (see for instance [7]), and te resulting multiscale integrator will still be variational [39]. Outline. In Section, we first review te basic notation for electric circuits followed by a grap representation to describe te circuit topology. In addition, we introduce a geometric formulation tat gives an interpretation of te different state spaces of a circuit model. Based on te geometric view point, te two (reduced and unreduced) variational formulations are derived in Section 3. Te equivalence of bot formulations as well as conditions for obtaining a nondegenerate reduced system are proven. In Section 4, te construction of different variational integrators for electric circuits is described and conditions for teir applicability are derived. Te main structure-preserving properties of te Lagrangian system and te variational integrator are summarized in Section 5. In Section 6, te approac is extended for te treatment of noisy circuits. In Section 7, te efficiency of te developed variational integrators is demonstrated by means of numerical examples. A comparison wit standard circuit modeling and circuit integrators is given. In particular, te applicability of te multiscale metod FLAVOR [39] is demonstrated for a circuit wit different scales.. Electric circuits.. Basic notations Considering an electric circuit, we introduce te following notations (following [33]): A node is a point in te circuit were two or more elements meet. A pat is a trace of adjacent elements, wit no elements included more tan once. A branc is a pat tat connects two nodes. A loop is a pat tat begins and ends at te same node. A mes (also called fundamental loop) is a loop tat does not enclose any oter loops. A planar circuit is a circuit tat can be drawn on a plane witout crossing brances. Let q(t), v(t), u(t) R n be te -dependent carges, te currents and voltages of te circuit elements wit t [, T], were q J (t), v J (t), u J (t) R n J, J {L, C, R, V} are te corresponding quantities troug te n L inductors, te n C capacitors, te n R resistors, and te n V voltage sources. In addition, we give eac of tose devices an assumed current flow direction. In Table, te caracteristic equations for basic elements are listed. For te analysis in tis work, we focus on ideal linear circuit elements, resulting in te following constitutive laws: u L (t) = L v L (t), v C (t) = C u C (t), u R (t) = Rv R (t), wit inductance L, capacitance C and resistance R = G wit conductance G and were in general it olds q(t) = v(t). Te flux linkage for eac element is denoted by p(t) R n and for an inductor, it is defined as te integral of te voltage across te inductor. Note tat in te case of an inductor (resp. a capacitor), te associated carge q L (resp. flux linkage p C ) is an artificial variable. Similarly, for te resistors and te voltage sources, te associated carges q R, q V and flux linkages p R, p V are artificial variables. 3

+! device linear nonlinear resistor v R = Gu R v R = g(u R, t) capacitor v C = C d dt u C v C = d dt q C(u C, t) inductor u L = L d dt v L u L = d dt p L(v L, t) device independent controlled voltage source u V = v(t) u V = v(u ctrl, v ctrl, t) current source v I = i(t) v I = v(u ctrl, v ctrl, t) Table : Caracteristic equations for basic circuit elements. Ideal inductors and capacitors are purely reactive, i.e. tey dissipate no energy. Tus, te magnetic energy stored in one inductor wit inductance L is E mag = Lv L were te amount of energy storage in one capacitor wit capacitance C is.. Grap representation E el = qc q= u C dq = qc q= q C dq = C q C. Consider now a circuit as a connected, directed grap wit n edges and m + nodes. On te it edge, tere are: a capacitor wit capacitance C i, an inductor wit inductance L i, a voltage source ɛ i and a resistor wit resistance R i, one or several of wic can be zeros (cf. Figure ). Tus, brances in te circuit correspond to edges in te grap. In te L i C i R i " i Figure : A typical branc of a circuit. On tis edge, tere are: an inductor L i, a capacitor C i, a resistor R i, and a voltage source ɛ i, one or several of wic can be zeros. special case tat eac edge in te grap represents only one circuit element, te number of edges in te grap equals te number of circuit elements, and te number of nodes of te circuit and te grap are te same. For simplicity, we use te notions from circuit teory, i.e. talking about brances and meses in te grap. For te analysis wit circuits, one is faced wit te following two basic laws:. Te Kircoff Current Law (KCL) states tat te sum of currents leading to and leaving from any node is equal to zero.. Te Kircoff Voltage Law (KVL) states tat te sum of voltages along eac mes (or fundamental loop) of te network is equal to zero. Let K R n,m be te Kircoff Constraint matrix of a given circuit represented via a grap defined by K i j = branc i connected inward to node j + branc i connected outward to node j oterwise. In te special case were te two ends of an edge are connected to te same node, we set K i j =. Since te ground node is excluded, te Kircoff Constraint matrix as only m rater tan m + columns. Allowing only one circuit 4 ()

element for one branc, eiter inductor, capacitor, resistor, or voltage source, K can be expressed as K = K L K C K R K V were K J R n J,m, J {L, C, R, V} is te Constraint Matrix for te set of n L inductors, n C capacitors, n R resistors, and n V voltage sources, respectively wit n L + n C + n R + n V = n. Te Kircoff Constraint Matrix provides te Kircoff current constraints as K T v =. For connected, planar graps, te number of meses l is determined via l = n m, were n is te number of brances and m + te number of nodes. Tis is a direct consequence from Euler s formula [3]. We can tus define te Fundamental Loop matrix K R n,n m by K,i j =, branc i is a backward branc in mes j + branc i is a forward branc in mes j branc i does not belong to mes j, () were again K can be expressed as K = K,L K,C K,R K,V wit K,J R n J,n m, J {L, C, R, V} is te Loop Matrix for te set of n L inductors, n C capacitors, n R resistors, and n V voltage sources, respectively. Te Fundamental Loop Matrix provides te Kircoff voltage constraints as K T u =. An alternative expression of te Kircoff voltage constraints is given by Kû = u, were û are te node voltages of te circuit. By u ker(k T ) and u im(k) it follows directly ker(kt ) = im(k) and tus im(k ) im(k)..3. Geometric setting Using a geometric approac for analyzing circuits, we define te configuration manifold to be te carge space Q R n of circuit brances wit points on te manifold denoted by q Q. For a particular carge configuration q, te tangent bundle T Q is te current space wit currents v T q Q R n passing troug te brances. Te corresponding cotangent bundle T Q is te flux linkage space wit te flux linkages p T q Q R n. Note tat due to te analogon of te quantities, configuration, velocity and momentum in mecanical systems we stick wit te notation (q, v, p) for carge, current and flux linkage. Te branc voltages u are te analogon of forces for te mecanical system and are tus assumed to be covectors in te cotangent space T q Q. Let Q T Q be a constraint distribution, wic is locally given by Q (q) = {v T q Q w a, v =, a =,..., m} T q Q (3) wit te natural pairing, : T q Q T q Q R of cotangent and tangent vectors. w a are m independent one-forms tat form te basis for te anniilator Q (q) T Q wic is locally given by Q (q) = {w T q Q w, v = v Q (q)} T q Q. (4) Using te matrix K T as local coordinate representation for te one-forms w a, te distribution (3) forms te constraint KCL space given by te submanifold Q (q) = {v T q Q K T v = } T q Q, tat is spanned by ker(k T ). Its anniilator Q (q) can tus locally expressed by te image im(k) of K. Cooing tis coordinate representation and wit ker(k T ) = im(k), te anniilator (4) decribes te constraint KVL space by Q (q) = {u T q Q K T u = } T q Q 5

Note, tat te coices of K and K are in general not unique. Te only design criterium for K is te condition im(k) im(k ). Alternative to (), a matrix K can be constructed using a QR-decomposition of K. Tus, tis approac is not restricted to cases, were te mes topology is obvious as for planar graps. However, in te following we work wit te Fundamental Loop matrix as candidate for te matrix K due to te pysical interpretation. From a geometric point of view we can distinguis between tree different spaces: Let B denote te space of brances, M te space of meses and N te space of nodes, were we exclude te one node defined as ground. (q, v, p, u) denote te branc carges, currents, flux linkages, and voltages, and ( q, ṽ, p, ũ) and (ˆq, ˆv, ˆp, û) te corresponding quantities in mes and node space, respectively. From KCL and KVL we know tat te node currents (and carges) as well as te mes voltages are zero. For M and N, we define te corresponding configuration, tangent and cotangent spaces M R n m, T q M R n m, T q M Rn m and N R m, T ˆq N R m, T ˆq N Rm. Ten, branc, loop and node space are defined to be te Pontryagin bundle consisting of te direct sum of tangent and cotangent space, i.e. B = Q Q, M = T M T M and N = T N T N. Te following diagram gives te relation between te defined spaces in terms of te Kircoff Constraint matrix K and te Fundamental Loop matrix K T N K Q K T T M N B M nodes brances meses T N Q K T K T M (5) wit te linear maps K T : Q T N and K : T M Q, and teir adjoints K : T N Q and KT : Q T M. As already stated above, te branc currents consistent wit KCL are determined by ker(k T ), were te branc voltages consistent wit KVL are given by ker(k T ). On te oter and, from diagram (5) we can directly follow, tat te set of branc currents fulfilling te KCL can alternatively expressed as v = K ṽ, wereas te set of branc voltages tat fulfill te KVL are in te image of K as u = Kû. Tese are te standard relations between branc currents v(t) and mes currents ṽ(t) and branc voltages u(t) and node voltages û(t), respectively, given by KCL and KVL. Note, tat diagram (5) represents te general relations between te tangent bundles T Q, T N, and T M, and te corresponding cotangent bundles. Te matrices K and K are local coordinate coices for te embeddings of te different spaces. Tese are not unique, owever using different coordinates representations, te submanifolds T N, T N, T M, and T M loose teir pysical meaning. Following te lines of [43] te tangent space at q can be splitted suc tat T q Q = H q V q, were H q = q (q) is te orizontal space and V q te vertical space at q. Te matrix K T is a local matrix representation of te Eresmann connection A q : T q Q V q. Remark. A branc can consist of more tan one circuit element in a row. In tis case, te branc voltage is assumed to be te sum of te voltages of all elements in tis branc. 3. Variational formulation for electric circuits In te following, we derive te equations of motion for te circuit system, making use of variational principles known in mecanics. Due to te constrained system (via KCL and KVL), we present two different variational formulations tat distinguis te way te constraints are involved. 3.. Constrained variational formulation We can define a Lagrangian L : T Q R of te circuit system consisting of te difference between magnetic and electric energy as L(q, v) = vt Lv qt Cq (6) 6

wit L = diag(l,..., L n ) and C = diag ( ) C,..., C n. In te case were no inductor (resp. no capacitor) is on branc i, te corresponding entry L i (resp. C i ) in te matrix L (resp. C) is zero. In te presence of mutual inductors rater tan self inductors, te matrix L is not diagonal anymore, but always positive semi-definite. If not explicitly mentioned te following teory and construction is also valid for mutual inductors. Te Legendre transform FL : T Q T Q is defined by FL(q, v) = (q, L/ v) = (q, Lv). (7) Note tat te Lagrangian can be degenerate if te Legendre transform is not invertible, i.e. L is singular. Te constraint flux linkage subspace is defined by te Legendre transform as P = FL( Q ) T Q, were Q T Q is te distribution. Te Lagrangian force of te system consists of a damping force tat results from te resistors and an external force being te voltage sources f L (q, v, t) = diag(r)v + diag(e)u (8) wit R = (R,..., R n ) T and E = (ɛ,..., ɛ n ) T. If no resistor is on branc i, te corresponding entry R i in te vector R is zero. For te entries of te vector E, it olds ɛ i = if no voltage source is on branc i and ɛ i = oterwise. Here we assume tat te evolution of te voltage sources is given as dependent function u s (t). Tus, in te following, we replace diag(e)u by u s (t) for a given function u s : [, T] R n. To derive te equations of motion for te circuit system, we make use of te Lagrange-d Alembert-Pontryagin principle, i.e. we are searcing for curves q(t), v(t) and p(t) fulfilling T T δ L(q(t), v(t)) + p(t), q(t) v(t) dt + f L (q(t), v(t), t) δq(t) dt = (9) wit fixed initial and final variations δq() = δq(t) = and constrained variations δq Q (q). Taking variations gives us T [ L q + f L, δq ṗ, δq + δp, q v + ( ) ] L p, δv dt = () v for arbitrary variations δv and δp, K T v = and constrained variations δq Q (q). Tis leads to te constrained Euler-Lagrange equations L q ṗ + f L Q (q) q = v L v p = K T v =. (a) (b) (c) (d) For te Lagrangian (6) and te forces (8), te constrained Euler-Lagrange equations are ṗ = Cq diag(r)v + u s + Kλ q = v p = Lv K T v =, (a) (b) (c) (d) also denoted by te set of primary constraints 7

were λ represent te node voltages û T N. Tus, te first line corresponds to te KVL equations of te form Kû = u, and te last line are te KCL equations. System () is a differential-algebraic system wit differential variables q and p and algebraic variables v and λ. Te involvement of te function u s (t) makes te system a nonautonomous system. Equation (c) (also denoted by primary constraints) reflects te degeneracy of te Lagrangian system: since FL is not invertible (i.e. L is singular), we can not eliminate te algebraic variable v to obtain a purely Hamiltonian formulation. However, in te next step, we eliminate te algebraic variable λ by te use of a reduced constrained variational principle. 3.. Reduced constrained variational formulation Wit te following reduced principle, we derive a sligtly different form of te resulting differential-algebraic system. Tis reduced formulation is advantageous from different perspectives: First, te reduced formulation is less redundant, suc tat te Lagrange multipliers are eliminated and te state space dimension is reduced. Second, for specific circuits, te degeneracy of te Lagrangian is canceled. Tird, te reduced state space still as a pysical and geometric interpretation: Te reduced Lagrangian is defined on te mes space T M R (n m) rater tan on te branc space T Q R n. For te reduction, instead of treating te KCL as extra constraint in te form K T v =, we directly involve te KCL form K ṽ = v wit ṽ T q M R n m for te definition of te new Lagrangian system. Since K is constant, te constraints are integrable, i.e. te configurations q are constrained to be in te submanifold C = {q Q K T q = } for consistent initial values q C. Tis simply means tat topological relationsips tat apply for currents will also old for carges to witin a constant vector. Ten, it olds T q C = Q (q) and te branc carges q can be expressed by te mes carges q M R n m as q = K q. We define te constrained Lagrangian L M : T M R via pullback as L M := K L : T M R wit L M ( q, ṽ) = L(K q, K ṽ) = ṽt K T LK ṽ qt K T CK q (3) wit te Legendre transform FL M : T M T M FL M ( q, ṽ) = ( q, L M / ṽ) = ( q, K T LK ṽ). Depending on te inductor matrix L and te grap topology, te matrix K T LK can still be singular, i.e. te Lagrangian system can still be degenerate. Te cotangent bundle T M is given by T M = {( q, p) R n m,n m ( q, p) = FL M ( q, ṽ) wit ( q, ṽ) T M} = {( q, p) R n m,n m ( q, p) = ( q, K T p) wit p P}. Tus, te constrained force f M L in T M is defined as f M L ( q, ṽ, t) = KT f L(K q, K ṽ, t) = K T diag(r)k ṽ + K T u s(t). (4) Wit p T q M Rn m given as p = K T p we obtain te following reduced Lagrange-d Alembert-Pontryagin principle T δ L M ( q(t), ṽ(t)) + p(t), q(t) ṽ(t) T dt + fl M ( q(t), ṽ(t), t) δ q(t) dt = (5) wit fixed initial and final variations δ q() = δ q(t) =. Taking variations gives us T [ L M q + f L M, δ q p, δ q + δ p, q ṽ + ( L M ṽ ) ] p, δṽ dt = (6) 8

for arbitrary variations δṽ and δ p and δ q. Tis results in te reduced Euler-Lagrange equations L M q p + fl M = (7a) q = ṽ (7b) L M ṽ p =. (7c) For te Lagrangian (3) and te forces (4), te constrained Euler-Lagrange equations are p = K T ( ) CK q diag(r)k ṽ + u s q = ṽ p = K T LK ṽ. Here, te first equation is now te KVL in te form K T u =, in wic te KCL in te form K ṽ = v is also involved. System (8) is a differential-algebraic system wit differential variables q and p and algebraic variables ṽ. Te algebraic equation (8c) is te Legendre transformation of te system. If tis is invertible (i.e. te matrix K T LK is regular), te algebraic variable v can be eliminated. In tis case, te Euler-Lagrange equations (8) represent a non-degenerate Lagrangian system. In te following proposition we sow for wic cases te reduced Lagrangian system is non-degenerate for LC circuits, i.e. for wic cases te KVL cancels te degeneracy. Te statements for RCL and RCLV circuits can be derived in an analogous way (see Remark b)). Proposition. For LC circuits (including only self inductors), te system is non-degenerate if te number of capacitors equals te number of independent constraints involving te currents troug te capacitives brances. Proof. We ave to sow tat ker(k T LK ) = {}. Let n C be te number of capacitors, m te number of Kircoff Constraints suc tat KC T Rm,n C. Let l C m be te number of independent constraints involving te currents troug te capacitives brances. Wit n C = l C m we ave rank(kc T ) = n C, tus ker(kc T ) = {}. On te oter and, it olds and Wit ker(kc T ) = {} tis results in ker(l) = {v T q Q v L = } R(K ) = ker(k T ) = {v T q Q K T v = } = {v T q Q (K T L KT C ) ( vl v C ) = } (8a) (8b) (8c) R(K ) ker(l) = {v T q Q K T C v C = } = {}. (9) and tus ker(lk ) = {}. Since L is a diagonal matrix, we can split K T LK into K T L T LK, were L corresponds to te diagonal matrix wit diagonal elements L i, L i >, i =,..., n. Since K as full column rank, we know wit (9) tat LK also as full column rank. It follows for y R n m and y ker(k T LK ) K T LK y = y T K T LK y = y T K T L T LK y = LK y = and tus y = since ker( LK ) = {}. We terefore ave ker(k T LK ) = ker( LK ) = {} and te matrix K T LK is invertible. Remark. a) Intuitively spoken, te degeneracy of te original Lagrangian is due to te lack of magnetic energy terms for te capacitors. Wit eac independent constraint on te capacitor currents, one degree of freedom of te system can be removed. Hence, as many capacitors constraints are required to remove te capacitor current (cf. []). 9

b) In addition, for a RLC (resp. RCLV) non-degenerate circuit, te number of resistors (resp. and voltage sources) as to equal te number of independent constraints involving te currents troug te resistor (resp. and voltage source) brances. Teorem (Equivalence). Te system () and te reduced system (7) are equivalent in te following sense: (i) Let ( q, p, ṽ) be a solution of te reduced system (7) and let q = K q, v = K ṽ and (q, p) = FL(q, v). Ten (q, v, p) is a solution to system () and it olds p = K T p. (ii) Let (q, v, p) be a solution to system () and q = K + q, ṽ = K+ v and let p = KT p wit te well-defined pseudoinverse K + of K (wit K + K = I). Ten ( q, p, ṽ) is a solution of te reduced system (7). Proof. (i) Assume ( q, p, ṽ) is a solution of (7). From te assumption p = FL(q, v) it follows p vl(q, v) =. Wit L M = K L it olds Similarly, it olds LM ṽ ( q, ṽ) = KT L M L ( q, ṽ) = q q (K q, K ṽ) = L (q, v) and tus it follows v ( ) T q L q q (K q, K ṽ) = K T p = LM ṽ ( q, ṽ) = L KT v (q, v) = KT p. L (q, v). q Togeter wit (4), tis gives ( ) ( ) K T ṗ = p = LM L L q + f L M = KT q + f L K T q ṗ + f L = L q ṗ + f L ker(k T ). Wit ker(k T ) = im(k), it follows L as can be seen from diagram (5). Furtermore, we ave q ṗ + f L im(k) = Q (q) q = K q = K ṽ = v. and since it olds v = K ṽ, it follows from diagram (5) K T v =. Bot expressions are equivalent formulations of te KCL. (ii) Now assume (q, p, v) is a solution of (). Wit ker(k T ) = im(k) and (4), it follows immediately ( ) L p = K T ṗ = KT q + f L = LM q + f L M. Furtermore, from q = v we get K + q = K+ v wic gives q = ṽ. Finally, we ave p = K T p = KT L v = LM ṽ. Remark 3. We require te assumption (q, p) = FL(q, v) (te fulfillment of te Legendre transformation) in Teorem (i) for te fulfillment of te relation (c). A unique derivation of p directly from p is in general not possible from p = K T p as it is for q and v: Altoug tere is a canonical projection KT : T Q T M, tere is no corresponding canonical embedding of T M into T Q (see also [3]). Assuming p = K T p instead of (q, p) = FL(q, v) in (i), we only get te relation K T (p L/ v) =, and (c) may not be fulfilled.

4. Discrete variational principle for electric circuits In tis section, we derive a discrete variational principle tat leads to a variational integrator for te circuit system. Since te solution of te reduced system (7) can be easily transformed to a solution of te full system () (Teorem ), we restrict te discrete derivation to te reduced case. For te case of a degenerate reduced system, te coice of discretization is important to obtain a variational integrator tat manages to bypass te difficulty of intrinsic degeneracy and tus is applicable for a simulation. In tis section, tree different discretizations are introduced tat result in tree different discrete variational scemes for wic te solvability conditions are derived. For te discrete variational derivation, we introduce a discrete grid t = {t k = k k =,..., N}, N = T, were N is a positive integer and te step size. We replace te carge q : [, T] M, te current ṽ : [, T] T q M and te flux linkage p : [, T] T q M by teir discrete versions q d : {t k } N k= M, ṽ d : {t k } N k= T qm and p d : {t k } N k= T q M, were we view q k = q d (k), ṽ k = ṽ d (k) and p k = p d (k) as an approximation to q(k), ṽ(k) and p(k), respectively. 4.. Forward Euler We replace te reduced Lagrange-d Alembert-Pontryagin principle wit a discrete version N ( δ L M ( q k, ṽ k ) + p k, q k+ q ) k N ṽ k + fl M ( q k, ṽ k, t k )δ q k =, () k= were in () te derivative q(t) is approximated by te forward difference operator and te force evaluated at te left point. For discrete variations δ q k tat vanis in te initial and final points as δ q = δ q N = and discrete variations δṽ k and δ p k tis gives L M N [ L M ṽ ( q, ṽ ) p, δṽ + q ( q k, ṽ k ) ( p k p k ) + fl M ( q k, ṽ k, t k ), δ q k k= δ p k, q k q ] k L M ṽ k + ṽ ( q k, ṽ k ) p k, δṽ k + δ p N, q N q N ṽ N =. Tis leads to te discrete reduced constrained Euler-Lagrange equations L M ṽ ( q, ṽ ) = p (a) L M q ( q k, ṽ k ) ( p k p k ) + fl M ( q k, ṽ k, t k ) = q k q k = ṽ k k =,..., N (b) L M ṽ ( q k, ṽ k ) = p k q N q N = ṽ N. (c) For te Lagrangian defined in (3) and te Lagrangian forces defined in (4), tis results in k= () p k p k q k q k K T LK ṽ k p = K T LK ṽ (3a) = K T ( CK q k diag(r)k ṽ k + u s (t k ) ) = ṽ k =,..., N (3b) k = p k q N q N = ṽ N. (3c)

Tis gives te following update rule: For given ( q, ṽ ), use (3a) to compute p. Ten, use te iteration sceme I q k I I q k K T LK I ṽ k K TCK K T diag(r)k = ṽ k + u s(t k ) for k =,..., N (4) I p k I p k to compute q,..., q N, ṽ,..., ṽ N and p,..., p N. Proposition. System (4) is uniquely solvable if te matrix K T (L + diag(r))k is regular. I Proof. System (4) is uniquely solvable if te iteration matrix A = K T LK I as zero nullspace. K TCK K T diag(r)k I For Az = for z = ( q, ṽ, p), it olds (i) q =, (ii) p = K T LK ṽ, (iii) K TCK q + K T diag(r)k ṽ + p =. Substituting (i) and (ii) in (iii) gives K T (L + diag(r))k ṽ =. Tus z = is te unique solution of Az = iff K T (L + diag(r))k as zero nullspace. 4.. Backward Euler Approximating te derivative q(t) by te backward difference operator rater tan by te forward difference operator as N ( δ L M ( q k, ṽ k ) + p k, q k q ) k N ṽ k + fl M ( q k, ṽ k, t k )δ q k = (5) k= k= wit discrete variations δ q k, tat vanis in te initial and final points as δ q = δ q N = and discrete variations δṽ k and δ p k yields δ p, q q L M N [ ṽ + ṽ ( q, ṽ ) p, δṽ + δ p k, q k q k ṽ k k= L M + q ( q k, ṽ k ) ] L ( p k p k ) + fl M M ( q k, ṽ k, t k ), δ q k + ṽ ( q k, ṽ k ) p k, δṽ k =. Tis gives a sligt, but in tis case significant, modification for te Euler-Lagrange equations as q q = ṽ (7a) L M ṽ ( q, ṽ ) = p (7b) L M q ( q k, ṽ k ) ( p k p k ) + fl M ( q k, ṽ k, t k ) = q k q k = ṽ k k =,..., N (7c) L M ṽ ( q k, ṽ k ) = p k Note tat in contrast to te variational sceme () consisting of an explicit update for te carges q and an implicit update for te fluxes p, we now get an implicit sceme for q and an explicit sceme for p. In particular, for te Lagrangian (3) and te forces (4), we obtain te following update rule: For given ( q, ṽ ) compute p via p = K T LK ṽ. Ten, use te iteration sceme I I q k I K T LK I ṽ k = I p k K TCK K T diag(r)k I q k ṽ k p k + K T K T (6) u s(t k ) for k =,..., N (8) to compute q,..., q N, ṽ,..., ṽ N and p,..., p N.

Proposition 3. System (8) is uniquely solvable if te matrix K T LK is regular. I I Proof. System (8) is uniquely solvable if te iteration matrix A = K T LK I as zero nullspace. For Az = I wit z = ( q, ṽ, p), it olds (i) q = ṽ, (ii) p = K T LK ṽ, (iii) p =. Tus z = is te unique solution of Az = iff K T LK as zero nullspace. Proposition 3 says tat wenever te KCL cancels te degeneracy of te system, te backward Euler sceme is applicable, wereas te forward Euler sceme is applicable to a wider class of circuit systems (cf. Proposition ) for sufficiently large. Te resulting variational Euler scemes () and (7) consisting of a combination of implicit and explicit updates are first order variational integrators. Te construction of iger order implicit scemes (e.g. variational partitioned Runge-Kutta (VPRK) metods along te lines of [5]) allows te simulation of arbitrary circuits. As an example, we present in te following a variational integrator based on te implicit midpoint rule. 4.3. Implicit Midpoint Rule We introduce internal stages Q k, P k, Ṽ k, k =,..., N tat are given on a second grid τ = {τ k = (k + ) k =,..., N } and define te internal stage vectors Q d : {τ k } N k= M, Ṽ d : {τ k } N k= T q M and P d : {τ k } N k= T q M to be Ṽ k = ṽ(t k + ), Q k = q k + Ṽ k, P k = LM ṽ ( Q k, Ṽ k ). Te approximations at te nodes are ten determined by te internal stages via q k+ = q k + Ṽ k and p k+ = p k + LM q ( Q k, Ṽ k ). Taking variations δ q k, δ Q k, δ p k, δ P k, δṽ k for te following discrete Lagrange-d Alembert-Pontryagin principle wit δq N = but free δ q and initial value q N ( δ L M ( Q k, Ṽ k ) + P k, k= + p k+, q k+ q k Q k q k Ṽk N + fl M ( Q k, Ṽ k, τ k )δ Q k = k= ) Ṽ k + p, q q (9) gives N [ L M q ( Q k, Ṽ k ) + P k L + f L M M ( Q k, Ṽ k, τ k ), δ Q k + ṽ ( Q k, Ṽ k ) P k p k+, δṽ k k= Q k q k + δ P k, + δ p k+, q k+ q ] k P k p k+ + p k Ṽ k +, δ q k + δ p, q q =. Ṽk (3) Te Euler-Lagrange equations are L M q ( Q k, Ṽ k ) + P k + f M L ( Q k, Ṽ k, τ k ) = (3a) L M ṽ ( Q k, Ṽ k ) P k p k+ = (3b) Q k q k = (3c) q k+ q k Ṽ k = (3d) P k p k+ + p k =, k =,..., N (3e) q q =. (3f) 3

Eliminating P k by equation (3e) togeter wit Ṽ k = ṽ k+, Q k = q k+ q k+ (wic follows from (3c) and (3d)) and τ k = t k+t k+ = t k+ leads to te iteration sceme p k + p k+ p k+ = p k + LM q q k+ = q k + ṽ k+ = LM ṽ ( qk + q k+ ( qk + q k+ ), ṽ k+ + f M L ( qk + q k+, ṽ k+, t k+ ) (3a) (3b) ), ṽ k+, k =,..., N. (3c) Remark 4. Te integrator (3) is equivalent to a Runge-Kutta sceme wit coefficients a =, b =, c = (implicit midpoint rule integrator) applied to te corresponding Hamiltonian system. For te circuit case wit Lagrangian (3) and forces (4), we start wit given ( q, p ) to solve iteratively for ( q k+, ṽ k+, p k+), k =,..., N for given u s (t) using te sceme for k =,..., N. I I K T LK I KT CK K T diag(r)k I q k+ ṽ k+ p k+ q k I = I KT CK I ṽ k p k + K T u s ( ) tk+ Remark 5. Te discrete current ṽ k+, playing te role of te algebraic variable in te continuous setting, is only approximated between two discrete nodes t k and t k+. Also, note tat ṽ k is not explicitly used for te computation of ( q k+, ṽ k+, p k+) (wic corresponds to a zero column in te matrix of te rigt and side of (33)). Tis means, tat te computation of te magnitudes at point t k+ depends only on te discrete magnitudes witin te interval [t k, t k+ ], wic is caracteristic for a one-step sceme. In particular, ṽ (k = ) is a pseudo-variable tat is not used. Proposition 4. System (33) is uniquely solvable if te matrix K T (L + diag(r) + C)K is regular. I I Proof. System (33) is uniquely solvable if te iteration matrix A = K T LK I as zero KT CK K T diag(r)k I nullspace. For Az = wit z = ( q, ṽ, p), it olds (i) q = ṽ, (ii) p = K T LK ṽ, (iii) KT CK q+k T diag(r)k ṽ+ p =. Substituting (i) and (ii) in (iii) gives K T (L + diag(r) + C)K ṽ = Tus, z = is te unique solution of Az = if K T (L + diag(r) + C)K as zero nullspace. Note tat for linear circuits, te condition given in Proposition 4 is fulfilled for sufficiently large, if te continuous system (8) as a unique solution. Remark 6 (Condition numbers). From Proposition, we see tat te continuous reduced system (7) may be still degenerate due to te intrinsic degeneracy of te circuit topology and configuration. On te discrete side, bot te forward Euler and te midpoint integrator sow some regularization property: by perturbing K T LK in magnitude proportional to te step size, bot integrators can render te degenerate continuous reduced system (7) into regular discrete systems (4) and (33), respectively. However, tis regularization comes at te price of possible large condition numbers as explained in te following. Te iteration matrices A of te different scemes can be written I as A = A + E wit A = K T LK I and E given by te respective iteration sceme. If te reduced I system is regular (i.e. K T LK is non singular), A is non singular wit positive constant condition number κ(a ) and κ(a) approaces a positive constant wen te step size goes to zero (e.g. one can compute te singular values of 4 (33)

te perturbed matrix A + E using arguments from perturbation teory). In tis case all iteration scemes are well conditioned independent of te step size. However, if te reduced system is degenerate, i.e. K T LK is singular, also A is singular and te condition numbers of te forward Euler and te midpoint sceme grow reciprocally to te step size, i.e. κ(a) O(/) for small. Wen te circuit topology is fixed, te circuit s pysical parameters are constants and te step is also fixed, preconditioner can be precomputed and applied to te systems (4) and (33) to improve teir numerical stabilities. Since tis work mainly focus on te teoretical aspects of variational integrators, we leave tis stability issues for future work and assume tereafter no suc issues in te subsequent discussion. 5. Structure-preserving properties In tis section, we summarize te main structure-preserving properties of variational integrators (see e.g. [3]) and teir interpretation for te case of electric circuits. 5.. Symplecticity and preservation of momentum maps induced by symmetries Symplecticity. Te flow on T Q of te Euler-Lagrange equations preserves te canonical symplectic form of te Hamiltonian system. Variational integrators are symplectic, i.e. te same property olds for te discrete flow of te discrete Euler-Lagrange equations; te canonical symplectic form is ly preserved for te discrete solution. Using tecniques from backward error analysis (see e.g. [5]), it can be sown tat symplectic integrators also ave good energy properties, i.e. for long- integrations, tere is no artificial energy growt or decay due to numerical errors. Tis can also be observed for our circuit examples in Section 7. In te case of linear LC circuits tat involve a quadratic potential, a second order variational integrator, e.g. te midpoint variational integrator as derived in Section 4.3, even ly preserves te energy (magnetic plus electric energy). Preservation of momentum maps induced by symmetries. Noeter s teorem states tat momentum maps tat are induced by symmetries in te system are preserved. More precisely, let G be a Lie group acting on Q by Φ : G Q Q. We write Φ g := Φ(g, ). Te tangent lift of tis action Φ T Q : G T Q T Q is given by Φ T g Q (v q ) = T(Φ g ) v q wit v q T Q. Te action is associated wit a corresponding momentum map J : T Q g, were g is te dual of te Lie algebra g of G. Te momentum map is defined by L J(q, v), ξ = v, ξ Q(q) = p, ξ Q (q) ξ g, were ξ Q is te infinitesimal generator of te action on Q, i.e. ξ Q (q) := d dt t= Φ(exp (tξ), q) and exp : g G is te exponential function. Having a olonomic system described by a Lagrangian L and a olonomic constraint (q) =, ten tis system as a symmetry if te Lagrangian and te constraint are bot invariant under te (lift of te) group action, i.e. L Φ T g Q = L and Φ g (q) = for all g G. Noeter s teorem states, tat if te system as a symmetry, te corresponding momentum map is preserved. In presence of external forces, tis statement is still true, if te force is ortogonal to te group action. Te discrete version of Noeter s teorem [3] states, tat if te discrete Lagrangian as a symmetry, te corresponding momentum map is still preserved. Te variational integrator based on tis discrete Lagrangian is tus ly momentum-preserving. For constrained and forced systems, te preservation still olds wit te additional invariance and ortogonality conditions on constraints and forces analogous to te continuous case. Considering an electric circuit, we are faced wit a constrained distribution given by te KCL and external forces due to resistors and voltage sources. Te KCL are formulated on te tangent space; owever, since tese are linear, tey are integrable resulting in KCL on te configuration space. Tus, in te following, we are able to apply te teory of olonomic systems to derive a preserved quantity for an eletrical circuit under some topology assumptions of te underlying grap. Proposition 5 (Invariance of Lagrangian). Te Lagrangian (6) of te unreduced system is invariant under te translation of q L. 5

Proof. Consider te group G = R n L wit group element g G. Let Φ : G Q Q be te action of G defined as Φ(g, q) = (q L + g, q C ) for eac g G wit tangent lift Φ T Q : G T Q T Q, Φ T Q (g, (q, v)) = (q L + g, q C, q R, q V, v L, v C, v R, v V ). Ten, it olds L Φ T Q g (q, v) = v L v C v R v V T L v L v C v R v V = vt Lv qt Cq = L(q, v), q L + g q C q R q V since C = diag ( C,..., C n ) wit te first nl diagonal elements being zero. T C q L + g L q C q R q V Assumption (Topology assumption). For every node j, j =,..., m in te circuit (except ground), te same amount of inductor brances connect inward and outward to node j. In particular, Assumption implies, tat te sum of eac row of K T L is zero, i.e. n L j= (K T L ) i j = for i =,..., m. Proposition 6 (Invariance of distribution). Under Assumption, te KCL on configuration level are invariant under equal translation of q L. Proof. Te group element g G describing an equal translation of all components of q L can be expressed as g = a wit a R and being a vector in R n L wit eac component. It follows K T Φ g (q) = K T q L + g q C q R q V = K T q + KL T g = KT q + KL T a = KT q, since te sum of eac row of K T L is zero. Proposition 7 (Ortogonality of external force). Te external force f L (8) is ortogonal to te action of te group G = R n L being translations of q L. Proof. Let ξ g = R n L be an element of te Lie algebra. For te group action Φ g (q) = (q L + g, q C, q R, q V ), te infinitesimal generator can be calculated as ξ Q (q) = d dt Φ exp tξ (q) = d t= dt (q L + exp tξ, q C, q R, q V ) = (ξ,,, ) t= It tus olds, f L, ξ Q (q) = diag(r)v + diag(e)u, ξ Q (q) =, since diag(r) and diag(e) ave zero entries in te first n L lines and columns. Teorem (Preservation of flux). Under Assumption, te sum of all inductor fluxes in te electric circuit described by te Lagrangian (6), te external forces (8), and te KCL is preserved. Proof. From Proposition 5, 6, and 7 we know tat te Lagrangian and te KCL are invariant under te group action Φ g (q) = (q L + g, q C, q R, q V ) wit g G = R n L and te external force f L is ortogonal to tis group action. It follows wit Noeter s teorem, tat te induced momentum map is preserved by te flow of te system. For te momentum map, we calculate L J(q, v), ξ = v, ξ Q(q) = L ξ i L Q (q) = ξ i. v i v Li Tus, te preserved momentum map is J(q, v) = n L i= p n Li, i.e. te sum of te fluxes of all inductors in te circuit. 6

Remark 7 (Proof based on Euler-Lagrange equations). An alternative proof can be derived based on te Euler- Lagrange equations in te following way. From (a), it olds ṗ L = K L λ. For te derivative of te sum of all inductors, it follows d dt n L i= n L p i = ṗ i = i= n L i= m (K L ) i j λ j = j= m n L λ j j= i= (K L ) i j =, since wit Assumption, it olds = n L i= (KT L ) ji = n L i= (K L) i j for j =,..., m. Tus, n L i= p i is preserved. Remark 8 (Momentum map for reduced system). Also, for te reduced system described by te Lagrangian (3), te same momentum map can be ( computed ) by considering te group action Φ g ( q) = q + g wit te group element g g G R n m defined as g = K + wit K + being te well-defined pseudo-inverse of K. Lemma 3 (Preserved momentum map). For any linear circuit described by te Lagrangian (6), te external forces (8), and te KCL, te momentum map defined by η T L v wit η ker(kt L ) is preserved. Proof. Using te Euler-Lagrange equations, we see immediately d L ηt dt v = ηt ṗ = η T K L λ =, since η T ker(k T L ) im(k L) K L λ and tus, η T L v = const. Te discrete Lagrangian system, including constraints and forces introduced in Section 4, inerits te same symmetry and ortogonality property as te continuous system. Due to te discrete Noeter teorem, te resulting variational integrators ly preserves te sum of inductor fluxes under Assumption (compare Section 7.4 for a numerical example). 5.. Frequency spectrum As can be observed in numerical examples (see Section 7), te frequency spectrum of te discrete solutions is muc better preserved using variational integrators tan oter integrators. We want to analytically demonstrate tis penomenon by means of a simple armonic d oscillator. Assume te curves (q(t), p(t)) on [, T] describe te oscillatory beavior of te system. Consider te discrete solution {(q k, p k )} N k= defined on te discrete grid {t k } n k= wit t =, t N = T and = t k+ t k tat is obtained from te one-step update sceme (q k+, p k+ ) T = A(q k, p k ) T, k =,..., N, were A R, depends on te constant step. We assume tat te discrete solution {(q k, p k )} N k= converges to te solution (q(t), p(t)) for decreasing. Since tis solution is oscillating and due to te convergence of te sceme, at least one eigenvalue λ of A as to be complex (wit nonzero imaginary part) for a small enoug step. Since A R, te second eigenvalue λ as to be complex conjugate to te first one. Tus, te corresponding eigenvectors are linearly independent and A is diagonalizable as A = QVQ wit V = diag(λ, λ ). Wit te coordinate transformation (x k, y k ) T = Q (q k, p k ) T it olds (x k+, y k+ ) T = V(x k, y k ) T, i.e. x k+ = λ x k and y k+ = λ y k. We demonstrate te preservation of te frequency spectrum for te d oscillator in two steps: (i) We sow tat for a convergent sceme te update matrix A as two eigenvalues bot of norm if and only if te update sceme is symplectic. (ii) We sow tat metods defined by matrices wit norm eigenvalues preserve te frequency spectrum defined on different spans. (i) : Assume te sceme defined by A is symplectic, ten det(a) = (see e.g. [9]). It follows wit λ complex conjugate to λ (λ = λ ): = det(q) det(v) det(q ) = λ λ = λ = λ and tus λ i =, i =,. : Assume A as two complex conjugate eigenvalues λ = λ wit λ = λ =, i.e. we write λ = e iθ and λ = e iθ wit θ R and V = diag(e iθ, e iθ ). Note tat θ depends on te constant step tat is used 7