numerical methods for nonsmooth dynamical …numerical methods for nonsmooth dynamical systems:...

75
HAL Id: inria-00423530 https://hal.inria.fr/inria-00423530 Submitted on 11 Oct 2009 HAL is a multi-disciplinary open access archive for the deposit and dissemination of sci- entific research documents, whether they are pub- lished or not. The documents may come from teaching and research institutions in France or abroad, or from public or private research centers. L’archive ouverte pluridisciplinaire HAL, est destinée au dépôt et à la diffusion de documents scientifiques de niveau recherche, publiés ou non, émanant des établissements d’enseignement et de recherche français ou étrangers, des laboratoires publics ou privés. Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics Vincent Acary, Bernard Brogliato To cite this version: Vincent Acary, Bernard Brogliato. Numerical Methods for Nonsmooth Dynamical Systems: Applica- tions in Mechanics and Electronics. Springer Verlag, 35, pp.526, 2008, Lecture Notes in Applied and Computational Mechanics, 978-3-540-75391-9. inria-00423530

Upload: others

Post on 23-Jan-2020

10 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Numerical Methods for Nonsmooth Dynamical …Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics Vincent Acary, Bernard Brogliato To cite this

HAL Id: inria-00423530https://hal.inria.fr/inria-00423530

Submitted on 11 Oct 2009

HAL is a multi-disciplinary open accessarchive for the deposit and dissemination of sci-entific research documents, whether they are pub-lished or not. The documents may come fromteaching and research institutions in France orabroad, or from public or private research centers.

L’archive ouverte pluridisciplinaire HAL, estdestinée au dépôt et à la diffusion de documentsscientifiques de niveau recherche, publiés ou non,émanant des établissements d’enseignement et derecherche français ou étrangers, des laboratoirespublics ou privés.

Numerical Methods for Nonsmooth Dynamical Systems:Applications in Mechanics and Electronics

Vincent Acary, Bernard Brogliato

To cite this version:Vincent Acary, Bernard Brogliato. Numerical Methods for Nonsmooth Dynamical Systems: Applica-tions in Mechanics and Electronics. Springer Verlag, 35, pp.526, 2008, Lecture Notes in Applied andComputational Mechanics, 978-3-540-75391-9. �inria-00423530�

Page 2: Numerical Methods for Nonsmooth Dynamical …Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics Vincent Acary, Bernard Brogliato To cite this

Hal

INR

IA s

ampl

e

Vincent Acary, Bernard Brogliato

Numerical Methods forNonsmooth Dynamics.Applications in Mechanics andElectronicsSPIN Springer’s internal project number, if known

– Monograph –

October 11, 2009

Springer

Page 3: Numerical Methods for Nonsmooth Dynamical …Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics Vincent Acary, Bernard Brogliato To cite this

Hal

INR

IA s

ampl

e

Page 4: Numerical Methods for Nonsmooth Dynamical …Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics Vincent Acary, Bernard Brogliato To cite this

Hal

INR

IA s

ampl

e

À Céline et MartinÀ Laurence et Bastien

Page 5: Numerical Methods for Nonsmooth Dynamical …Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics Vincent Acary, Bernard Brogliato To cite this

Hal

INR

IA s

ampl

e

Page 6: Numerical Methods for Nonsmooth Dynamical …Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics Vincent Acary, Bernard Brogliato To cite this

Hal

INR

IA s

ampl

e

Preface

This book concerns the numerical simulation of dynamical systems whose trajecto-ries may not be differentiable everywhere. They are namednonsmoothdynamicalsystems. They make an important class of systems, first because of the many appli-cations in which nonsmooth models are useful, secondly because they give rise tonew problems in various fields of science. Usually nonsmoothdynamical systemsare represented as differential inclusions, complementarity systems, evolution vari-ational inequalities, each of these classes itself being split into several subclasses.The book is divided into four parts, the first three parts being sketched in Fig. 0.1.The aim of the first part is to present the main tools from mechanics and appliedmathematics which are necessary to understand how nonsmooth dynamical systemsmay be numerically simulated in a reliable way. Many examples illustrate the theo-retical results, and an emphasis is put on mechanical systems, as well as on electricalcircuits (the so-called Filippov’s systems are also examined in some detail, due totheir importance in control applications). The second and third parts are dedicatedto a detailed presentation of the numerical schemes. A fourth part is devoted to thepresentation of the software platform SICONOS. This book is not a textbook on nu-merical analysis of nonsmooth systems, in the sense that despite the main results ofnumerical analysis (convergence, order of consistency, etc.) being presented, theirproofs are not provided. Our main concern is rather to present in detail how the al-gorithms are constructed and what kind of advantages and drawbacks they possess.

Nonsmooth mechanics (resp. nonsmooth electrical circuits) is a topic that hasbeen pioneered and developed in parallel with convex analysis in the 1960s and the1970s in western Europe by J.J. Moreau, M. Schatzman, and P.D. Panagiotopoulos(resp. by the Dutch school of van Bockhoven and Leenaerts), then followed by sev-eral groups of researchers in Montpellier, Munich, Eindhoven, Marseille, Stockholm,Lausanne, Lisbon, Grenoble, Zurich, etc. More recently nonsmooth dynamical sys-tems (especially complementarity systems) emerged in the USA, a country in which,paradoxically, complementarity theory and convex analysis (which are central toolsfor the study of nonsmooth mechanical and electrical systems) have been developedsince a long time. Though nonsmooth mechanics and more generally nonsmooth dy-namical systems have long been studied by mechanical engineers (impact mechanics

Page 7: Numerical Methods for Nonsmooth Dynamical …Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics Vincent Acary, Bernard Brogliato To cite this

Hal INRIA sample

VIII

Preface

One−step Nonsmooth Problem Solvers

Part III

Part I

Part II

Variational Inequalities

Electricity

Mechanics

Control

Convex and Nonsmooth

AnalysisNonsmooth Models

Numerical Time−Integration schemes

DI VI CS PDS

Event−driven schemes Time−stepping schemes

Nonlinear Programming Complementarity Problems

Fig. 0.1.Book Synopsis

Page 8: Numerical Methods for Nonsmooth Dynamical …Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics Vincent Acary, Bernard Brogliato To cite this

Hal

INR

IA s

ampl

e

Preface IX

can be traced back to ancient Greeks!) and applied mathematicians, their study hasmore recently attracted researchers of other scientific communities like systems andcontrol, robotics, physics of granular media, civil engineering, virtual reality, hapticsystems, image synthesis. We hope that this book will increase its dissemination.

We warmly thank Claude Lemaréchal (INRIA Bipop) for his manycommentsand discussions on Chap. 12 and Mathieu Renouf (LAMCOS-CNRS, Lyon) whosejoint work with the first author contributed to Chap. 13. We also thank ProfessorF. Pfeiffer (Munich), an ardent promoter of nonsmooth mechanical systems, for hisencouragements to us for writing this monograph, and Dr. Ditzinger (Springer Ver-lag). This work originated from a set of draft notes for a CEA-EdF-INRIA springschool that occurred in Rocquencourt from May 29 to June 02, 2006. The authorsthank M. Jean (LMA-CNRS, Marseille, France) for his collaboration to this schooland part of the preliminary draft. We would finally like to mention that part of thiswork was made in the framework of the European project SICONOSIST 2001-37172,from which the software platform SICONOS emerged. In particular the works ofF. Pérignon and P. Denoyelle, expert engineers in the INRIA team-project Bipop,are here acknowledged.

Montbonnot, Vincent AcaryAugust 2007 Bernard Brogliato

Page 9: Numerical Methods for Nonsmooth Dynamical …Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics Vincent Acary, Bernard Brogliato To cite this

Hal

INR

IA s

ampl

e

Page 10: Numerical Methods for Nonsmooth Dynamical …Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics Vincent Acary, Bernard Brogliato To cite this

Hal

INR

IA s

ampl

e

Contents

1 Nonsmooth Dynamical Systems: Motivating Examplesand Basic Concepts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.1 Electrical Circuits with Ideal Diodes . . . . . . . . . . . . . . .. . . . . . . . . . . . 1

1.1.1 Mathematical Modeling Issues . . . . . . . . . . . . . . . . . . . .. . . . 21.1.2 Four Nonsmooth Electrical Circuits . . . . . . . . . . . . . . .. . . . . 51.1.3 Continuous System (Ordinary Differential Equation). . . . . 71.1.4 Hints on the Numerical Simulation of Circuits (a) and (b) . 91.1.5 Unilateral Differential Inclusion . . . . . . . . . . . . . . .. . . . . . . . 121.1.6 Hints on the Numerical Simulation of Circuits (c) and (d) . 141.1.7 Calculation of the Equilibrium Points . . . . . . . . . . . . .. . . . . 19

1.2 Electrical Circuits with Ideal Zener Diodes . . . . . . . . . .. . . . . . . . . . . 211.2.1 The Zener Diode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . 211.2.2 The Dynamics of a Simple Circuit . . . . . . . . . . . . . . . . . . .. . 231.2.3 Numerical Simulation by Means of Time-Stepping

Schemes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281.2.4 Numerical Simulation by Means of Event-Driven Schemes 381.2.5 Conclusions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . 40

1.3 Mechanical Systems with Coulomb Friction . . . . . . . . . . . .. . . . . . . . 401.4 Mechanical Systems with Impacts: The Bouncing Ball Paradigm . . . 41

1.4.1 The Dynamics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . 411.4.2 A Measure Differential Inclusion . . . . . . . . . . . . . . . . .. . . . . 441.4.3 Hints on the Numerical Simulation of the Bouncing Ball. . 45

1.5 Stiff ODEs, Explicit and Implicit Methods,and the Sweeping Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . 501.5.1 Discretization of the Penalized System . . . . . . . . . . . .. . . . . 511.5.2 The Switching Conditions . . . . . . . . . . . . . . . . . . . . . . . .. . . . 521.5.3 Discretization of the Relative Degree Two

Complementarity System . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531.6 Summary of the Main Ideas . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . 53

Page 11: Numerical Methods for Nonsmooth Dynamical …Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics Vincent Acary, Bernard Brogliato To cite this

Hal

INR

IA s

ampl

e

XII Contents

Part I Formulations of Nonsmooth Dynamical Systems

2 Nonsmooth Dynamical Systems: A Short Zoology. . . . . . . . . . . . . . . . . . 572.1 Differential Inclusions . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . 57

2.1.1 Lipschitzian Differential Inclusions . . . . . . . . . . . .. . . . . . . . 582.1.2 Upper Semi-continuous DIs and Discontinuous

Differential Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 612.1.3 The One-Sided Lipschitz Condition . . . . . . . . . . . . . . . .. . . . 682.1.4 Recapitulation of the Main Properties of DIs . . . . . . . .. . . . 712.1.5 Some Hints About Uniqueness of Solutions . . . . . . . . . . .. . 73

2.2 Moreau’s Sweeping Process and Unilateral DIs . . . . . . . . .. . . . . . . . 742.2.1 Moreau’s Sweeping Process . . . . . . . . . . . . . . . . . . . . . . .. . . 742.2.2 Unilateral DIs and Maximal Monotone Operators . . . . . .. . 772.2.3 Equivalence Between UDIs and other Formalisms . . . . . .. . 78

2.3 Evolution Variational Inequalities . . . . . . . . . . . . . . . .. . . . . . . . . . . . . 802.4 Differential Variational Inequalities . . . . . . . . . . . . .. . . . . . . . . . . . . . 822.5 Projected Dynamical Systems . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . 842.6 Dynamical Complementarity Systems . . . . . . . . . . . . . . . . .. . . . . . . . 85

2.6.1 Generalities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . 852.6.2 Nonlinear Complementarity Systems . . . . . . . . . . . . . . .. . . . 88

2.7 Second-Order Moreau’s Sweeping Process . . . . . . . . . . . . .. . . . . . . . 882.8 ODE with Discontinuities . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . 92

2.8.1 Order of Discontinuity . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . 922.8.2 Transversality Conditions . . . . . . . . . . . . . . . . . . . . . .. . . . . . 932.8.3 Piecewise Affine and Piecewise Continuous Systems . . .. . 94

2.9 Switched Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . 982.10 Impulsive Differential Equations . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . 100

2.10.1 Generalities and Well-Posedness . . . . . . . . . . . . . . . .. . . . . . 1002.10.2 An Aside to Time-Discretization and Approximation .. . . . 104

2.11 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . 104

3 Mechanical Systems with Unilateral Constraints and Friction . . . . . . . 1073.1 Multibody Dynamics: The Lagrangian Formalism . . . . . . . .. . . . . . . 107

3.1.1 Perfect Bilateral Constraints . . . . . . . . . . . . . . . . . . .. . . . . . . 1093.1.2 Perfect Unilateral Constraints . . . . . . . . . . . . . . . . . .. . . . . . . 1103.1.3 Smooth Dynamics as an Inclusion . . . . . . . . . . . . . . . . . . .. . 112

3.2 The Newton–Euler Formalism . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . 1123.2.1 Kinematics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . 1123.2.2 Kinetics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . 1153.2.3 Dynamics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . 117

3.3 Local Kinematics at the Contact Points . . . . . . . . . . . . . . .. . . . . . . . . 1233.3.1 Local Variables at Contact Points . . . . . . . . . . . . . . . . .. . . . . 1233.3.2 Back to Newton–Euler’s Equations . . . . . . . . . . . . . . . . .. . . 1263.3.3 Collision Detection and the Gap Function Calculation. . . . 128

Page 12: Numerical Methods for Nonsmooth Dynamical …Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics Vincent Acary, Bernard Brogliato To cite this

Hal

INR

IA s

ampl

e

Contents XIII

3.4 The Smooth Dynamics of Continuum Media . . . . . . . . . . . . . . .. . . . . 1313.4.1 The Smooth Equations of Motion. . . . . . . . . . . . . . . . . . . .. . 1313.4.2 Summary of the Equations of Motion . . . . . . . . . . . . . . . . .. 135

3.5 Nonsmooth Dynamics and Schatzman’s Formulation . . . . . .. . . . . . . 1353.6 Nonsmooth Dynamics and Moreau’s Sweeping Process. . . . .. . . . . . 137

3.6.1 Measure Differential Inclusions . . . . . . . . . . . . . . . . .. . . . . . 1373.6.2 Decomposition of the Nonsmooth Dynamics . . . . . . . . . . .. 1373.6.3 The Impact Equations and the Smooth Dynamics . . . . . . . .1383.6.4 Moreau’s Sweeping Process . . . . . . . . . . . . . . . . . . . . . . .. . . 1393.6.5 Finitely RepresentedC and the Complementarity

Formulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1413.7 Well-Posedness Results . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . 1433.8 Lagrangian Systems with Perfect Unilateral Constraints: Summary . 1433.9 Contact Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . 144

3.9.1 Coulomb’s Friction . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . 1453.9.2 De Saxcé’s Bipotential Function. . . . . . . . . . . . . . . . . .. . . . . 1483.9.3 Impact with Friction . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . 1513.9.4 Enhanced Contact Models . . . . . . . . . . . . . . . . . . . . . . . . .. . . 153

3.10 Lagrangian Systems with Frictional Unilateral Constraints andNewton’s Impact Laws: Summary . . . . . . . . . . . . . . . . . . . . . . . . .. . . . 161

3.11 A Mechanical Filippov’s System . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . 162

4 Complementarity Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1654.1 Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . 1654.2 Existence and Uniqueness of Solutions . . . . . . . . . . . . . . .. . . . . . . . . 167

4.2.1 Passive LCS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . 1684.2.2 Examples of LCS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . 1694.2.3 Complementarity Systems and the Sweeping Process . . .. . 1704.2.4 Nonlinear Complementarity Systems . . . . . . . . . . . . . . .. . . . 172

4.3 Relative Degree and the Completeness of the Formulation. . . . . . . . 1734.3.1 The Single Input/Single Output (SISO) Case . . . . . . . . .. . . 1744.3.2 The Multiple Input/Multiple Output (MIMO) Case . . . . .. . 1754.3.3 The Solutions and the Relative Degree . . . . . . . . . . . . . .. . . 175

5 Higher Order Constrained Dynamical Systems. . . . . . . . . . . . . . . . . . . . 1775.1 Motivations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . 1775.2 A Canonical State Space Representation . . . . . . . . . . . . . .. . . . . . . . . 1785.3 The Space of Solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . 1805.4 The Distribution DI and Its Properties . . . . . . . . . . . . . . .. . . . . . . . . . 180

5.4.1 Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . 1805.4.2 The Inclusions for the Measuresνi . . . . . . . . . . . . . . . . . . . . . 1825.4.3 Two Formalisms for the HOSP . . . . . . . . . . . . . . . . . . . . . . .. 1835.4.4 Some Qualitative Properties . . . . . . . . . . . . . . . . . . . . .. . . . . 186

5.5 Well-Posedness of the HOSP . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . 1875.6 Summary of the Main Ideas of Chapters 4 and 5 . . . . . . . . . . . .. . . . . 188

Page 13: Numerical Methods for Nonsmooth Dynamical …Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics Vincent Acary, Bernard Brogliato To cite this

Hal

INR

IA s

ampl

e

XIV Contents

6 Specific Features of Nonsmooth Dynamical Systems. . . . . . . . . . . . . . . . 1896.1 Discontinuity with Respect to Initial Conditions . . . . .. . . . . . . . . . . . 189

6.1.1 Impact in a Corner . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . 1896.1.2 A Theoretical Result . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . 1906.1.3 A Physical Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . 191

6.2 Frictional Paroxysms (the Painlevé Paradoxes) . . . . . . .. . . . . . . . . . . 1926.3 Infinity of Events in a Finite Time . . . . . . . . . . . . . . . . . . . .. . . . . . . . . 193

6.3.1 Accumulations of Impacts . . . . . . . . . . . . . . . . . . . . . . . .. . . . 1936.3.2 Infinitely Many Switchings in Filippov’s Inclusions .. . . . . 1946.3.3 Limit of the Saw-Tooth Function in Filippov’s Systems. . . 194

Part II Time Integration of Nonsmooth Dynamical Systems

7 Event-Driven Schemes for Inclusions with AC Solutions. . . . . . . . . . . . 2037.1 Filippov’s Inclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . 203

7.1.1 Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . 2037.1.2 Stewart’s Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . 2057.1.3 Why Is Stewart’s Method Superior to Trivial Event-Driven

Schemes?. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2137.2 ODEs with Discontinuities with a Transversality Condition . . . . . . . 215

7.2.1 Position of the Problem . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . 2157.2.2 Event-Driven Schemes. . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . 215

8 Event-Driven Schemes for Lagrangian Systems. . . . . . . . . . . . . . . . . . . . 2198.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . 2198.2 The Smooth Dynamics and the Impact Equations . . . . . . . . . .. . . . . . 2218.3 Reformulations of the Unilateral Constraints at Different

Kinematics Levels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . 2228.3.1 At the Position Level . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . 2228.3.2 At the Velocity Level . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . 2228.3.3 At the Acceleration Level . . . . . . . . . . . . . . . . . . . . . . . .. . . . 2238.3.4 The Smooth Dynamics . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 224

8.4 The Case of a Single Contact . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . 2258.4.1 Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . 227

8.5 The Multi-contact Case and the Index Sets . . . . . . . . . . . . .. . . . . . . . 2298.5.1 Index Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . 229

8.6 Comments and Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . 2308.6.1 Event-Driven Algorithms and Switching Diagrams . . . .. . . 2308.6.2 Coulomb’s Friction and Enhanced Set-Valued Force Laws . 2318.6.3 Bilateral or Unilateral Dynamics? . . . . . . . . . . . . . . . .. . . . . 2328.6.4 Event-Driven Schemes: Lötstedt’s Algorithm . . . . . . .. . . . . 2328.6.5 Consistency and Order of Event-Driven Algorithms . . .. . . 236

8.7 Linear Complementarity Systems . . . . . . . . . . . . . . . . . . . .. . . . . . . . . 2408.8 Some Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . 241

Page 14: Numerical Methods for Nonsmooth Dynamical …Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics Vincent Acary, Bernard Brogliato To cite this

Hal

INR

IA s

ampl

e

Contents XV

9 Time-Stepping Schemes for Systems with AC Solutions. . . . . . . . . . . . . 2439.1 ODEs with Discontinuities . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . 243

9.1.1 Numerical Illustrations of Expected Troubles . . . . . .. . . . . . 2439.1.2 Consistent Time-Stepping Methods . . . . . . . . . . . . . . . .. . . . 247

9.2 DIs with Absolutely Continuous Solutions . . . . . . . . . . . .. . . . . . . . . 2519.2.1 Explicit Euler Algorithm . . . . . . . . . . . . . . . . . . . . . . . .. . . . . 2529.2.2 Implicitθ -Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2569.2.3 Multistep and Runge–Kutta Algorithms . . . . . . . . . . . . .. . . 2589.2.4 Computational Results and Comments . . . . . . . . . . . . . . .. . 263

9.3 The Special Case of the Filippov’s Inclusions . . . . . . . . .. . . . . . . . . . 2669.3.1 Smoothing Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . 2669.3.2 Switched Model and Explicit Schemes . . . . . . . . . . . . . . .. . 2679.3.3 Implicit Schemes and Complementarity Formulation . .. . . 2699.3.4 Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . 271

9.4 Moreau’s Catching-Up Algorithm for the First-OrderSweeping Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . 2719.4.1 Mathematical Properties . . . . . . . . . . . . . . . . . . . . . . . .. . . . . 2729.4.2 Practical Implementation of the Catching-up Algorithm . . . 2739.4.3 Time-Independent Convex SetK . . . . . . . . . . . . . . . . . . . . . . 274

9.5 Linear Complementarity Systems withr 6 1 . . . . . . . . . . . . . . . . . . . . 2759.6 Differential Variational Inequalities . . . . . . . . . . . . .. . . . . . . . . . . . . . 279

9.6.1 The Initial Value Problem (IVP) . . . . . . . . . . . . . . . . . . .. . . . 2809.6.2 The Boundary Value Problem . . . . . . . . . . . . . . . . . . . . . . .. . 281

9.7 Summary of the Main Ideas . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . 283

10 Time-Stepping Schemes for Mechanical Systems. . . . . . . . . . . . . . . . . . . 28510.1 The Nonsmooth Contact Dynamics (NSCD) Method . . . . . . . .. . . . . 285

10.1.1 The Linear Time-Invariant NonsmoothLagrangian Dynamics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286

10.1.2 The Nonlinear Nonsmooth Lagrangian Dynamics . . . . . .. . 28910.1.3 Discretization of Moreau’s Inclusion . . . . . . . . . . . .. . . . . . . 29310.1.4 Sweeping Process with Friction . . . . . . . . . . . . . . . . . .. . . . . 29510.1.5 The One-Step Time-Discretized Nonsmooth Problem . .. . . 29610.1.6 Convergence Properties . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . 30310.1.7 Bilateral and Unilateral Constraints . . . . . . . . . . . .. . . . . . . . 305

10.2 Some Numerical Illustrations of the NSCD Method . . . . . .. . . . . . . . 30710.2.1 Granular Material . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . 30710.2.2 Deep Drawing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . 30910.2.3 Tensegrity Structures . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . 30910.2.4 Masonry Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . 30910.2.5 Real-Time and Virtual Reality Simulations . . . . . . . .. . . . . . 31110.2.6 More Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . 31410.2.7 Moreau’s Time-Stepping Method and Painlevé Paradoxes . 315

10.3 Variants and Other Time-Stepping Schemes . . . . . . . . . . .. . . . . . . . . 31510.3.1 The Paoli–Schatzman Scheme . . . . . . . . . . . . . . . . . . . . .. . . 31510.3.2 The Stewart–Trinkle–Anitescu–Potra Scheme . . . . . .. . . . . 317

Page 15: Numerical Methods for Nonsmooth Dynamical …Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics Vincent Acary, Bernard Brogliato To cite this

Hal

INR

IA s

ampl

e

XVI Contents

11 Time-Stepping Scheme for the HOSP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31911.1 Insufficiency of the Backward Euler Method . . . . . . . . . . .. . . . . . . . . 31911.2 Time-Discretization of the HOSP . . . . . . . . . . . . . . . . . . .. . . . . . . . . . 321

11.2.1 Principle of the Discretization . . . . . . . . . . . . . . . . .. . . . . . . . 32111.2.2 Properties of the Discrete-Time Extended

Sweeping Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32211.2.3 Numerical Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . 324

11.3 Synoptic Outline of the Algorithms . . . . . . . . . . . . . . . . .. . . . . . . . . . 325

Part III Numerical Methods for the One-Step Nonsmooth Problems

12 Basics on Mathematical Programming Theory . . . . . . . . . . . . . . . . . . . . 33112.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . 33112.2 The Quadratic Program (QP) . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . 331

12.2.1 Definition and Basic Properties . . . . . . . . . . . . . . . . . .. . . . . 33112.2.2 Equality-Constrained QP . . . . . . . . . . . . . . . . . . . . . . .. . . . . . 33512.2.3 Inequality-Constrained QP . . . . . . . . . . . . . . . . . . . . .. . . . . . 33812.2.4 Comments on Numerical Methods for QP. . . . . . . . . . . . . .. 344

12.3 Constrained Nonlinear Programming (NLP) . . . . . . . . . . .. . . . . . . . . 34512.3.1 Definition and Basic Properties . . . . . . . . . . . . . . . . . .. . . . . 34512.3.2 Main Methods to Solve NLPs . . . . . . . . . . . . . . . . . . . . . . .. . 347

12.4 The Linear Complementarity Problem (LCP) . . . . . . . . . . .. . . . . . . . 35112.4.1 Definition of the Standard Form . . . . . . . . . . . . . . . . . . .. . . . 35112.4.2 Some Mathematical Properties . . . . . . . . . . . . . . . . . . .. . . . . 35212.4.3 Variants of the LCP . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . 35512.4.4 Relation Between the Variants of the LCPs . . . . . . . . . .. . . . 35712.4.5 Links Between the LCP and the QP . . . . . . . . . . . . . . . . . . .. 35912.4.6 Splitting-Based Methods . . . . . . . . . . . . . . . . . . . . . . .. . . . . . 36312.4.7 Pivoting-Based Methods . . . . . . . . . . . . . . . . . . . . . . . .. . . . . 36712.4.8 Interior Point Methods . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . 37412.4.9 How to chose a LCP solver? . . . . . . . . . . . . . . . . . . . . . . . .. . 379

12.5 The Nonlinear Complementarity Problem (NCP) . . . . . . . .. . . . . . . . 37912.5.1 Definition and Basic Properties . . . . . . . . . . . . . . . . . .. . . . . 37912.5.2 The Mixed Complementarity Problem (MCP) . . . . . . . . . .. 38312.5.3 Newton–Josephy’s and Linearization Methods . . . . . .. . . . . 38412.5.4 Generalized or Semismooth Newton’s Methods . . . . . . .. . . 38512.5.5 Interior Point Methods . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . 38812.5.6 Effective Implementations and Comparison of the

Numerical Methods for NCPs . . . . . . . . . . . . . . . . . . . . . . . . . 38812.6 Variational and Quasi-Variational Inequalities . . . .. . . . . . . . . . . . . . . 389

12.6.1 Definition and Basic Properties . . . . . . . . . . . . . . . . . .. . . . . 38912.6.2 Links with the Complementarity Problems . . . . . . . . . .. . . . 39012.6.3 Links with the Constrained Minimization Problem . . .. . . . 39112.6.4 Merit and Gap Functions for VI . . . . . . . . . . . . . . . . . . . .. . . 392

Page 16: Numerical Methods for Nonsmooth Dynamical …Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics Vincent Acary, Bernard Brogliato To cite this

Hal

INR

IA s

ampl

e

Contents XVII

12.6.5 Nonsmooth and Generalized equations . . . . . . . . . . . . .. . . . 39612.6.6 Main Types of Algorithms for the VI and QVI . . . . . . . . . .. 39812.6.7 Projection-Type and Splitting Methods . . . . . . . . . . .. . . . . . 39812.6.8 Minimization of Merit Functions . . . . . . . . . . . . . . . . .. . . . . 40012.6.9 Generalized Newton Methods . . . . . . . . . . . . . . . . . . . . .. . . . 40112.6.10 Interest from a Computational Point of View . . . . . . .. . . . . 401

12.7 Summary of the Main Ideas . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . 401

13 Numerical Methods for the Frictional Contact Problem . . . . . . . . . . . . 40313.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . 40313.2 Summary of the Time-Discretized Equations . . . . . . . . . .. . . . . . . . . . 403

13.2.1 The Index Set of Forecast Active Constraints . . . . . . .. . . . . 40313.2.2 Summary of the OSNSPs . . . . . . . . . . . . . . . . . . . . . . . . . . .. 405

13.3 Formulations and Resolutions in LCP Forms . . . . . . . . . . .. . . . . . . . . 40713.3.1 The Frictionless Case with Newton’s Impact Law . . . . .. . . 40713.3.2 The Frictionless Case with Newton’s Impact and Linear

Perfect Bilateral Constraints . . . . . . . . . . . . . . . . . . . . . . . .. . 40813.3.3 Two-Dimensional Frictional Case as an LCP . . . . . . . . .. . . 40913.3.4 Outer Faceting of the Coulomb’s Cone . . . . . . . . . . . . . .. . . 41013.3.5 Inner Faceting of the Coulomb’s Cone . . . . . . . . . . . . . .. . . 41413.3.6 Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . 41713.3.7 Weakness of the Faceting Process . . . . . . . . . . . . . . . . .. . . . 418

13.4 Formulation and Resolution in a Standard NCP Form . . . . .. . . . . . . 41913.4.1 The Frictionless Case . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . 41913.4.2 A Direct MCP for the 3D Frictional Contact . . . . . . . . . .. . . 41913.4.3 A Clever Formulation of the 3D Frictional Contact

as an NCP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42013.5 Formulation and Resolution in QP and NLP Forms . . . . . . . .. . . . . . 422

13.5.1 The Frictionless Case . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . 42213.5.2 Minimization Principles and Coulomb’s Friction . . .. . . . . . 423

13.6 Formulations and Resolution as Nonsmooth Equations . .. . . . . . . . . 42413.6.1 Alart and Curnier’s Formulation and Generalized

Newton’s Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42413.6.2 Variants and Line-Search Procedure . . . . . . . . . . . . . .. . . . . 42913.6.3 Other Direct Equation-Based Reformulations . . . . . .. . . . . . 430

13.7 Formulation and Resolution as VI/CP. . . . . . . . . . . . . . . .. . . . . . . . . . 43213.7.1 VI/CP Reformulation . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . 43213.7.2 Projection-type Methods . . . . . . . . . . . . . . . . . . . . . . .. . . . . . 43313.7.3 Fixed-Point Iterations on the Friction Threshold

and Ad Hoc Projection Methods . . . . . . . . . . . . . . . . . . . . . . . 43413.7.4 A Clever Block Splitting: the Nonsmooth Gauss–Seidel

(NSGS) Approach . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43713.7.5 Newton’s Method for VI . . . . . . . . . . . . . . . . . . . . . . . . . .. . . 440

Page 17: Numerical Methods for Nonsmooth Dynamical …Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics Vincent Acary, Bernard Brogliato To cite this

Hal

INR

IA s

ampl

e

XVIII Contents

Part IV The SICONOS Software: Implementation and Examples

14 The SICONOS Platform . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44314.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . 44314.2 An Insight into SICONOS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 443

14.2.1 Step 1. Building a Nonsmooth Dynamical System . . . . . .. . 44414.2.2 Step 2. Simulation Strategy Definition . . . . . . . . . . . .. . . . . . 447

14.3 SICONOSSoftware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .44814.3.1 General Principles of Modeling and Simulation . . . . .. . . . . 44814.3.2 NSDS-Related Components . . . . . . . . . . . . . . . . . . . . . . .. . . 45114.3.3 Simulation-Related Components . . . . . . . . . . . . . . . . .. . . . . 45614.3.4 SICONOSSoftware Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 457

14.4 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . 46014.4.1 The Bouncing Ball(s) . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . 46014.4.2 The Woodpecker Toy . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . 46314.4.3 MOS Transistors and Inverters . . . . . . . . . . . . . . . . . . .. . . . . 46414.4.4 Control of Lagrangian systems . . . . . . . . . . . . . . . . . . .. . . . . 466

A Convex, Nonsmooth, and Set-Valued Analysis. . . . . . . . . . . . . . . . . . . . . 475A.1 Set-Valued Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . 475A.2 Subdifferentiation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . 475A.3 Some Useful Equivalences . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . 476

B Some Results of Complementarity Theory. . . . . . . . . . . . . . . . . . . . . . . . 479

C Some Facts in Real Analysis. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 481C.1 Functions of Bounded Variations in Time . . . . . . . . . . . . . .. . . . . . . . 481C.2 Multifunctions of Bounded Variation in Time . . . . . . . . . .. . . . . . . . . 482C.3 Distributions Generated by RCLSBV Functions . . . . . . . . .. . . . . . . . 483C.4 Differential Measures . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . 486C.5 Bohl’s Distributions . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . 487C.6 Some Useful Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . 487

References. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . 489

Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . 519

Page 18: Numerical Methods for Nonsmooth Dynamical …Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics Vincent Acary, Bernard Brogliato To cite this

Hal

INR

IA s

ampl

e

List of Acronyms

Absolutely Continuous (AC)Affine Variational Inequality (AVI)

Complementarity Problem (CP)

Differential Algebraic Equation (DAE)Dynamical (or Differential) Complementarity System (DCS)Differential Inclusion (DI)

Evolution Variational Inequality (EVI)

Karush–Kuhn–Tucker (KKT)

Linear Complementarity Problem (LCP)Linear Complementarity System (LCS)Linar Independence Constraint Qualification (LICQ)

Mixed Complementarity Problem (MCP)Mixed Linear Complementarity Problem (MLCP)Mixed Linear Complementarity System (MLCS)

Nonlinear Complementarity Problem (NCP)NonLinear Programming (NLP)Non Smooth Gauss–Seidel (NSGS)

Ordinary Differential Equation (ODE)Onestep NonSmooth Problem (OSNSP)

Positive Definite (PD)Positive Semi–Definite (PSD)

Page 19: Numerical Methods for Nonsmooth Dynamical …Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics Vincent Acary, Bernard Brogliato To cite this

Hal

INR

IA s

ampl

e

XX List of Acronyms

Quadratic Program (QP)

Successive Quadratic Program (SQP)

Unilateral Differential Inclusion (UDI)

Variational Inequality (VI)

Page 20: Numerical Methods for Nonsmooth Dynamical …Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics Vincent Acary, Bernard Brogliato To cite this

Hal

INR

IA s

ampl

e

List of Algorithms

1 Stewart’s event-driven method . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . 2122 Stewart’s switching point location method . . . . . . . . . . . . .. . . . . . . . . . 2133 Stewart’s active-set updating procedure . . . . . . . . . . . . . .. . . . . . . . . . . 2134 Event -driven procedure on a single time-step with one contact . . . . . 2285 Event -driven procedure on a single time-step with severalcontacts . . 2316 Leine’s switch model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . 2687 Time-stepping for passive LCS . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . 2778 NSCD method. Linear case. . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . 2999 NSCD method. Nonlinear case with Newton’s method . . . . . . . .. . . . 30410 Sketch of the active-set method for convex QP . . . . . . . . . . .. . . . . . . . 34011 Sketch of the general splitting scheme for the LCP . . . . . . .. . . . . . . . . 36312 Sketch of the general splitting scheme with line search for the

LCP(M,q) with M symmetric . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36613 Murty’s least index pivoting method . . . . . . . . . . . . . . . . . .. . . . . . . . . . 36914 Lemke’s method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . 37215 General scheme of the primal–dual interior point methods. . . . . . . . . 37716 Hyperplane projection method (Konnov, 1993) . . . . . . . . . .. . . . . . . . . 40017 Fixed-point algorithm on the friction threshold . . . . . . .. . . . . . . . . . . . 43618 Analytical resolution of the two-dimensional frictional contact

subproblem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . 43819 Approximate solution of the three-dimensional frictional contact

subproblem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . 440

Page 21: Numerical Methods for Nonsmooth Dynamical …Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics Vincent Acary, Bernard Brogliato To cite this

Hal

INR

IA s

ampl

e

Page 22: Numerical Methods for Nonsmooth Dynamical …Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics Vincent Acary, Bernard Brogliato To cite this

Hal

INR

IA s

ampl

e

1

Nonsmooth Dynamical Systems: Motivating Examplesand Basic Concepts

The aim of this introductory material is to show how one may write the dynamicalequations of several physical systems like simple electrical circuits with nonsmoothelements, and simple mechanical systems with unilateral constraints on the positionand impacts, Coulomb friction. We start with circuits with ideal diodes, then circuitswith ideal Zener diodes. Then a mechanical system with Coulomb friction is ana-lyzed, and the bouncing ball system is presented. These physical examples illustrategradually how one may construct various mathematical equations, some of whichare equivalent (i.e., the same “initial” data produce the same solutions). In each casewe also derive the time-discretization of the continuous-time dynamics, and gradu-ally highlight the discrepancy from one system to the next. All the presented toolsand algorithms that are briefly presented in this chapter will be more deeply studiedfurther in the book.

1.1 Electrical Circuits with Ideal Diodes

Though this book is mainly concerned with mechanical systems, electrical circuitswill also be considered. The reasons are that on one hand electrical circuits with non-smooth elements are an important class of physical systems,on the other hand theirdynamics can nicely be recast in the family of evolution problems like differentialinclusions, variational inequalities, complementarity systems, and some piecewisesmooth systems. There is therefore a strong analogy betweennonsmooth circuitsand nonsmooth mechanical systems. This similarity will naturally exist also at thelevel of numerical simulation, which is the main object of this book.

The objective of this section is to show that electrical circuits containing so-called ideal diodes possess a dynamics which can be interpreted in various ways. Itcan be written as a complementarity system, a differential inclusion, an evolutionvariational inequality, or a variable structure system. What these several formalismsreally mean will be made clear with simple examples.

Page 23: Numerical Methods for Nonsmooth Dynamical …Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics Vincent Acary, Bernard Brogliato To cite this

Hal

INR

IA s

ampl

e

2 1 Nonsmooth Dynamical Systems: Motivating Examples and Basic Concepts

1.1.1 Mathematical Modeling Issues

Let us consider the four electrical circuits depicted in Fig. 1.3. The diodes are sup-posed to be ideal, i.e., the characteristic between the currenti(t) and the voltagev(t)(see Fig. 1.1a for the notation) satisfies thecomplementarityconditions:

0 6 i(t) ⊥ v(t) > 0 . (1.1)

This set of conditions merely means that both the variables currenti(t) and voltagev(t) have to remain nonnegative at all timest and that they have to be orthogonal oneto each other. Soi(t) can be positive only ifv(t)= 0, and vice versa. The complemen-tarity condition (1.1) between the current across the diodeand its voltage certainlyrepresents the most natural way to define the diode characteristic. It is quite similar

i(t)

v(t)

Fig. 1.1a.The diode component

0

i(t)

v(t)

Fig. 1.1b.Characteristics of an ideal diode. A complementarity condition

i(t)

v(t)0

Fig. 1.1c.The graph of the Shockley’s law

Page 24: Numerical Methods for Nonsmooth Dynamical …Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics Vincent Acary, Bernard Brogliato To cite this

Hal

INR

IA s

ampl

e

1.1 Electrical Circuits with Ideal Diodes 3

to the relations between the contact force and the distance between the system andan obstacle, in unilateral mechanics,1 see Sect. 1.4.

Naturally, other models can be considered for the diode component. The well-known Shockley’s law, which is one of the numerous models that can be found instandard simulation software, can be defined as

i = isexp(− vα−1) , (1.2)

where the constantα depends mainly on the temperature. This law is depicted inFig. 1.1c. This model may be considered to be more physical than the ideal one,because the residual saturation current,is is taken into account as a function of thevoltage across the diode. The same remark applies in mechanics for a compliant con-tact model with respect to unilateral rigid contact model. Nevertheless, in the numer-ical practice, the ideal model reveals to be better from the qualitative point of viewand also from the quantitative point of view. One of the reasons is that exchangingthe highly stiff nonlinear model as in (1.2) by a nonsmooth multivalued model (1.1)leads to more robust numerical schemes. Moreover it is easy to introduce a residualcurrent in the complementarity formalism as follows:

0 6 i(t)+ ε1 ⊥ v(t)+ ε2 > 0 (1.3)

for someε1 > 0, ε2 > 0. This results in a shift of the characteristic of Fig. 1.1b.The relation in (1.1) will necessarily enter the dynamics ofa circuit contain-

ing ideal diodes. It is consequently crucial to clearly understand its meaning. Let usnotice that the relation in (1.1) defines thegraphof a multivalued function(or mul-tifunction, or set-valued function), as it is clear that it is satisfied for anyi(t) > 0 ifv(t) = 0. This graph is depicted in Fig. 1.1b.

Using basic convex analysis (which in particular will allowus to accurately de-fine what is meant by the gradient of a function that is not differentiable in the usualway), a nice interpretation of the relation in (1.1) and of its graph in Fig. 1.1b can beobtained withindicator functions of convex sets. The indicator of a setK is defined as

ψK(x) =

{

0 if x∈ K+∞ if x 6∈ K

. (1.4)

This function is highly nonsmooth on the boundary∂K of K, since it even possessesan infinite jump at such points! It is therefore nondifferentiable atx∈ ∂K. Neverthe-less, ifK is a convex set thenψK(·) is a convex function, and it issubdifferentiableinthe sense of convex analysis. Roughly speaking, one will considersubgradientsin-stead of the usual gradient of a differentiable function. The subgradients of a convexfunction are vectorsγ defining the directions “under” the graph of the function. Moreprecisely,γ is a subgradient of a convex functionf (·) at x if and only if it satisfies

1 At this stage the similarity between both remains at a pure formal level. Indeed a morephysical analogy would lead us to consider that it is rather arelation between a velocityand a force that corresponds to (1.1).

Page 25: Numerical Methods for Nonsmooth Dynamical …Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics Vincent Acary, Bernard Brogliato To cite this

Hal

INR

IA s

ampl

e

4 1 Nonsmooth Dynamical Systems: Motivating Examples and Basic Concepts

f (y)− f (x) > γT(y−x) (1.5)

for all y. Normally the subdifferential is denoted as∂ f (·), and∂ f (x) can be a set(containing the subgradientsγ).

Let us now consider the particular case of the indicator function of K = IR+ ={x∈ IR | x > 0}. Though this might be at first sight surprising, this function is subd-ifferentiable atx = 0. Its subdifferential is given by

∂ψIR+(x) =

{

{0} if x > 0(−∞,0] if x = 0

. (1.6)

Indeed one checks that whenx > 0, thenψIR+(y) > γ(y− x) for all y ∈ IR can besatisfied if and only ifγ = 0. Now if x = 0, ψIR+(y) > γy is satisfied for ally ∈ IRif and only if γ 6 0. One sees that atx = 0 the subdifferential is a set, since it is acomplete half space. In fact the set∂ψIR+(x) is equal to the so-called normal coneto IR+ at the pointx (Fig. 1.2). This can be generalized to convex setsK ⊂ IRn, sothat the subdifferentialψK(x) is the normal cone to the setK, computed at the pointx∈ K and denoted byNK(x). If the boundary ofK is differentiable, this is simply ahalf-line normal to the tangent plane toK at x, and in the direction outwardK.

It becomes apparent that the graph of the subdifferential ofthe indicator ofIR+

resembles a lot the corner law depicted in Fig. 1.1b. Actually, one can now deducefrom (1.6) and (1.1) that

i(t) ∈ −∂ψIR+(v(t)) ⇐⇒ v(t) ∈ −∂ψIR+(i(t)) . (1.7)

The symmetry between these two inclusions is clear from Fig.1.1b: if one inverts themultifunction (exchangei(t) andv(t) in Fig. 1.1b), then one obtains exactly the samegraph. Actually this is a very particular case of duality between two variables. In amore general setting the graph inversion procedure does notyield the graph of thesame multifunction, but the graph of its conjugate. And inverting once again allows

NK(0) x0

ψIR+(x)

+∞

Fig. 1.2.The indicator function ofIR+ and the normal cone atx= 0,NK(0) = ∂ψIR+(0) = IR−

Page 26: Numerical Methods for Nonsmooth Dynamical …Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics Vincent Acary, Bernard Brogliato To cite this

Hal

INR

IA s

ampl

e

1.1 Electrical Circuits with Ideal Diodes 5

one to recover the original graph under some convexity and properness assumption:this is the very basic principle of duality (Luenberger, 1992).

Let us focus now on theinclusionsin (1.7). As a matter of fact, one may checkthat the first one is equivalent to: for anyv(t) > 0,

〈i(t),u−v(t)〉> 0, ∀ u > 0 (1.8)

and to: for anyi(t) > 0,

〈v(t),u− i(t)〉> 0, ∀ u > 0 . (1.9)

The objects in (1.8) and (1.9) are called aVariational Inequality (VI).We therefore have three different ways of looking at the ideal diode character-

istic: the complementarity relations in (1.1), the inclusion in (1.7), and the varia-tional inequality in (1.8). Our objective now is to show thatwhen introduced intothe dynamics of an electrical circuit, these formalisms give rise to various types ofdynamical systems as enumerated at the beginning of this section.

Remark 1.1.Another variational inequality can also be written: for alli(t) > 0,v(t) > 0,

〈 j − i(t),u−v(t)〉> 0 , ∀ j,u > 0 . (1.10)

Having attained this point, the reader might legitimately wonder what is the use-fulness of doing such an operation, and what has been gained by rewriting (1.1) asin (1.7) or as in (1.8). Let us answer a bit vaguely: several formalisms are likelyto be useful for different tasks which occur in the course of the study of a dynam-ical system (mathematical analysis, time-discretizationand numerical simulation,analysis for control, feedback control design, and so on). In this introductory chap-ter, we just ask the reader to trust us: all these formalisms are useful and are used.We will see in the sequel that there exists a lot of other ways to write the comple-mentary condition such as zeroes of special functions or extremal points of a func-tional. All these formulations will lead to specific ways of studying and solving thesystem.

1.1.2 Four Nonsmooth Electrical Circuits

In order to derive the dynamics of an electrical circuit we need to consider Kirchoff’slaws as well as the constitutive relations of devices like resistors, inductors, and ca-pacitors (Chua et al., 1991). The constitutive relation of the ideal diode is the com-plementarity relation (1.1) while in the case of resistors,inductors, and capacitorswe have the classical linear relations between variables like voltages, currents, andcharges. Thus, taking into account those constitutive relations and using Kirchoff’slaws it follows that the dynamical equations of the four circuits depicted in Fig. 1.3are given by

Page 27: Numerical Methods for Nonsmooth Dynamical …Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics Vincent Acary, Bernard Brogliato To cite this

Hal

INR

IA s

ampl

e

6 1 Nonsmooth Dynamical Systems: Motivating Examples and Basic Concepts

(a)

x1(t) = x2(t)−1

RCx1(t)−

λ (t)R

x2(t) = − 1LC

x1(t)−λ (t)

L

0 6 λ (t) ⊥ w(t) =λ (t)

R+

1RC

x1(t)−x2(t) > 0

(1.11)

(b)

x1(t) = −x2(t)+ λ (t)

x2(t) =1

LCx1(t)

0 6 λ (t) ⊥ w(t) =1C

x1(t)+Rλ (t) > 0

(1.12)

(c)

x1(t) = x2(t)

x2(t) = −RL

x2(t)−1

LCx1(t)−

λ (t)L

0 6 λ (t) ⊥ w(t) = −x2(t) > 0

(1.13)

(d)

x1(t) = x2(t)−1

RCx1(t)

x2(t) = − 1LC

x1(t)+λ (t)

L

0 6 λ (t) ⊥ w(t) = x2(t) > 0

(1.14)

where we considered the current through the inductors for the variablex2(t), and forthe variablex1(t) the charge on the capacitors as state variables.

Let us now make use of the above equivalent formalisms to express the dynam-ics in (1.11)–(1.14) in various ways. We will generically call the dynamics in (1.11)–(1.14) a Linear Complementarity System (LCS), a terminology introduced in van derSchaft & Schumacher (1996). An LCS therefore consists of a linear differential equa-tion with state(x1,x2), an external signalλ (·) entering the differential equation, anda set of complementarity conditions which relate a variablew(·) andλ (·). Sincew(·)is itself a function of the state and possibly ofλ (·), the complementarity conditionsplay a crucial role in the dynamics. The variableλ may be interpreted as a Lagrangemultiplier.

Page 28: Numerical Methods for Nonsmooth Dynamical …Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics Vincent Acary, Bernard Brogliato To cite this

Hal

INR

IA s

ampl

e

1.1 Electrical Circuits with Ideal Diodes 7

(a)

CRL

x2

(b)

CL

x2

R

(c)

C

L

R

x2

(d)

CRL

x2

Fig. 1.3.RLC circuits with an ideal diode

1.1.3 Continuous System (Ordinary Differential Equation)

Let us consider for instance the circuit (a) whose dynamics is in (1.11). Its comple-mentarity conditions are given by

w(t) =λ (t)

R+

1RC

x1(t)−x2(t)

0 6 λ (t) ⊥ w(t) > 0

. (1.15)

If we considerλ (t) as the unknown of this problem, then the question we have toanswer to is: does it possess a solution, and if yes is this solution unique? Here wemust introduce a basic tool that is ubiquitous in complementarity systems: the LinearComplementarity Problem (LCP). An LCP is a problem which consists of solving aset of complementarity relations as

w = Mλ +q

0 6 λ ⊥ w > 0

, (1.16)

Page 29: Numerical Methods for Nonsmooth Dynamical …Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics Vincent Acary, Bernard Brogliato To cite this

Hal

INR

IA s

ampl

e

8 1 Nonsmooth Dynamical Systems: Motivating Examples and Basic Concepts

whereM is a constant matrix andq a constant vector, both of appropriate dimen-sions. The inequalities have to be understood component-wise and the relationw⊥ λmeanswTλ = 0. A fundamental result on LCP (see Sect. 12.4) guarantees that thereis a uniqueλ that solves the LCP in (1.16) for anyq if and only if M is a so-calledP-matrix (i.e., all its principal minors are positive). In particular, positive definitematrices are P-matrices.

Taking this into account, it is an easy task to see that there is a unique solutionλ (t) to the LCP in (1.15) given by

λ (t) = 0 if1

RCx1(t)−x2(t) > 0 , (1.17)

λ (t) = − 1C

x1(t)+Rx2(t) > 0 if1

RCx1(t)−x2(t) < 0 . (1.18)

Evidently we could have solved this LCP without resorting toany general re-sult on existence and uniqueness of solutions. However, we will often encounterLCPs with several tenth or even hundreds of variables (i.e.,the dimension ofMin (1.16) can be very large in many applications). In such cases solving the LCP“with the hands” rapidly becomes intractable. Soλ (t) in (1.11) considered as thesolution at timet of the LCP in (1.15) can take two values, and only two, for allt > 0.

Another way to arrive at the same result for circuit (a) is to use once again theequivalence between (1.1) and (1.7). It is straightforwardthen to see that (1.15) isequivalent to

λ (t)+1C

x1(t)−Rx2(t) ∈ −∂ψIR+(λ (t)) (1.19)

(we have multiplied the left-hand side byR and since∂ψIR+(λ (t)) is a coneR∂ψIR+

(λ (t)) = ∂ψIR+(λ (t))). It is well known in convex analysis (see Appendix A) that(1.19) is equivalent to

λ (t) = ProjIR+

[

− 1C

x1(t)+Rx2(t)

]

, (1.20)

where ProjIR+ is the projection onIR+. SinceIR+ is convex (1.20) possesses a uniquesolution. Once again we arrive at the same conclusion. The surface that splits thephase space(x1,x2) in two parts corresponding to the “switching” of the LCP isthe line− 1

Cx1(t)+ Rx2(t) = 0. On one side of this lineλ (t) = 0, and on the othersideλ (t) = − 1

Cx1(t)+Rx2(t) > 0. We may write (1.11) as

Page 30: Numerical Methods for Nonsmooth Dynamical …Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics Vincent Acary, Bernard Brogliato To cite this

Hal

INR

IA s

ampl

e

1.1 Electrical Circuits with Ideal Diodes 9

x1(t) = x2(t)−1

RCx1(t)

x2(t) = − 1LC

x1(t)

if − 1C

x1(t)+Rx2(t) < 0 ,

x1(t) = 0

x2(t) = −RL

x2(t)if − 1

Cx1(t)+Rx2(t) > 0 ,

(1.21)

that is a piecewise linear system, or as

x(t)−Ax(t) = B ProjIR+

[

− 1C

x1(t)+Rx2(t)

]

, (1.22)

where the matricesA andB can be easily identified.The fact that the projection operator in (1.20) is a Lipschitz-continuous single-

valued function (Goeleven et al., 2003a) shows that the equation (1.22) is an OrdinaryDifferential Equation (ODE) with a Lipschitz-continuous vector field.2 We thereforeconclude that this complementarity system possesses a global unique and differen-tiable solution, as a standard result on ODEs (Coddington & Levinson, 1955).

Exactly the same analysis can be done for the circuit (b) which is also an ODE.

1.1.4 Hints on the Numerical Simulation of Circuits (a) and (b)

The circuit (a) can be simulated with any standard one-step and multistep methodslike explicit or implicit (backward) Euler, mid-point, or trapezoidal rules (Haireret al., 1993, Chap. II.7), which apply to ordinary differential equations with aLipschitz right-hand side. Nevertheless, all these methods behave globally as amethod of order one as the right-hand side is not differentiable everywhere (Haireret al., 1993; Calvo et al., 2003).

As an illustration, a simple trajectory of the circuit (a) is computed with an ex-plicit Euler scheme and a standard Runge–Kutta of order 4 scheme. The results aredepicted in Fig. 1.4. With the initial conditions,x1(0) = 1, x2(0) = −1, we observeonly one event or switch from one mode to the other. Before theswitch, the dynamicsis a linear oscillator inx1 and after the switch, it corresponds to a exponential decayin x1.

We present in Fig. 1.5 a slightly more rich dynamics with the circuit (b), whichcorresponds to a half-wave rectifier. When the diode blocks the current,λ = 0,w> 0,the dynamics of the circuit is a pure linear LC oscillator inx2. When the constraintis activeλ > 0,w = 0 and the diode lets the positive current pass: the dynamics isa damped linear oscillator inx1. The interest of the circuit (b) with respect to thecircuit (a) is that ifR is small other switches are possible in circuit (b).

2 It is also known that the solutions of LCPs as in (1.16) withM a P-matrix are Lipschitz-continuous functions ofq (Cottle et al., 1992, Sect. 7.2). So we could have deduced thisresult from (1.15) and the complementarity formalism of thecircuit.

Page 31: Numerical Methods for Nonsmooth Dynamical …Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics Vincent Acary, Bernard Brogliato To cite this

Hal

INR

IA s

ampl

e

10 1 Nonsmooth Dynamical Systems: Motivating Examples and Basic Concepts

-0.6-0.4-0.2

0 0.2 0.4 0.6 0.8

1

-5-4.5

-4-3.5

-3-2.5

-2-1.5

-1-0.5

0

0 2 4 6 8

10 12 14 16 18 20

0 1 2 3 4 5 6

0 1 2 3 4 5

Explicit Euler

Explicit Euler

Explicit Euler

Explicit Euler

RK4

RK4

RK4

RK4

x 1(t

)x 2

(t)

w(t

(t)

Time t

Fig. 1.4.Simulation of the circuit (a) with the initial conditionsx1(0) = 1, x2(0) = −1 and

R= 10, L = 1, C =1

(2π)2 . Time steph = 5×10−3

The Question of the Order

It is noteworthy that even in this simple case, where the “degree” of nonsmoothness israther low (said otherwise, the system is a gentle nonsmoothsystem), applying higherorder “time-stepping” methods which preserve the orderp> 2 is not straightforward.By time-stepping method, we mean here a time-discretization method which does notconsider explicitly the possible times at which the solution is not differentiable in theprocess of integration.

Let us now quote some ideas from Grüne & Kloeden (2006) which accuratelyexplain the problem of applying standard higher order schemes:In principle knownnumerical schemes for ordinary differential equations such as Runge–Kutta schemescan be applied to switching systems, changing the vector field after each switchhas occurred. However, in order to maintain the usual consistency order of theseschemes, the integration time steps need to be adjusted to the switching times in sucha way that switching always occurs at the end of an integration interval. This isimpractical in the case of fast switching, because in this case an adjustment of thescheme’s integration step size to the switching times wouldlead to very small timesteps causing an undesirably high computational load. Such a method for the timeintegration of nonsmooth systems, which consists in locating and adjusting the timestep to the events will be called anevent-driven method. If the location of the events

Page 32: Numerical Methods for Nonsmooth Dynamical …Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics Vincent Acary, Bernard Brogliato To cite this

Hal

INR

IA s

ampl

e

1.1 Electrical Circuits with Ideal Diodes 11

-0.8-0.6-0.4-0.2

0 0.2 0.4 0.6 0.8

1

-3-2-1 0 1 2 3 4 5 6 7

0 0.5

1 1.5

2 2.5

3

0 5

10 15 20 25 30 35 40

0 1 2 3 4 5

Explicit Euler

Explicit Euler

Explicit Euler

Explicit Euler

RK4

RK4

RK4

RK4

x 1(t

)x 2

(t)

w(t

(t)

Time t

Fig. 1.5. Simulation of the circuit (b) with the initial conditionsx1(0) = 1, x2(0) = 1 and

R= 10, L = 1, C =1

(2π)2 . Time steph = 5×10−3

is sufficiently accurate, the global order of the integration method can be retrieved. Ifone is not interested in maintaining the order of the scheme larger than one, however,one may apply Runge–Kutta methods directly to an ODE as (1.22).

There are three main conclusions to be retained from this:

1. When the instants of nondifferentiability are not known in advance, or when thereare too many such times, then applying an “event-driven” method with orderlarger than one may not be tractable.

2. We may add another drawback of event-driven methods that may not be present inthe system we have just studied, but will frequently occur inthe systems studiedin this book. Suppose that the events (or times of nondifferentiability, or switchingtimes) possess a finite accumulation point. Then an event-driven scheme will notbe able to go further than the accumulation, except at the price of continuing theintegration with some ad hoc, physically and mathematically unjustified trick.

3. Finally, there exist higher order standard numerical schemes which continue toperform well for some classes of nonsmooth systems, but at the price of decreas-ing the global order to one (see Sect. 9.2). However, this global low-order behav-ior can be compensated by an adaptive time-step strategy which takes benefitsfrom the high accuracy of the time-integration scheme on smooth phases.

Page 33: Numerical Methods for Nonsmooth Dynamical …Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics Vincent Acary, Bernard Brogliato To cite this

Hal

INR

IA s

ampl

e

12 1 Nonsmooth Dynamical Systems: Motivating Examples and Basic Concepts

It is noteworthy that the events that will be encountered in the systems examinedthroughout the book usually are not exogenous events but state dependent, hence notknown in advance. Therefore, the choice between the event-driven methods or thetime-stepping methods depends strongly on the type of systems under study. We willcome back later on the difference between time-stepping andevent-driven numeri-cal schemes and their respective ranges of applications (especially for mechanicalsystems).

The Question of the Stability of Explicit Schemes

As we said earlier, the nonsmoothness of the right-hand sidedestroys the order ofconvergence of the standard time-stepping integration scheme. Another aspect is thestability, especially for explicit schemes. Most of the results on the stability of nu-merical integration schemes are based on the assumption of sufficient regularity ofthe right-hand side.

The question of the simulation of ODEs with discontinuitieswill be discussedin Sects. 7.2 and 9.1. Some numerical illustrations of troubles in terms of the orderof convergence and the stability of the methods are given in Sect. 9.1 where thedynamics of the circuits(a) and(b) are simulated.

1.1.5 Unilateral Differential Inclusion

Let us now turn our attention to circuit (c). This time the complementarity relationsare given by

0 6 λ (t) ⊥ w(t) = −x2(t) > 0 . (1.23)

Contrary to (1.15), it is not possible to calculateλ (t) directly from this set of rela-tions. At first sight there is no LCP that can be constructed (indeed now we have azero matrixM).

Let us, however, imagine that there is a time interval[τ,τ + ε), ε > 0, on whichthe solutionx2(t) = 0 for all t ∈ [τ,τ + ε). Then on[τ,τ + ε) one has necessar-ily −x2(t) > 0, otherwise the unilateral constraint−x2(t) > 0 would be violated.Actually all the derivatives ofx2(·) are identically 0 on[τ,τ + ε). The interestingquestion is: what happens on the right oft = τ + ε ? Is there one derivative ofx2(·)that becomes positive, so that the system starts to detach from the constraintx2 = 0 att = τ + ε? Such a question is important, think for instance of numerical simulation:one will need to implement a correct test to determine whether or not the systemkeeps evolving on the constraint, or quits it. In fact the test consists of consideringthe further complementarity condition

0 6 λ (t+) ⊥−x2(t) =RL

x2(t+)+

1LC

x1(t)+λ (t+)

L> 0 (1.24)

which is an LCP to be solved only whenx2(t) = 0. The fact that this LCP possessesa solutionλ (t)− x2(t) > 0 is a sufficient condition for the system to change itsmodeof evolution. We can solve forλ (t) in (1.24) exactly as we did for (1.15). Both are

Page 34: Numerical Methods for Nonsmooth Dynamical …Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics Vincent Acary, Bernard Brogliato To cite this

Hal

INR

IA s

ampl

e

1.1 Electrical Circuits with Ideal Diodes 13

LCPs with a unique solution. However, this time the resulting dynamical system isnot quite the same, since we have been obliged to follow a different path to get theLCP in (1.24).

In order to better realize this big discrepancy, let us use once again the equiva-lence between (1.1) and (1.7). We obtain thatλ (t) ∈ −∂ψIR+(−x2(t)). Inserting thisinclusion in the dynamics (1.13) yields

(c)

x1(t)−x2(t) = 0

x2(t)+RL

x2(t)+1

LCx1(t) ∈

1L

∂ψIR+(−x2(t))(1.25)

where it is implicitly assumed thatx2(0) 6 0 so that the inequality constraintx2(t) 6 0 will be satisfied for allt > 0.

Passing from the LCP (1.23) to the LCP (1.24) and then from (1.13) to (1.25)can be viewed similarly as the index-reduction operation ina Differential AlgebraicEquation (DAE). Indeed, the LCP onx2 in (1.23) is replaced by the LCP on ˙x2 in(1.24).

Unilateral Differential Inclusion

More compactly, (1.25) can be rewritten as

−x(t)+Ax(t)∈ B∂ψIR+(w(t)) (1.26)

which we can call a Unilateral Differential Inclusion (UDI)where the matricesA andB can be easily identified. The reason why we employ the wordunilateralshould beobvious. It is noteworthy that the right-hand side of (1.26)is generally a set that is notreduced to a single element, see (1.6). It is also noteworthythat the complementarityconditions are included in the UDI in (1.26). Obviously, thedynamics in (1.26) isnot a variable structure or discontinuous vector field system. It is something else.

Evolution Variational Inequality

Using a suitable change of coordinatez = Rx, R = RT> 0, it is possible to show

(Goeleven & Brogliato, 2004; Brogliato, 2004) that (1.26) can also be seen as anEvolution Variational Inequality (EVI). This time we make use of the equivalencebetween (1.7) and (1.8) and of a property of electrical circuits composed of resis-tors, capacitors, and inductances (they are dissipative).Then (1.26) is equivalent tothe EVI

dzdt

(t)−RAR−1z(t),v−z(t)

> 0,∀ v ∈ K, a.e. t > 0

z(t) ∈ K, t > 0 ,

(1.27)

Page 35: Numerical Methods for Nonsmooth Dynamical …Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics Vincent Acary, Bernard Brogliato To cite this

Hal

INR

IA s

ampl

e

14 1 Nonsmooth Dynamical Systems: Motivating Examples and Basic Concepts

whereK = {(z1,z2)| − (0 1) R−1z> 0} and a.e. means almost everywhere (the so-lution not being a priori differentiable everywhere). As a consequence of how thesetK is constructed, havingz(t) ∈ K is equivalent to havingx2(t) 6 0. In fact it canbe shown that the EVI in (1.27) possesses unique continuous solutions which areright differentiable (Goeleven & Brogliato, 2004). It is remarkable at this stage tonotice that both (1.22) and (1.26) possess unique continuous solutions, however, thesolutions of the inclusion (1.26) are less regular.

1.1.6 Hints on the Numerical Simulationof Circuits (c) and (d)

Let us now see how the differential inclusion (1.26) and the LCS in (1.13) maybe time-discretized for numerical simulation purpose. Letus start with the LCS in(1.13).

A Direct Backward Euler Scheme

Mimicking the backward Euler discretization for ODEs, a time-discretization of(1.13) is

x1,k+1−x1,k = hx2,k+1

x2,k+1−x2,k = −hRL

x2,k+1−h

LCx1,k+1−

hL

λk+1

0 6 λk+1 ⊥−x2,k+1 > 0

, (1.28)

wherexk is the value, at timetk of a grid t0 < t1 < · · · < tN = T, N < +∞, h =T − t0

N= tk− tk−1, of a step functionxN(·) that approximates the analytical solution

x(·).Let us denotea(h) = 1+h

RL

+h2 1LC

. Then we can rewrite (1.28) as

x1,k+1−x1,k = hx2,k+1

x2,k+1 = (a(h))−1

{

x2,k−h

LCx1,k−

hL

λk+1

}

0 6 λk+1 ⊥−(a(h))−1

{

x2,k−h

LCx1,k

}

+(a(h))−1 hL

λk+1 > 0

. (1.29)

Remark 1.2.This time-stepping scheme is made of a discretization of thecontinuousdynamics (the first two lines of (1.29)) and of a LCP whose unknown is λk+1. Weshall call later on the LCP resolution a one-step algorithm.Here the LCP is scalarand can easily be solved by inspection. In higher dimensionsspecific solvers will benecessary. This is the object of Part III of this book.

Page 36: Numerical Methods for Nonsmooth Dynamical …Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics Vincent Acary, Bernard Brogliato To cite this

Hal

INR

IA s

ampl

e

1.1 Electrical Circuits with Ideal Diodes 15

Remark 1.3.The LCP matrixM (here a scalar) is equal to(a(h))−1 hL

> 0 for all

h > 0, which tends to 0 ash→ 0. This is not very good in practice when very smallsteps are chosen. To cope with this issue, let us choose as theunknown the variableλk+1 = hλk+1. We then solve the LCP

0 6 λk+1 ⊥−(a(h))−1{

x2,k−h

LCx1,k

}

+(a(h))−1 1L

λk+1 > 0 . (1.30)

It is noteworthy that this does not change the result of the algorithm, because the setof nonnegative reals is a cone. This LCP is easily solved:

If x2,k−h

LCx1,k < 0, then λk+1 = 0 . (1.31)

If x2,k−h

LCx1,k > 0 then λk+1 = L

{

x2,k−h

LCx1,k

}

> 0 . (1.32)

Inserting these values into (1.29) we get:

x2,k+1 =

(a(h))−1

{

x2,k−h

LCx1,k

}

if x2,k−h

LCx1,k < 0

0 if x2,k−h

LCx1,k > 0

. (1.33)

A Discretization of the Differential Inclusion (1.26)

Let us now propose an implicit time-discretization of the differential inclusion in(1.26), as follows:

x1,k+1−x1,k = hx2,k+1

x2,k+1−x2,k +hRL

x2,k+1 +h

LCx1,k+1 ∈

1L

∂ψIR+(−x2,k+1)

(1.34)

Notice that we can rewrite the second line of (1.34) as

x2,k+1− (a(h))−1{

x2,k−h

LCx1,k

}

∈ ∂ψIR+(−x2,k+1) (1.35)

where we have dropped the factor1L because∂ψIR+(−x2,k+1) is a cone.

Let us now use two properties from convex analysis. LetK ⊂ IRn be a convex set,and letx andy be vectors ofIRn. Then

x−y∈ −∂ψK(x) ⇐⇒ x = prox[K;y] , (1.36)

where “prox” means the closest element ofK to y in the Euclidean metric, i.e.,x =argminz∈K

12 ‖ z− y ‖2 (see (A.8) for a generalization in a metricM). Moreover

using the chain rule of Proposition A.3 one has

Page 37: Numerical Methods for Nonsmooth Dynamical …Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics Vincent Acary, Bernard Brogliato To cite this

Hal

INR

IA s

ampl

e

16 1 Nonsmooth Dynamical Systems: Motivating Examples and Basic Concepts

∂ψIR+(−x) = −∂ψIR−(x) . (1.37)

Using (1.36) and (1.37) one deduces from (1.35) that

x2,k+1− (a(h))−1{

x2,k−h

LCx1,k

}

∈ −∂ψIR−(x2,k+1) , (1.38)

so that the algorithm becomes

x1,k+1−x1,k = hx2,k+1

x2,k+1 = prox

[

IR−;(a(h))−1

{

x2,k−h

LCx1,k

}] . (1.39)

We therefore have proved the following:

Proposition 1.4.The algorithm (1.28) is equivalent to the algorithm (1.34).Theyboth allow one to advance from step k to step k+1, solving the proximation in (1.39).

In Figs. 1.6 and 1.7, simulation results of the presented algorithm are given.

1.1.6.1 Approximating the Measure of an Interval

It is worthy to come back on the trick presented in Remark 1.3 that has been used tocalculate the solution of the LCP in (1.29), i.e., to calculate λk+1 = hλk+1 rather thanλk+1.

-1-0.8-0.6-0.4-0.2

0 0.2 0.4 0.6 0.8

1

-7-6-5-4-3-2-1 0 1

0 5

10 15 20 25 30 35 40

0 1 2 3 4 5

Implicit Euler

Implicit Euler

Implicit Euler

x 1(t

)x 2

(t)

λ(t

)

Time t

Fig. 1.6. Simulation of the circuit (c) with the initial conditionsx1(0) = 1, x2(0) = 0 andR= 0.1, L = 1, C = 1

(2π)2 . Time steph = 1×10−3

Page 38: Numerical Methods for Nonsmooth Dynamical …Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics Vincent Acary, Bernard Brogliato To cite this

Hal

INR

IA s

ampl

e

1.1 Electrical Circuits with Ideal Diodes 17

-1-0.8-0.6-0.4-0.2

0 0.2 0.4 0.6

-0.5 0

0.5 1

1.5 2

2.5 3

3.5 4

4.5 5

0 2 4 6 8

10 12 14 16

0 1 2 3 4 5

Implicit Euler

Implicit Euler

Implicit Euler

x 1(t

)x 2

(t)

λ(t

)

Time t

Fig. 1.7.Simulation of the circuit (d) with the initial conditionsx1(0) = 1, x2(0) = −1 andR= 10, L = 1, C = 1

(2π)2 . Time steph = 1×10−3

First of all, it follows from (1.34) and (1.28) that the element of the set∂ψIR+(−x2,k+1) is notλk+1, but λk+1. Retrospectively, our “trick” therefore appearsnot to be a trick, but a natural thing to do. Second, this meansthat the primary vari-ables which are used in the integration are not(x1,k,x2,k,λk+1), but(x1,k,x2,k, λk+1).Suppose that the initial value for the variablex2(·) is negative. Then its right limit(supposed at this stage of the study to exist) has to satisfyx2(0+) > 0. Thus a jumpoccurs initially inx2(·), so that the multiplierλ is att = 0 a Dirac measure:3

λ = −L(x2(0+)−x2(0

−))δ0 (1.40)

The numerical scheme has to be able to approximate this measure! It is not possiblenumerically to achieve such a task, because this would mean approximating somekind of infinitely large value over one integration interval. However, what is quitepossible is to calculate the value of

dλ ([tk,tk+1]) =

[tk,tk+1]dλ , (1.41)

i.e., the measure of the interval[tk,tk+1].

3 Throughout the book, right and left limits of a function F(·) will be denoted asF(t+) or F+(t), andF(t−) or F−(t), respectively.

Page 39: Numerical Methods for Nonsmooth Dynamical …Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics Vincent Acary, Bernard Brogliato To cite this

Hal

INR

IA s

ampl

e

18 1 Nonsmooth Dynamical Systems: Motivating Examples and Basic Concepts

Outside atoms ofλ this is easy asλ is simply the Lebesgue measure. At atomsof λ this is again a bounded value. In fact,λk+1 = hλk+1 is an approximation of themeasure of the interval by dλ i.e.,

λk+1 = hλk+1 ≈∫

[tk,tk+1]dλ (1.42)

for each time-step interval.Such an algorithm is therefore guaranteed to compute onlyboundedvalues, even

if state jumps occur. Such a situation is common when we consider mechanical sys-tems (see Sect. 1.4), dynamical complementarity systems (see Chap. 4), or higherrelative degree systems (see Chap. 5).

Remark 1.5.A noticeable discrepancy between the equations (1.11) of the circuit(a) and the equations (1.13) of the circuit (c) is as follows. The complementarityrelations in (1.11) are such that for any initial value ofx1(·) andx2(·), there alwaysexist a bounded value of the multiplierλ (which is a function of time and of thestates) such that the integration proceeds. Such is not the case for (1.13), as pointedout just above. Therelative degree rbetweenw andλ plays a significant role in thedynamics (the relative degree is the number of times one needs to differentiatewin order to makeλ appear explicitly: in (1.11) one hasr = 0, but in (1.13) one hasr = 1). A comprehensible presentation of the notion of relativedegree is given inChap. 4.

1.1.6.2 The Necessity of an Implicit Discretization

Another reason why considering the discretization of the inclusion in (1.25) is im-portant is the following. Suppose one writes an explicit right-hand side∂ψIR+(−x2,k)in (1.34) instead of the implicit form∂ψIR+(−x2,k+1). Then after few manipulationsand using (1.36) one obtains

a(h)x2,k+1 +h

LCx1,k−x2,k ∈ ∂ψIR+(−x2,k)

mx2,k = prox

[

IR+;−a(h)x2,k+1−h

LCx1,k

]

(1.43)

which is absurd.The implicit way of discretizing the inclusion is thus the only way that leads

to a sound algorithm. This will still be the case with more general inclusions withright-hand sides of the form∂ψK(x) for some domainK ⊂ IRn.

Let us now start from the complementarity formalism (1.28),with an explicitform

0 6 λk+1 ⊥−x2,k > 0 . (1.44)

Page 40: Numerical Methods for Nonsmooth Dynamical …Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics Vincent Acary, Bernard Brogliato To cite this

Hal

INR

IA s

ampl

e

1.1 Electrical Circuits with Ideal Diodes 19

Then we get the complementarity problem

0 6 λk+1 ⊥−(

1+hR

L

)

x2,k+1−h

LCx1,k+1−

hL

λk+1 > 0 . (1.45)

Clearly this complementarity problem cannot be used to advance the algorithm fromstepk to stepk+1. This intrinsic implicit form of the discretization of theDifferentialInclusion (DI) we work with here is not present in other typesof inclusions, whereexplicit discretizations are possible, see Chap. 9.

1.1.7 Calculation of the Equilibrium Points

It is expected that studying the equilibrium points of complementarity systems as in(1.13) and (1.11) will lead either to a Complementarity Problem (CP) (like LCPs), orinclusions (see (1.7)), or variational inequalities (see (1.8)). Let us point out brieflythe usefulness of the tools that have been introduced above,for the characterizationof the equilibria of the class of nonsmooth systems we are dealing with.

In general one cannot expect that even simple complementarity systems possessa unique equilibrium. Consider for instance circuit (c) in (1.13). It is not difficult tosee that the set of equilibria is given by{(x∗1,x∗2)| x∗1 6 0,x∗2 = 0}.

Let us consider now (1.26) and its equivalent (1.27). The fixed pointsz∗ of theEVI in (1.27) have to satisfy

〈−RAR−1z∗,v−z∗〉 > 0,∀ v ∈ K . (1.46)

This is a variational inequality, and the studies concerning existence and unique-ness of solutions of a Variational Inequality (VI)are numerous. We may for instanceuse results in Yao (1994) which relate the set of solutions of(1.46) to the monotonic-ity of the operatorx 7→ −RAR−1x. In this case, monotonicity is equivalent to semi-positive definiteness of−RAR−1 and strong monotonicity is equivalent to positivedefiniteness of−RAR−1 (Facchinei & Pang, 2003, p. 155). If the matrix−RAR−1 issemi-positive definite, then Yao (1994, theorem 3.3) guarantees that the set of equi-libria is nonempty, compact, and convex. If−RAR−1 is positive definite, then fromYao (1994, theorem 3.5) there is a unique solution to (1.46),consequently a uniqueequilibrium for the system (1.26).

The monotonicity is of course a sufficient condition only. Inorder to see this, letus consider a linear complementarity system

x(t) = Ax(t)+Bλ (t)

0 6 Cx(t)+D ⊥ λ (t) > 0. (1.47)

The fixed points of this LCS are the solutions of the problem

0 = Ax∗ +Bλ

0 6 Cx∗ +D ⊥ λ > 0. (1.48)

Page 41: Numerical Methods for Nonsmooth Dynamical …Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics Vincent Acary, Bernard Brogliato To cite this

Hal

INR

IA s

ampl

e

20 1 Nonsmooth Dynamical Systems: Motivating Examples and Basic Concepts

If we assume thatA is invertible, then we can construct the following LCP

0 6 −CA−1Bλ +D ⊥ λ > 0 (1.49)

which is not to be confused with the LCP in (1.24). If the matrix −CA−1B is a P-matrix then this LCP has a unique solutionλ ∗ and we conclude that there is a uniqueequilibrium statex∗ = −A−1Bλ ∗. Clearly there is no monotonicity argument in thisreasoning as the set ofP-matrices contains that of positive definite matrices (i.e., aP-matrix is not necessarily positive definite).

As an illustration we may consider once again the circuits and (c) and (d). In thecase of (1.13) we have

A =

0 1

− 1LC

−RL

,−CA−1B = 0, andD = 0 . (1.50)

There is an infinity of solutions for the LCP in (1.49), as pointed out above. In thecase of (1.14) we have

A =

− 1RC

1

− 1LC

0

,−CA−1B =1R

> 0, andD = 0 . (1.51)

There is a unique solution. We leave it to the reader to calculate explicitly the solu-tions (or the set of solutions). It is easily checked that no one of the two matrices−Ais semi-positive definite and they therefore do not define monotone operators. Thesufficient criterion alluded to above is therefore not applicable.

In the case of circuit (a) with dynamics in (1.11), the fixed points are given as thesolutions of a complementarity problem of the form

0 = Ax∗ +Bλ

0 6 Cx∗ +Dλ ⊥ λ > 0, (1.52)

where

A =

− 1RC

1

− 1LC

0

,B = −

1R1L

,C =

(

1RC

−1

)

, andD =1R

(1.53)

SinceA is invertible, with inverse

A−1 =

(

0 −11

LC− 1

RC

)

one can expressx∗ asx∗ = −A−1Bλ . ThereforeCx∗ + Dλ = (D−CA−1B)λ , andthe LCP is: 06 λ ⊥ (D−CA−1B)λ > 0. The solution isλ = 0 independently of

Page 42: Numerical Methods for Nonsmooth Dynamical …Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics Vincent Acary, Bernard Brogliato To cite this

Hal

INR

IA s

ampl

e

1.2 Electrical Circuits with Ideal Zener Diodes 21

the sign of the scalarD−CA−1B. This can also be seen from the inclusionλ ∈−∂ψIR+((D−CA−1B)λ ), taking into account (1.6).

It is noteworthy that computing the fixed points of our circuits may be doneby solving LCPs. In dimension 1 or 2, this may be done by checking the two orfour possible cases, respectively. In higher dimensions, such enumerative proceduresbecome impossible, and specific algorithms for solving LCPs(or other kinds of CPs)have to be used. Such algorithms will be described later in Part III.

1.2 Electrical Circuits with Ideal Zener Diodes

1.2.1 The Zener Diode

Let us consider, now, a further electrical device: the idealZener diode whoseschematic symbol is depicted in Fig. 1.8a. A Zener diode is a type of diode thatpermits current to flow in the forward direction like a normaldiode, but also in thereverse direction if the voltage is larger than the rated breakdown voltage known as“Zener knee voltage” or “Zener voltage” denoted byVz > 0. The ideal characteristicbetween the currenti(t) and the voltagev(t) can be seen in Fig. 1.8b.

Let us seek an analytical representation of the current–voltage characteristic ofthe ideal Zener diode. For this we are going to use some convexanalysis tools andmake some manipulations: subdifferentiate, conjugate, invert. Let us see how thisworks, with Fig. 1.9 as a guide.

The inversion consists of expressingv(t) as a function of−i(t): this is done inFig. 1.9b. Computing the subderivative of the functionf (·) of Fig. 1.9c, one gets themultivalued mapping of Fig. 1.9b. Indeed we have

i(t)

v(t)

Fig. 1.8a.The Zener diode schematic symbol

Vz

0

i(t)

v(t)

Fig. 1.8b.The ideal characteristic of a Zener diode

Page 43: Numerical Methods for Nonsmooth Dynamical …Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics Vincent Acary, Bernard Brogliato To cite this

Hal

INR

IA s

ampl

e

22 1 Nonsmooth Dynamical Systems: Motivating Examples and Basic Concepts

invert conjugate

subdifferentiate

subdifferentiate

Vz

v(t)

−i(t)0

(b)

0

v(t)

Vz

−i(t) f ∗(z)

0 Vz

z

+∞ +∞

x0

Vzxy = f (x)

(a) (d)

(c)

Fig. 1.9.The Zener diode characteristic

f (x) =

Vzx if x > 0

0 if x < 0(1.54)

from which it follows that the subdifferential off (·) is

∂ f (x) =

Vz if x > 0

[0,Vz] if x = 0

0 if x < 0

. (1.55)

Notice that the functionf (·) is convex, proper, continuous, and that the graphs ofthe multivalued mappings of Fig. 1.9a and b are maximal monotone.Monotonicitymeans that if you pick any two points−i1 and−i2 on the abscissa of Fig. 1.9b, andthe correspondingv1 andv2, then it is always true that

〈−i1− (−i2),v1−v2〉 > 0 (1.56)

Similarly for Fig. 1.9amaximalitymeans that it is not possible to add any new branchto the graphs of these mappings, without destroying the monotonicity. This is indeedthe case for the graphs of Fig. 1.9a and b.

Page 44: Numerical Methods for Nonsmooth Dynamical …Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics Vincent Acary, Bernard Brogliato To cite this

Hal

INR

IA s

ampl

e

1.2 Electrical Circuits with Ideal Zener Diodes 23

Let us now introduce the notion of the conjugate of a convex function f (·) that isdefined as

f ∗(z) = supx∈IR

(〈x,z〉− f (x)) . (1.57)

Let us calculate the conjugate of the functionf (·) above:

f ∗(z) = supx∈IR

xz−Vzx if x > 0

xz if x < 0= supx∈IR

x(z−Vz) if x > 0

xz if x < 0

=

{

+∞ if z> Vz

0 if z6 Vz

{

0 if z> 0+∞ if z< 0

=

+∞ if z< 0 andz> Vz

0 if 0 6 z6 Vz

= ψ[0,Vz](z) ,

(1.58)

where we retrieve the indicator function that was already met when we consideredthe ideal diode, see Sect. 1.1.1.

We therefore deduce from Fig. 1.9 that

−i(t) ∈ ∂ψ[0,Vz](v(t)), whereasv(t) ∈ ∂ f (−i(t)) . (1.59)

The functionf (·) = ψ∗[0,Vz]

(·) is called in convex analysis thesupportfunction of theset[0,Vz]. It is known that the support function and the indicator function of a convexset are conjugate to one another.

We saw earlier that the subderivative of the indicator function of a convex setis also the normal cone to this convex set. Here we obtain that∂ψ[0,Vz](v(t)) is thenormal coneN[0,Vz](v(t)), that isIR− whenv(t) = 0 andIR+ whenv(t) = Vz. It is thesingleton{0} when 0< v(t) < Vz.

1.2.2 The Dynamics of a Simple Circuit

Differential Inclusions and Filippov’s Systems

Now that these calculations have been led, let us consider the dynamics of the circuitin Fig. 1.3c, where we replace the ideal diode by an ideal Zener diode. Choosing thesame state variables (x1 is the capacitor charge,x2 is the current through the circuit),we obtain:

x1(t) = x2(t)

x2(t)+RL

x2(t)+1

LCx1(t) =

1L

v(t), (1.60)

wherev(·) is the voltage of the Zener diode. We saw thatv(t) ∈ ∂ f (−i(t)), thuswe get

Page 45: Numerical Methods for Nonsmooth Dynamical …Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics Vincent Acary, Bernard Brogliato To cite this

Hal

INR

IA s

ampl

e

24 1 Nonsmooth Dynamical Systems: Motivating Examples and Basic Concepts

x1(t)−x2(t) = 0

x2(t)+RL

x2(t)+1

LCx1(t) ∈

1L

∂ f (−x2(t)), (1.61)

which is a differential inclusion.Compare the inclusions in (1.25) and in (1.61). They look quite similar, how-

ever, the sets in their right-hand sides are quite different. Indeed the set in the right-hand side of (1.25) is unbounded, whereas the set in the right-hand side of (1.61) isbounded, as it is included in[0,Vz]. More precisely, the set-valued mapping∂ f (·)is nonempty, compact, convex, upper semi-continuous, and satisfies a linear growthcondition: for allv∈ ∂ f (x) there exists constantsk anda such that‖ v‖6 k ‖ x ‖+a.

The differential inclusion (1.61) possesses an absolutelycontinuous solution, andwe may even assert here that this solution is unique for each initial condition, becausein addition the considered set-valued mapping is maximal monotone, see Lemma2.13, Theorem 2.41. This is also sometimes called a Filippov’s system or a Filippov’sDI, associated with the switching surfaceΣ = {x∈ IR2 | x2 = 0}. See Sect. 2.1 fora precise definition of Filippov’s systems. Simple calculations yield that the vectorfield in the neighborhood ofΣ is as depicted in Fig. 1.10. The surfaceΣ is crossedtransversally by the trajectories whenx1(t) < 0 andx1(t) > CVz. It is an attractingsurface whenx1(t) ∈ [0,Vz] (wheret means the time when the trajectory attainsΣ).According to Filippov’s definition of the solution,Σ is a sliding surface in the lattercase, which means thatx2(t) = 0 after the trajectory has reached this portion ofΣ.Notice that we may rewrite the second line in (1.61) as

x2(t)+RL

x2(t)+1

LCx1(t) = λ (t), λ (t) ∈ 1

L∂ f (−x2(t)) . (1.62)

Σx1

x2

0 CVz

sliding motion

Fig. 1.10.The vector field on the switching surfaceΣ

Page 46: Numerical Methods for Nonsmooth Dynamical …Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics Vincent Acary, Bernard Brogliato To cite this

Hal

INR

IA s

ampl

e

1.2 Electrical Circuits with Ideal Zener Diodes 25

Despite passing from (1.61) to (1.62) looks like wasted effort, it means that the in-clusion in (1.61) is equivalent to integrate its left-hand side by looking for an elementof the set in its right-hand side, at each time instant. This is in fact the case forall thedifferential inclusions that we shall deal with in this book. In other words the inte-gration proceeds alongΣ with an elementλ ∈ ∂ f (0) such thatλ (t) = x1(t)

C , wheretis the “entry” time of the trajectory inΣ (notice that as long asx2 = 0 thenx1 remainsconstant).

Remark 1.6.The fact that the switching surfaceΣ is attracting inx1(t) ∈ [0,Vz], isintimately linked with the maximal monotonicity of the set-valued mapping∂ f (·).This mapping is sometimes called arelay function in the systems and control com-munity (Fig. 1.11).

A First Complementarity System Formulation

Let us now seek a complementarity formulation of the multivalued mapping∂ f (·) =∂ψ∗

[0,Vz](·) whose graph is in Fig. 1.9a. Let us introduce two slack variables (or mul-

tipliers) λ1 andλ2, and the set of conditions:

0 6 λ1(t) ⊥−i(t)+ |i(t)|> 0

0 6 λ2(t) ⊥ i(t)+ |i(t)|> 0

λ1(t)+ λ2(t) = Vz

v(t) = λ2(t)

. (1.63)

1.0

−1.0 −0.5 0.0 0.5 1.0 1.5 2.0

−1.0

−0.8

−0.6

−0.4

−0.2

0.0

0.2

0.4

0.6

0.8

Fig. 1.11.Example of the vector field on the switching surfaceΣ for R= C = L = Vz = 1

Page 47: Numerical Methods for Nonsmooth Dynamical …Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics Vincent Acary, Bernard Brogliato To cite this

Hal

INR

IA s

ampl

e

26 1 Nonsmooth Dynamical Systems: Motivating Examples and Basic Concepts

Let us check by inspection that indeed (1.63) represents themapping of Fig. 1.9a.If −i(t) > 0, then−i(t)+ |i(t)| > 0, soλ1(t) = 0 andλ2(t) = Vz = v(t) (andi(t)+|i(t)| = 0). If −i(t) < 0 then i(t) + |i(t)| > 0, so λ2(t) = 0, andλ1(t) = Vz (and−i(t)+ |i(t)| = 0) andv(t) = λ2(t) = 0. Now if i(t) = 0, then one easily calculatesthat 06 λ1(t) 6 Vz, 06 λ2(t) 6 Vz. Thus 06 v(t) 6 Vz.

Thanks to the complementary formulation (1.63), the inclusion (1.61) can beformulated as a Dynamical (or Differential) Complementarity System (DCS)

x1(t) = x2(t)

x2(t)+RL

x2(t)+1

LCx1(t) =

1L

v(t)

0 6 λ1(t) ⊥−x2(t)+ |x2(t)| > 0

0 6 λ2(t) ⊥ x2(t)+ |x2(t)| > 0

λ1(t)+ λ2(t) = Vz

v(t) = λ2(t)

. (1.64)

This DCS is not an LCS due to the presence of the absolute valuefunction in thecomplementarity condition and the two last algebraic equations. We notice that thevariablesλ1(t) andλ2(t) can be eliminated from (1.64) using the last two equalities,leading to another formulation of the DCS:

x1(t) = x2(t)

x2(t)+RL

x2(t)+1

LCx1(t) =

1L

v(t)

0 6 Vz−v(t)⊥−x2(t)+ |x2(t)| > 0

0 6 v(t) ⊥ x2(t)+ |x2(t)| > 0

(1.65)

which is neither an LCS.

A Mixed Linear Complementarity Formulation

It is possible from (1.63) to obtain a so-called Mixed LinearComplementarity Sys-tem (MLCS) which is a generalization of an LCS with an additional system of linearequations. The goal is to obtain after discretization a so-called Mixed Linear Comple-mentarity Problem (MLCP) which is a generalization of an LCPwith an additionalsystem of linear equations, such that

Au+Cw+a= 0

0 6 w⊥ Du+Bw+d > 0

. (1.66)

Page 48: Numerical Methods for Nonsmooth Dynamical …Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics Vincent Acary, Bernard Brogliato To cite this

Hal

INR

IA s

ampl

e

1.2 Electrical Circuits with Ideal Zener Diodes 27

To obtain an MLCS formulation, let us introduce the positivepart and the negativepart of the currenti(t) as

i+(t) =12(i(t)+ |i(t)|) = max(0, i(t)) > 0 , (1.67)

i−(t) =12(i(t)−|i(t)|) = min(0, i(t)) 6 0 . (1.68)

The system (1.63) can be rewritten equivalently as

0 6 λ1(t) ⊥ i+(t)− i(t) > 0

0 6 λ2(t) ⊥ i+(t) > 0

i(t) = i−(t)+ i+(t)

λ1(t)+ λ2(t) = Vz

v(t) = λ2(t)

, (1.69)

where the absolute value has disappeared, but a linear equation has been added.Substitution of two of the last three equations into the complementarity conditionsleads to an intermediate complementarity formulation of the relay function as

0 6 λ1(t) ⊥ i+(t)− i(t) > 0

0 6 v(t) ⊥ i+(t) > 0

λ1(t)+v(t) = Vz

(1.70)

or as

0 6 Vz−v(t) ⊥ i+(t)− i(t) > 0

0 6 v(t) ⊥ i+(t) > 0. (1.71)

The linear dynamical system (1.60) together with one of the reformulations (1.69),(1.70), or (1.71) leads to an MLCS formulation. Nevertheless, the complete substi-tution of the equation into the complementarity condition yields a DCS

x1(t) = x2(t)

x2(t)+RL

x2(t)+1

LCx1(t) =

1L

v(t)

0 6 Vz−v(t)⊥ x+2 (t)−x2(t) > 0

0 6 v(t) ⊥ x+2 (t) > 0

, (1.72)

which is neither an LCS nor an MLCS.

Page 49: Numerical Methods for Nonsmooth Dynamical …Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics Vincent Acary, Bernard Brogliato To cite this

Hal

INR

IA s

ampl

e

28 1 Nonsmooth Dynamical Systems: Motivating Examples and Basic Concepts

A Linear Complementarity Formulation

Due to the simplicity of the equations involved in the MLCS formulation (1.71), it ispossible to find an LCS formulation of the dynamics. Indeed, the following system

x1(t) = x2(t)

x2(t)+RL

x2(t)+1

LCx1(t) =

1L

λ2(t)

x+2 (t) = x2(t)−x−2 (t)

λ1(t) = Vz−λ2(t)

0 6

(

x+2 (t)

λ1(t)

)

⊥(

λ2(t)−x−2 (t)

)

> 0

(1.73)

can be recast into the following LCS form

x(t) = Ax(t)+Bλ(t)

w(t) = Cx(t)+Dλ(t)+g

0 6 w(t) ⊥ λ (t) > 0

(1.74)

with

A =

[

0 1

− 1LC

−RL

]

,B =

[

0 01 0

]

,C =

[

0 10 0

]

,D =

[

0 1−1 0

]

,g =

[

0Vz

]

. (1.75)

The reformulation appears to be a special case for more general reformulations ofrelay systems or two-dimensional friction problems into LCS. For more details, werefer to Pfeiffer & Glocker (1996) and to Sect. 9.3.3. In the more general frameworkof ODE with discontinuous right-hand side, an LCS reformulation can be found inChap. 7.

1.2.3 Numerical Simulation by Means of Time-Stepping Schemes

In view of this preliminary material, we may consider now thetime-discretizationof our system. Clearly our objective here is still to introduce the topic, and thereader should not expect an exhaustive description of the numerical simulation of thesystem.

1.2.3.1 Explicit Time-Stepping Schemes Based on ODE with DiscontinuitiesFormulations

A forward Euler scheme may be applied on an ODE with discontinuities of the form,x= f (x, t), where the right-hand side may possess discontinuities (see Sect. 2.8). For

Page 50: Numerical Methods for Nonsmooth Dynamical …Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics Vincent Acary, Bernard Brogliato To cite this

Hal

INR

IA s

ampl

e

1.2 Electrical Circuits with Ideal Zener Diodes 29

the right-hand side of the circuit with the Zener diode, a switched model may begiven by

f (x, t) =

[

x2

−RL

x2−1

LCx1

]

for −x2 < 0 (1.76a)

[

00

]

for −x2 = 0 (1.76b)

[

x2

−RL

x2−1

LCx1−Vz

]

for −x2 > 0. (1.76c)

The simulation for this choice of the right-hand side is illustrated in Fig. 1.12. Wecan observe that some “chattering” effects due to the fact that the sliding mode givenby (1.76b) cannot be reached due to the numerical approximation onx2. This artifactresults in spurious oscillations of the diode voltagev(t) = λ (t) and the diode currentx2(t) = ω(t) as we can observe on the zoom in Fig. 1.13.

One way to circumvent the spurious oscillations is to introduce a “sliding band”,i.e., an interval where the variablex2 is small in order to approximate the slidingmode. This interval can be for instance chosen as|x2| 6 η such that the new right-hand side is given by

-0.8-0.6-0.4-0.2

0 0.2 0.4 0.6 0.8

1

-6-4-2 0 2 4 6

0 1 2 3 4 5

-6-4-2 0 2 4 6

0 1 2 3 4 5

Explicit Euler

Explicit Euler

Explicit Euler

Explicit Euler

x 1(t

)x 2

(t)

w(t

(t)

Time t

Fig. 1.12.Simulation of the RLC circuit with a Zener diode with the initial conditionsx1(0) =1,x2(0) = 1 andR = 0.1,L = 1,C = 1

(2π)2 . Explicit Euler scheme with the right-hand side

defined by (1.76). Time steph = 5×10−3

Page 51: Numerical Methods for Nonsmooth Dynamical …Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics Vincent Acary, Bernard Brogliato To cite this

Hal

INR

IA s

ampl

e

30 1 Nonsmooth Dynamical Systems: Motivating Examples and Basic Concepts

0

1

2

3

4

5

-0.04

-0.02

0

0.02

0.04

4 4.2 4.4 4.6 4.8 5

Explicit Euler

Explicit Euler

w(t

(t)

Time t

Fig. 1.13.Zoom on the “chattering” behavior simulation of the RLC circuit with a Zener diodewith the initial conditionsx1(0) = 1,x2(0) = 1 andR= 0.1,L = 1,C = 1

(2π)2 . Explicit Euler

scheme with the right-hand side defined by (1.76). Time steph = 5×10−3

f (x, t) =

[

x2

−RL

x2−1

LCx1

]

for −x2 < −η (1.77a)

[

x2

−RL

x2

]

for |x2| 6 η (1.77b)

[

x2

−RL

x2−1

LCx1−Vz

]

for −x2 > η (1.77c)

Simulation results depicted in the Figs. 1.14 and 1.15 show that the spurious oscilla-tions have been cancelled.

The switched models (1.76) and (1.77) are incomplete models. In more generalsituations they may fail due the lack of conditions for the transition from the slidingmode to the other modes. Clearly, the value of the dual variable λ (t) = v(t) has to bechecked to know if the system stays in the sliding mode. We will see in Sect. 9.3.3that all these conditional statements can be in numerous cases replaced by an LCPformulation.

It is noteworthy that the previous numerical trick is not an universal solution forthe problem of chattering. Indeed, the switched model givenby the right-hand side(1.77) allows the solution to stay near the boundary of the sliding band. The new

Page 52: Numerical Methods for Nonsmooth Dynamical …Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics Vincent Acary, Bernard Brogliato To cite this

Hal

INR

IA s

ampl

e

1.2 Electrical Circuits with Ideal Zener Diodes 31

-0.8-0.6-0.4-0.2

0 0.2 0.4 0.6 0.8

1 1.2

-6-4-2 0 2 4 6

0 1 2 3 4 5

-6-4-2 0 2 4 6

0 1 2 3 4 5

Explicit Euler

Explicit Euler

Explicit Euler

Explicit Euler

RK4

RK4

RK4

RK4

x 1(t

)x 2

(t)

w(t

(t)

Time t

Fig. 1.14.Simulation of the RLC circuit with a Zener diode with the initial conditionsx1(0) =1,x2(0) = 1 andR= 0.1,L = 1,C = 1

(2π)2 . Euler and four order Runge–Kutta explicit scheme

with the right-hand side defined by (1.77). Time steph = 5×10−3

model is still a discontinuous system and therefore some numerical instabilities ofthe ODE solver can appear. More smart approaches for the choice of the right-handside in the sliding band can be found in Karnopp (1985), Leineet al. (1998), Leine &Nijmeijer (2004) and will be described in Sect. 9.3.2.

The fact that we are able to express the Filippov’s DI as an equivalent model ofODE with a switched right-hand side allows one to use any other explicit schemessuch as explicit Runge–Kutta methods. In Figs. 1.15 and 1.16, the results of thesimulation with the right-hand side (1.76) and (1.77) are depicted. The conclusionsare the same as above. One notices also that two different methods provide differentresults (see Figs. 1.14 and 1.15). We will discuss in Sect. 9.2 the question of the orderand the stability of such a higher order method for Filippov’s DIs.

1.2.3.2 Explicit Discretization of the Differential Inclusionand the Complementarity Systems

Explicit Discretization of the Differential Inclusion (1.61)

Consider the forward Euler method

Page 53: Numerical Methods for Nonsmooth Dynamical …Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics Vincent Acary, Bernard Brogliato To cite this

Hal

INR

IA s

ampl

e

32 1 Nonsmooth Dynamical Systems: Motivating Examples and Basic Concepts

0

1

2

3

4

5

-0.04

-0.02

0

0.02

0.04

4 4.2 4.4 4.6 4.8 5

Explicit Euler

Explicit Euler

RK4

RK4

w(t

(t)

Time t

Fig. 1.15.Simulation of the RLC circuit with a Zener diode with the initial conditionsx1(0) =1,x2(0) = 1 andR= 0.1,L = 1,C = 1

(2π)2 . Euler and four order Runge–Kutta explicit scheme

with the right-hand side defined by (1.77). Time steph = 5×10−3

x1,k+1−x1,k = hx2,k

x2,k+1−x2,k +hRL

x2,k +h

LCx1,k ∈

hL

∂ f (−x2,k) ,

(1.78)

wherexk is the value, at timetk of a grid t0 < t1 < · · · < tN = T, N < +∞, h =T − t0

N= tk− tk−1, of a step functionxN(·) that approximates the analytical solution

x(·).Compare with the time-discretization of the inclusion (1.25) that is proposed in

Sect. 1.1.5. This time considering an implicit scheme is notmandatory (this mayimprove the overall quality of the numerical integration especially from the stabilitypoint of view, but is not a consequence of the dynamics contrary to what happenswith (1.25)). One of the major discrepancies with the circuit (1.25) is that the valuesof x2 are no longer constrained to stay in a set by the inclusion (1.78).

Explicit Discretization of the Complementarity Systems (1.65)

Let us investigate how the complementarity system (1.65) may be discretized. We get

Page 54: Numerical Methods for Nonsmooth Dynamical …Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics Vincent Acary, Bernard Brogliato To cite this

Hal

INR

IA s

ampl

e

1.2 Electrical Circuits with Ideal Zener Diodes 33

-0.8-0.6-0.4-0.2

0 0.2 0.4 0.6 0.8

1 1.2

-6-4-2 0 2 4 6

0 1 2 3 4 5

-6-4-2 0 2 4 6

0 1 2 3 4 5

RK4

RK4

RK4

RK4

x 1(t

)x 2

(t)

i(t)

v(t)

Time t

Fig. 1.16.Simulation of the RLC circuit with a Zener diode with the initial conditionsx1(0) =1,x2(0) = 1 andR= 0.1,L = 1,C = 1

(2π)2 . Four order Runge–Kutta explicit scheme with the

right-hand side defined by (1.76). Time steph = 5×10−3

x1,k+1−x1,k = hx2,k

x2,k+1−x2,k +hRL

x2,k +h

LCx1,k =

hL

λ2,k

0 6 Vz−λ2,k ⊥−x2,k + |x2,k| > 0

0 6 λ2,k ⊥ x2,k + |x2,k| > 0

. (1.79)

One computes that ifx2,k > 0 thenλ2,k = 0, whilex2,k < 0 impliesλ2,k = Vz. More-overx2,k = 0 implies thatλ2,k ∈ [0,Vz]. We conclude that the two schemes in (1.78)and (1.79) are the same.

However, the complementarity formalism does not bring any advantage overthe inclusion formalism, as it does not yield neither an LCP nor an MLCP, evenwith the reformulation proposed in the preceding section. The main reason for thatis not the presence of absolute values in the complementarity formalism which canbe avoided by adding an equality, but the fact thatλ2,k has to be complementary tothe positive part ofx2,k which is not an unknown at the beginning of the step.

Page 55: Numerical Methods for Nonsmooth Dynamical …Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics Vincent Acary, Bernard Brogliato To cite this

Hal

INR

IA s

ampl

e

34 1 Nonsmooth Dynamical Systems: Motivating Examples and Basic Concepts

For instance, if we choose the MLCS formulation given by the dynamicalsystem (1.60) and the formulation (1.70), we get the following complementarityproblem

x1,k+1−x1,k = hx2,k

x2,k+1−x2,k +hRL

x2,k +h

LCx1,k =

hL

λ2,k

0 6 λ1,k ⊥ x+2,k−x2,k > 0

0 6 λ2,k ⊥ x+2,k > 0

λ1,k + λ2,k = Vz

. (1.80)

In such a “fake” complementarity problem, one has to performthe procedure de-scribed in the Remark 1.7, which implies to choose a threshold on the value ofx2,k.

To conclude this part, whatever the mathematical formalismwhich is used toformulate the dynamics, explicit discretizations lead to algorithms without any sense.

Remark 1.7.One has to choose a value forλ2,k in the interval[0,Vz] whenx2,k =0. More concretely when implementing the algorithm on a computer, one has tochoose a thresholdη > 0 such thatx2,k is considered to be null when|x2,k| 6 η . Onepossibility is to choose the Filippov’s solution that makesthe trajectory slide on thesurfaceΣ = {x∈ IR2 | x2 = 0}. If x1,k 6∈ [0,CVz] we have seen that the trajectoriescross transversallyΣ. Thus the chosen value ofλ2,k is not important. Ifx1,k ∈ [0,CVz]

one may simply chooseλ2,k =x1,kC or λ2,k = − L

hx2,k + Rx2,k +x1,kC to keepx2,k+1 in

the required neighborhood ofΣ. With the solution, we have also to check the valueof the dual variablev(t) = λ2(t) to know when the application of this rule has to bestopped.

1.2.3.3 An Implicit Time-Stepping Scheme

Implicit Discretization of the Differential Inclusion (1.61)

Let us try the following implicit scheme4:

x1,k+1−x1,k = hx2,k+1

x2,k+1−x2,k +hRL

x2,k+1 +h

LCx1,k+1 ∈

hL

∂ f (−x2,k+1) .

(1.81)

After some manipulations this may be rewritten as

x1,k+1−x1,k = hx2,k+1

x2,k+1 +a(h)

[

hLC

x1,k−x2,k

]

∈ a(h)hL

∂ f (−x2,k+1) ,

(1.82)

4 The scheme chosen here is fully implicit for the sake of simplicity.

Page 56: Numerical Methods for Nonsmooth Dynamical …Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics Vincent Acary, Bernard Brogliato To cite this

Hal

INR

IA s

ampl

e

1.2 Electrical Circuits with Ideal Zener Diodes 35

wherea(h) =

(

1+hRL

+h2

LC

)−1

.

Denoting

b = a(h)

[

hLC

x1,k−x2,k

]

the second line of (1.82) may be rewritten as

x2,k+1 +b∈ a(h)hL

∂ f (−x2,k+1) . (1.83)

It is this inclusion that we are going to examine now. This will allow us to illustrategraphically why the monotonicity is a crucial property. In Fig. 1.17 the graph of thelinear function

Db ={

(λ2,k+1,x2,k+1) ∈ IR2 | λ2,k+1 = x2,k+1 +b}

is depicted for three values ofb, together with the graph of the set-valued function,

G =

{

(λ2,k+1,x2,k+1) ∈ IR2 | λ2,k+1 ∈ a(h)hL

∂ f (−x2,k+1)

}

.

It is apparent that for any value ofb, there is always a single intersection betweenthe two graphs. One concludes that the generalized equation(1.83) with unknownx2,k+1 has a unique solution, which allows one to advance the algorithm from kto k+1.

If there is an exogenous inputu(t) that acts on the system so that the dynamics ischanged to

Db

x2,k+10

sliding motion

λ2,k+1

DbDb

−b −b −b

hL a(h)Vz

Fig. 1.17.Implicit scheme: the maximal monotone case

Page 57: Numerical Methods for Nonsmooth Dynamical …Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics Vincent Acary, Bernard Brogliato To cite this

Hal

INR

IA s

ampl

e

36 1 Nonsmooth Dynamical Systems: Motivating Examples and Basic Concepts

x2(t)+RL

x2(t)+1

LCx1(t)+

u(t)L

∈ 1L

∂ f (−x2(t)) (1.84)

then the variableb is changed tob+a(h)uk

L. Varyinguk+1 corresponds to a horizontal

translations of the straight lines in Fig. 1.17.

Remark 1.8 (A nonmonotone example).Suppose now that the dynamics is

x2,k+1 +b∈ −a(h)hL

∂ f (−x2,k+1) . (1.85)

We know this is not possible with the circuit we are studying.For the sake of thereasoning we are leading let us imagine this is the case. Thenwe get the situationdepicted in Fig. 1.18. There exist values ofb for which the generalized equation hastwo or three solutions. Uniqueness is lost.

Remark 1.9 (Comparison with the procedure in Remark 1.7).Coming back toFig. 1.17, one sees that the values ofb that yield a sliding motion along the surfaceΣ, correspond to all the values such that the graph of the linear function intersectsthe vertical segment of the graph of the multifunction. Contrarily to what happenswith the explicit scheme where a threshold has to be introduced, “detecting” the slid-ing motion is now the result of a resolution of the intersection problem. No artificialthreshold is needed due to the fact that we have to verify the inclusion of a value intoa set of nonempty interior.

Implicit Discretization of the Complementarity Systems

Let us choose one of the LCS formulations described in the previous section givenby the dynamics (1.73). An implicit time-discretization isgiven by

λ2,k+1

x2,k+1

0−b −b

− hL a(h)Vz

−b

DbDb Db

Fig. 1.18.Implicit scheme: the nonmonotone case

Page 58: Numerical Methods for Nonsmooth Dynamical …Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics Vincent Acary, Bernard Brogliato To cite this

Hal

INR

IA s

ampl

e

1.2 Electrical Circuits with Ideal Zener Diodes 37

x1,k+1−x1,k = hx2,k+1

x2,k+1−x2,k +hRL

x2,k+1 +h

LCx1,k+1 =

hL

λ2,k+1

x+2,k+1 = x2,k+1−x−2,k+1

λ1,k+1 = Vz−λ2,k+1

0 6

(

x+2,k+1

λ1,k+1

)

⊥(

λ2,k+1

−x−2,k+1

)

> 0

. (1.86)

Using the previous notations fora(h) andb, we get the following system

x1,k+1−x1,k = hx2,k+1

x2,k+1 +b = a(h)hL

λ2,k+1

x+2,k+1 = x2,k+1−x−2,k+1

λ1,k+1 = Vz−λ2,k+1

0 6

(

x+2,k+1

λ1,k+1

)

⊥(

λ2,k+1

−x−2,k+1

)

> 0

. (1.87)

The value ofλ2,k+1 is obtained at each time step by the following LCP

w =

a(h)hL

1

−1 0

z+

[

−b

Vz

]

0 6 w⊥ z> 0

(1.88)

with w = [x+2,k+1 ,λ1,k+1]

T and z = [λ2,k+1 ,x−2,k+1]T. We see in this case that the

interest of the LCS formulation is to open the door to LCP solvers instead of havingto check the modes.

Simulation Results

The simulation results are presented in Fig. 1.19. We can notice that the spuriousoscillations in Figs. 1.12, 1.13 and 1.16 have disappeared due to the fact that thesliding is correctly modeled with the implicit approach.

1.2.3.4 Convergence Properties

Consider the explicit Euler scheme in (1.78). Then there exists a subsequence of thesequence{xn(·)}n that converges uniformly asn→+∞ to some (the) solution of the

Page 59: Numerical Methods for Nonsmooth Dynamical …Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics Vincent Acary, Bernard Brogliato To cite this

Hal

INR

IA s

ampl

e

38 1 Nonsmooth Dynamical Systems: Motivating Examples and Basic Concepts

-0.8-0.6-0.4-0.2

0 0.2 0.4 0.6 0.8

1 1.2

-6-5-4-3-2-1 0 1 2 3 4 5

0 1 2 3 4 5

-5-4-3-2-1 0 1 2 3 4 5 6

0 1 2 3 4 5

Explicit Euler

Explicit Euler

Explicit Euler

Explicit Euler

x 1(t

)x 2

(t)

i(t)

v(t)

Time t

Fig. 1.19. Simulation of the RLC circuit with a Zener diode with the initial conditions

x1(0) = 1,x2(0) = 1 and R = 0.1,L = 1,C =1

(2π)2 . Implicit Euler scheme. Time step

h = 5×10−3

inclusion in (1.78). This is a consequence of Theorem 9.5. A similar result appliesto the implicit scheme in (1.81), considered as a particularcase of a linear multistepalgorithm.

More details will be given in Chap. 9 on one-step and multistep time-steppingmethods for differential inclusion with absolutely continuous solutions such asFilippov’s DI. When uniqueness of solutions holds, more canbe said on the con-vergence of the scheme, see Theorems 9.8, 9.9 and 9.11.

1.2.4 Numerical Simulation by Means of Event-Driven Schemes

The Filippov’s DI (1.61) may also be simulated by means ofevent-driven schemes.We recall that the event-driven approach is based on a time integration of an ODE ora DAE between two nonsmoothevents. At events, if the evolution of the system isnonsmooth, then a reinitialization is applied. From the numerical point of view, thetime integration on smooth phases is performed by any standard one-step or multi-step ODE or DAE solvers. This approach needs an accurate location of the events intime which is based on some root-finding procedure.

Page 60: Numerical Methods for Nonsmooth Dynamical …Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics Vincent Acary, Bernard Brogliato To cite this

Hal

INR

IA s

ampl

e

1.2 Electrical Circuits with Ideal Zener Diodes 39

In order to illustrate a little bit more what can be an event-driven approach fora Filippov’s differential inclusion with an exogenous signal u(t), we introduce thenotion ofmodes, where the system evolves smoothly. Three modes can be defined asfollows,

mode− :

x1(t) = x2(t)

x2(t)+RL

x2(t)+1

LCx1(t)+

u(t)L

= 0if x2 ∈ I− ,

mode 0 :

x1(t) = 0

x2(t) = 0if x2 ∈ I0 ,

mode+ :

x1(t) = x2(t)

x2(t)+RL

x2(t)+1

LCx1(t)+

u(t)L

= Vz

if x2 ∈ I+ ,

(1.89)

respectively associated with the three sets,

I−(t) = {i ∈ IR | i < 0}

I0(t) = {i ∈ IR | i = 0}

I+(t) = {i ∈ IR | i > 0}

. (1.90)

In each mode, the dynamical system is represented by an ODE that can be integratedby any ODE solver. The transition between two modes is activated when the sign ofa guard function changes, i.e., when an event is detected.

For the modes, “−” and “+”, it suffices to check that the sign ofi is changingto detect an event. A naive approach is to check when the variable x2 is crossing athresholdε > 0 sufficiently small. This naive approach may lead to numerical trou-bles, such as chattering due to the possible drift from the constraintx2 = 0 in themode when we integrate ˙x2(t) = 0. To avoid this artifact, it is better to check theguard functionsv(t) andVz−v, which are dual to the currentx+

2 andx−2 in the com-plementarity formalism, see (1.71) withx2 = i. We will see in Chap. 7 that consider-ing a complementarity formulation, or more generally, a formulation that exhibits aduality leads to powerful event-driven schemes.

Once the event is detected, a mode transition has to be performed to provide thetime integrator with the new next mode. The operation is madeby inspecting thesign of x2(t) at the event by solving for instance the inclusion. We will see also inChap. 7 that a good manner to perform this task is to relay the mode transition ontoa CP resolution.

Page 61: Numerical Methods for Nonsmooth Dynamical …Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics Vincent Acary, Bernard Brogliato To cite this

Hal

INR

IA s

ampl

e

40 1 Nonsmooth Dynamical Systems: Motivating Examples and Basic Concepts

1.2.5 Conclusions

The message of Sects. 1.2.3 and 1.2.4 is the following: explicit schemes, when ap-plied to Filippov’s systems like (1.60), yield poor results. One should prefer implicitschemes. More details on the properties of various methods are provided in Chap.9. The picture is similar for event-driven algorithms, where one has to be carefulwith the choice of the variable to check mode transitions. Mode transitions shouldpreferably be steered by the multiplierλ rather than by the statex(·). In mechan-ics with Coulomb friction, this is equivalent to decide between sticking and sliding,watching whether or not the contact force lies strictly inside the friction cone or onits boundary. For Filippov’s inclusion Stewart’s method isdescribed in Sect. 7.1.2.

1.3 Mechanical Systems with Coulomb Friction

In this section we treat the case of a one-degree-of-freedommechanical system sub-ject to Coulomb friction with a bilateral constraint and a constant normal force, asdepicted in Fig. 1.20. Its dynamics is given by

mq(t)+ f (t) ∈ −mgµ sgn(q(t)) , (1.91)

whereq(·) is the position of the mass,f (·) is some force acting on the mass,g is thegravity,µ > 0 is the friction coefficient. The sign multifunction is defined as

sgn(x) =

1 if x > 0[−1,1] if x = 0−1 if x < 0

. (1.92)

In view of the foregoing developments one deduces that

sgn(x) = ∂ |x| , (1.93)

i.e., the subdifferential of the absolute value function. It is easy to see that this systemis quite similar to the circuit with an ideal Zener diode in (1.61). It can also beexpressed using a complementarity formalism as follows:

����������������������������������������������������������������������������������������������������

����������������������������������������������������������������������������������������������������

g

0

f (t)

q

m

Fig. 1.20.A one-degree-of-freedom mechanical system with Coulomb friction

Page 62: Numerical Methods for Nonsmooth Dynamical …Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics Vincent Acary, Bernard Brogliato To cite this

Hal

INR

IA s

ampl

e

1.4 Mechanical Systems with Impacts: The Bouncing Ball Paradigm 41

0 6 λ1 ⊥−x+ |x|> 0

0 6 λ2 ⊥ x+ |x| > 0

λ1 + λ2 = 2

sgn(x) =λ1−λ2

2

(1.94)

which is quite similar to the set of relations in (1.63). Consequently what has beendone for the Zener diode can be redone for such a simple systemwith Coulombfriction, which is a Filippov’s DI.

Similarly to the Zener circuit, the one-degree-of-freedommechanical systemwith Coulomb friction can be formulated as an LCS, introducing the positive andthe negative parts of the velocity:

q(t) = v(t)

mv(t)+ f (t) = −λ (t) =12(λ2(t)+ λ1(t))

v+(t) = v(t)−v−(t)

λ1(t) = 2mgµ −λ2(t)

0 6

(

λ1(t)v+(t)

)

⊥(

−v−(t)λ2(t)

)

> 0

. (1.95)

1.4 Mechanical Systems with Impacts: The Bouncing BallParadigm

In this section some new notions are used, which are all defined later in the book.

1.4.1 The Dynamics

Let us write down the dynamics of a ball with massm, subjected to gravity and to aunilateral constraint on its position, depicted in Fig. 1.21:

mq(t)+ f (t) = −mg+ λ

0 6 q(t) ⊥ λ > 0

q(t+) = −eq(t−) if q(t) = 0 andq(t−) 6 0

q(0) = q0 > 0, q(0−) = q0

. (1.96)

Page 63: Numerical Methods for Nonsmooth Dynamical …Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics Vincent Acary, Bernard Brogliato To cite this

Hal

INR

IA s

ampl

e

42 1 Nonsmooth Dynamical Systems: Motivating Examples and Basic Concepts

f (t)

q

m

q

0

Fig. 1.21.The one-dimensional bouncing ball

The variableλ is a Lagrange multiplier that represents the contact force:it has toremain nonnegative. The complementarity condition between q(t) andλ implies thatwhenq(t)> 0 thenλ = 0, whileλ > 0 is possible only ifq(t)= 0. This is a particularcontact model which excludes effects like magnetism (nonzero contact force withq(t) > 0) or gluing (negative contact force). This relationship betweenq andλ is aset-valued function whose graph is as in Fig. 1.1b. The thirdingredient in (1.96) isan impact law, which reinitializes the velocity when the trajectory tends to violatethe inequality constraint.

Let us analyze the dynamics (1.96) on phases of smooth motion, i.e., eitherq(t) > 0 orq(t) = 0 for all t ∈ [a,b], for some 06 a < b. As seen above the comple-mentarity condition implies thatλ (t) = 0 in the first case. In the second case it allowsfor λ (t) > 0. Let us investigate how the multiplier may be calculated, employing areasoning similar to the one in Sect. 1.1.5 to get the LCP in (1.24). On[a,b) one hasq(t) = 0 andq(t) = 0. So a necessary condition for the inequality constraint not tobe violated in a right neighborhood ofb is thatq(t+) > 0 on [a, b].

Actually as shown by Glocker (2001, Chap. 7) it is possible toreformulate thecontact force law in (1.96), i.e.,

−λ (t) ∈ ∂ψIR+(q(t)) ⇔ 0 6 λ (t) ⊥ q(t) > 0 (1.97)

(compare with (1.1), (1.6), (1.7)) at the acceleration level as follows:

−λ (t+) ∈

0 if q(t) > 0

0 if q(t) = 0 andq(t+) > 0

0 if q(t) = 0 if q(t+) = 0 andq(t+) > 0

[−∞,0] if q(t) = 0 if q(t+) = 0 andq(t+) = 0

. (1.98)

Page 64: Numerical Methods for Nonsmooth Dynamical …Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics Vincent Acary, Bernard Brogliato To cite this

Hal

INR

IA s

ampl

e

1.4 Mechanical Systems with Impacts: The Bouncing Ball Paradigm 43

All the functions are expressed as their right limits, sincegiven the state of the systemat some instant of time, one is interested to know what happens in the very near futureof this time.

Let us now focus on the calculation ofλ (t+) in the latter case. Using the dynam-ics one has

mq(t+)+ f (t+) = −mg+ λ (t+) . (1.99)

From the third and fourth lines of (1.98) we deduce that

0 6 q(t+) ⊥ λ (t+) > 0 if q(t) = 0 and q(t+) = 0

λ (t+) = 0 if (q(t), q(t+)) > 0. (1.100)

where the lexicographical inequality means that the first non zero element has to bepositive. Inserting (1.99) into the first line of (1.100) yields

0 6 − 1m

f (t+)−g+1m

λ (t+) ⊥ λ (t+) > 0 (1.101)

which is an LCP with unknownλ (t+). We therefore have derived an LCP allowing usto compute the multiplier. However, this time two differentiations have been needed,when only one differentiation was sufficient to get (1.24).

Remark 1.10.One can rewrite (1.100) as

−λ (t+) ∈ ∂ψIR+(q(t+)) if q(t) = 0 and q(t+) = 0

λ (t+) = 0 if (q(t), q(t+)) > 0. (1.102)

Similarly a contact force law at the velocity level can be written as

−λ (t+) ∈ ∂ψIR+(q(t+)) if q(t) = 0

λ (t+) = 0 if q(t) > 0. (1.103)

Such various formulations of the contact law strongly rely on Glocker’s PropositionC.8 in Appendix C. Notice that inserting (1.97) into (1.96) allows us to express thefirst and second lines of (1.96) as an inclusion in the cone∂ψIR+(q(t))

To complete this remark, the whole system (1.103) can be rewritten as a singleinclusion as

−λ (t+) ∈ ∂ψTIR+ (q(t))

(

q(t+))

, (1.104)

whereTIR+(q(t)) is the tangent cone toIR+ at q(t): it is equal toIR if q(t) > 0, andequal toIR+ if q(t) 6 0. In the same way the whole system (1.102) can be rewritten as

−λ (t+) ∈ ∂ψTTIR+ (q(t))(q(t+))

(

q(t+))

, (1.105)

whereTTIR+ (q(t))(q(t+)) is the tangent cone at ˙q(t+) to the tangent cone atq(t) to IR+.We will see again such cones in Sect. 5.4.2, for higher order systems.

Page 65: Numerical Methods for Nonsmooth Dynamical …Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics Vincent Acary, Bernard Brogliato To cite this

Hal

INR

IA s

ampl

e

44 1 Nonsmooth Dynamical Systems: Motivating Examples and Basic Concepts

1.4.2 A Measure Differential Inclusion

Suppose that the velocity is a function of local bounded variation (LBV). This im-plies that the discontinuity instants are countable, and that for anyt > 0 there existsanε > 0 such that on(t, t + ε) the velocity is smooth. This also implies that at jumpinstants the acceleration is a Dirac measure. In fact, the acceleration is theStieltjesmeasure, or thedifferential measureof the velocity (see Definition C.4).

If we assume that the positionq(·) is an Absolutely Continuous (AC) function,we may say that the velocity is equal to some Lebesgue integrable and LBV functionv(·) such that

q(t) = q(0)+

∫ t

0v(s)ds . (1.106)

We denote the acceleration as the differential measure dv associated withv(·).With this material in mind, let us rewrite the system (1.96) as the following DI

involving measures:

−mdv− f (t)dt−mgdt ∈ ∂ψTIR+ (q(t))

(

v(t+)+ev(t−)

1+e

)

. (1.107)

We recall thatTIR+(q(t)) is the tangent cone toIR+ at q(t). Therefore the right-handside of the inclusion in (1.107) is the normal cone to the tangent coneTIR+(q(t)),

calculated at the “averaged” velocityv(t+)+ev(t−)

1+e, wherev(t+) is the right limit

of v(·) at t, andv(t−) is the left limit.Let us check that (1.96) and (1.107) represent the same dynamics. On an interval

(t, t + ε) on which the solution is smooth (infinitely differentiable)then

v(t) = q(t), dv = q(t)dt,v(t+)+ev(t−)

1+e= q(t) . (1.108)

Thus we obtain−mq(t)− f (t)−mg∈ ∂ψTIR+ (q(t))(q(t)) . (1.109)

We considered intervals of time on which no impact occur, i.e., eitherq(t) > 0 (freemotion) or q(t) = 0 (constrained motion). In the first caseTIR+(q(t)) = IR so that∂ψTIR+ (q(t))(q(t)) = {0}. In the second caseTIR+(q(t)) = IR+. The right-hand side istherefore equal to the normal cone∂ψIR+(q(t)). So if q(t) = 0 we get∂ψIR+(0) = IR−.If q(t) > 0 we get∂ψIR+(q(t)) = {0}. In other words either the velocity is tangentialto the constraint (in this simple case zero) and we get the inclusion−mq(t)− f (t)−mg∈ IR−, or the velocity points inside the admissible domain and−mq(t)− f (t)−mg= 0. One may see the cone in the right-hand side of (1.107) as a way to representin one shot the contact force law both at the position and the velocity levels.

Let us now consider an impact timet. Then dv = (v(t+)− v(t−))δt . Since theLebesgue measure has no atoms, the terms− f (t)dt −mgdt disappear and we get

−m(v(t+)−v(t−)) ∈ ∂ψIR+

(

v(t+)+ev(t−)

1+e

)

. (1.110)

Page 66: Numerical Methods for Nonsmooth Dynamical …Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics Vincent Acary, Bernard Brogliato To cite this

Hal

INR

IA s

ampl

e

1.4 Mechanical Systems with Impacts: The Bouncing Ball Paradigm 45

The fact that the inclusion of the measuremdv into a cone can be written as in (1.110)is proved rigorously in Monteiro Marques (1993) and Acary etal. (in press). Sincethe right-hand side is a cone we can simplify them and we finally obtain

−v(t+)+ev(t−)

1+e+v(t−) ∈ ∂ψIR+

(

v(t+)+ev(t−)

1+e

)

. (1.111)

Now using (1.36) and the fact thatv(t−) 6 0 it follows thatv(t+)+ev(t−) = 0, whichis the impact rule in (1.96).

The measure differential inclusion in (1.107) therefore encompasses all thephases of motion in one compact formulation. It is a particular case of the so-calledMoreau’s sweeping process.

1.4.3 Hints on the Numerical Simulation of the Bouncing Ball

Let us provide now some insights on the consequences of the dynamics in (1.96) andin (1.107) in terms of numerical algorithms.

1.4.3.1 Event-Driven Schemes

One notices that (1.96) contains in its intrinsic formulation some kind of conditionalstatements (“if...then” test procedure). Such a formalismis close to event-drivenschemes. Therefore, we may name it an event-driven-like formalism. Two smoothdynamical modes can be defined from the dynamics in (1.96):

Mode 1 “free flight”:

mq(t+)+ f (t) = −mg

λ = 0if (q(t), q(t+)) > 0

Mode 2 “contact”:

mq(t+)+ f (t) = −mg+ λ

0 6 q(t+) ⊥ λ > 0if q(t) = 0, q(t+) = 0

.

The sketch of the time integration is as follows:

0. Given the initial data,q0 q0, apply the impact rule if necessary (q0 = 0 andq0 < 0).

1. Determine the next smooth dynamical mode.2. Integrate the mode with a suitable ODE or a DAE solver untilthe constraint is

violated.3. Make an accurate detection/localization of the impact sothat the order is

preserved.4. Apply the impact rule if necessary and go back to the step 1.

Page 67: Numerical Methods for Nonsmooth Dynamical …Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics Vincent Acary, Bernard Brogliato To cite this

Hal

INR

IA s

ampl

e

46 1 Nonsmooth Dynamical Systems: Motivating Examples and Basic Concepts

In the implementation of this algorithm, three issues have to be solved:

• The time integration of the smooth dynamical modes. In our simple example, themode “free flight” is a simple ODE which can be solved by any ODEsolver. Themode “contact” needs the computation of the Lagrange multiplier. This can bedone by solvingλ assuming ¨q(t) = 0 and then integrating an ODE or integratingthe free flight under the constraints ¨q(t) = 0 with a DAE solver.

• The localization of the event. The event detection in the mode “free flight” isgiven by inspecting the sign ofq(·). In the mode “contact”, this can be doneefficiently by inspecting the sign of the Lagrange multiplier λ . All these eventdetection procedures are implemented with root-finding procedures.

• The mode transition procedure. After an event has been detected, the next smoothdynamical mode has to be selected. For that, the sign of the right limit of theacceleration and the Lagrange multiplierλ has to be inspected.

The problem one will face when implementing such an event-driven scheme is thatthe algorithm stops if there is an accumulation of events (here the impacts). Thisis the case for the bouncing ball in (1.96) whenf (·) = 0 and 06 e < 1. How togo “through” the accumulation point? One needs to know what happens after theaccumulation, an information which usually is unavailable.

It may be concluded that event-driven algorithms are suitable if there are not toomany impacts, and that in such a case an accurate detection/localization of the eventsmay assure an orderp> 2 and a good precision during the smooth phases of motion.We had already reached such conclusions in Sect. 1.1.4.

1.4.3.2 Moreau’s Time-Stepping Scheme

Let us now turn our attention to the sweeping process in (1.107):

−mdv− f (t)dt−mgdt = dλ

dλ ∈ ∂ψTIR+ (q(t))

(

v(t+)+ev(t−)

1+e

)

.

(1.112)

The time integration on a time interval(tk,tk+1] of the first line of this dynamics canbe written as

(tk,tk+1]mdv+

∫ tk+1

tkf (t)+mgdt = −dλ ((tk,tk+1]) . (1.113)

Using the definition of a differential measure, we get

m(v(t+k+1)−v(t+k ))+

∫ tk+1

tkf (t)+mgdt = −dλ ((tk,tk+1]) . (1.114)

Let us adopt the convention that

vk+1 ≈ v(t+k+1) (1.115)

Page 68: Numerical Methods for Nonsmooth Dynamical …Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics Vincent Acary, Bernard Brogliato To cite this

Hal

INR

IA s

ampl

e

1.4 Mechanical Systems with Impacts: The Bouncing Ball Paradigm 47

andµk+1 ≈ dλ ((tk,tk+1]) , (1.116)

that is, the right limit of the velocityv(t+k+1) is approximated byvk+1, and the measureof the interval(tk, tk+1] by dλ is approximated byµk+1. Let us propose the follow-ing implicit scheme, which we may call the discrete-time Moreau’s second-ordersweeping process:

qk+1−qk = hvk+1

m(vk+1−vk)+h( fk+1+mg) = −µk+1

µk+1 ∈ ∂ψTIR+ (qk)

(

vk+1 +evk

1+e

)

. (1.117)

After some manipulations (1.117) is rewritten as

qk+1−qk = hvk+1

vk+1 = −evk +(1+e)prox[TIR+(qk);−bk]

bk = −vk +h

m(1+e)fk+1 +

hg1+e

. (1.118)

Though it looks like that, such a scheme isnotan implicit Euler scheme. The reasonswhy have already been detailed in the context of the electrical circuit (c) in Sect. 1.1.6and are recalled here:

• First of all notice that the time steph > 0 does not appear in the right-hand sideof (1.117). Indeed the set

∂ψTIR+ (qk)

(

vk+1 +evk

1+e

)

is a cone, whose value does not change when pre-multiplied bya positiveconstant.

• Secondly, notice that the termsh fk+1 + hmgdo not represent forces, but forcestimes one integration intervalh, i.e., an impulse. This is the copy of (1.107) in thediscrete-time setting. As alluded to above, the dynamics (1.107) is an inclusion ofmeasures. In other words,mg is a force, and it may be interpreted as the densityof the measuremgdt. The integral ofmgdt over some time interval is in turnan impulse. As a consequence, the elementµk+1 inside the normal cone in theright-hand side of (1.117) is the approximation of the impulse calculated overan interval(tk, tk+1], as the equation (1.116) confirmed. It is always aboundedquantity, even at an impact time.

From a numerical point of view, two major lessons can be learned from this work.First, the various terms manipulated by the numerical algorithm are of finite values.The use of differential measures of the time interval(tk,tk+1], i.e., dv((tk,tk+1]) =

Page 69: Numerical Methods for Nonsmooth Dynamical …Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics Vincent Acary, Bernard Brogliato To cite this

Hal

INR

IA s

ampl

e

48 1 Nonsmooth Dynamical Systems: Motivating Examples and Basic Concepts

v(t+k+1)−v(t+k ) andµk+1 = dλ ((tk,tk+1]), is fundamental and allows a rigorous treat-ment of the nonsmooth evolutions. When the time steph > 0 converges to zero, itenables one to deal with finite jumps. When the evolution is smooth, the scheme isequivalent to a backward Euler scheme. We can remark that nowhere an approxima-tion of the acceleration is used. Secondly, the inclusion interms of velocity allowsus to treat the displacement as a secondary variable. A viability lemma ensures thatthe constraints onq(·) will be respected at convergence. We will see further that thisformulation gives more stability to the scheme.

These remarks might be viewed only as some numerical tricks.In fact, the math-ematical study of the second-order MDI by Moreau provides a sound mathematicalground to this numerical scheme.

1.4.3.3 Simulation of the Bouncing Ball

Let us now provide some numerical results when the time-stepping scheme is ap-plied. They will illustrate some of its properties. In Fig. 1.22, the position, the veloc-ity, and the impulse are depicted. We can observe that the accumulation of impact isapproximated without difficulties. The crucial fact that there is no detection of theimpact times allows one to pass over the accumulation time. The resulting impulseafter the accumulation corresponds to the time integrationover a time step of theweight of the ball.

In Fig. 1.23, the energy balance is drawn. We can observe thatthe total energyis only dissipated at impact. This property is due to the factthat the external forcesare constant and therefore, the integration of the free flight is exact. We will seelater in the book that these property is retrieved in most general cases by the use ofenergy-conserving schemes based onθ -methods.

1.4.3.4 Convergence Properties of Moreau’s Time-SteppingAlgorithm

The convergence of Moreau’s time-stepping scheme has been shown in MonteiroMarques (1993), Mabrouk (1998), Stewart (1998), and Dzonou& Monteiro Mar-ques (2007) under various assumptions. Various other ways to discretize such mea-sure differential inclusions with time-stepping algorithms exist together with conver-gence results. They will be described later in the book.

1.4.3.5 Analogy with the Electrical Circuit

Let us consider again the electrical circuit discrete-timedynamics in (1.34), wherewe change the notation asx1,k = qk andx2,k = vk:

qk+1−qk = hvk+1

vk+1−vk +hRL

vk+1 +h

LCqk+1 ∈−∂ψIR−(vk+1)

. (1.119)

Page 70: Numerical Methods for Nonsmooth Dynamical …Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics Vincent Acary, Bernard Brogliato To cite this

Hal

INR

IA s

ampl

e

1.4 Mechanical Systems with Impacts: The Bouncing Ball Paradigm 49

-0.2

0

0.2

0.4

0.6

0.8

1

0 1 2 3 4 5

q

tt

position

(a) position of the ball vs. time.

-5

-4

-3

-2

-1

0

1

2

3

4

0 1 2 3 4 5

v

tt

velocity

(b) velocity of the ball vs. time.

0

1

2

3

4

5

6

7

8

9

0 1 2 3 4 5

lam

bda

tt

impulse

(c) impulse vs. time.

Fig. 1.22.Simulation of the bouncing Ball. Moreau’s time-stepping scheme. Time steph =5×10−3

Page 71: Numerical Methods for Nonsmooth Dynamical …Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics Vincent Acary, Bernard Brogliato To cite this

Hal

INR

IA s

ampl

e

50 1 Nonsmooth Dynamical Systems: Motivating Examples and Basic Concepts

-2

0

2

4

6

8

10

0 1 2 3 4 5

ener

gy

tt

Kinetic EnergyPotential Energy

Total Energy

Fig. 1.23.Simulation of the bouncing ball. Moreau’s time-stepping scheme. Time steph =5×10−3. Energy vs. time

Let us now consider that the termf (t) = a1v(t)+a2q(t) for some positive constantsa1 anda2, and let us takee= 0. Then the discretization in (1.117) becomes

qk+1−qk = hvk+1

vk+1−vk +ha1

mvk+1 +

ha2

mqk+1 +hg∈ −∂ψTIR+ (qk)(vk+1)

. (1.120)

One concludes that the only difference between both discretizations (1.119) and(1.120) is that the tangent coneTIR+(qk) in mechanics is changed to the setIR− in elec-tricity. This is a simplification, as the tangent cone “switches” betweenIR andIR+.

With this in mind we may rely on several results to prove the convergence prop-erties of the schemes in (1.119) and (1.120). Convergence results for dissipative elec-trical circuits may be found in Sect. 9.5.

1.5 Stiff ODEs, Explicit and Implicit Methods,and the Sweeping Process

The bouncing ball dynamics in (1.96) may be considered as thelimit when the stiff-nessk → +∞ of a compliant problem in which the unilateral constraint isreplacedby a spring (a penalization) withk > 0. It is known that the discretization of a pe-nalized system may lead to stiff systems whenk is too large, see e.g. Sect. VII.7 inHairer et al. (1993). Explicit schemes fail and implicit schemes have to be appliedto stiff problems, however, their efficiency may decrease significantly when the re-quired tolerance is small because of possible oscillationswith high frequency leadingto small step sizes (Hairer et al., 1993, p. 541). Clearly, the rigid body modeling that

Page 72: Numerical Methods for Nonsmooth Dynamical …Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics Vincent Acary, Bernard Brogliato To cite this

Hal

INR

IA s

ampl

e

1.5 Stiff ODEs, Explicit and Implicit Methods, and the Sweeping Process 51

yields a complementarity formalism and a discretization ofthe sweeping process viaMoreau’s time-stepping algorithm may then be of great help.

Let us illustrate this on an even simpler example. A massm = 1 colliding amassless spring-dashpot, whose dynamics is

q(t) = u(t)+

−kq(t)−dq(t) if q(t) > 0

0 if q(t) 6 0(1.121)

The limit ask→ +∞ is the relative degree two complementarity system

q(t) = u(t)+ λ

0 6 λ ⊥ q(t) > 0

q(t+) = −eq(t−) if q(t) = 0 andq(t−) < 0

(1.122)

1.5.1 Discretization of the Penalized System

An explicit discretization of (1.121) yields during the contact phases of motion5:

qi+1− qi

h= −kqi −dqi +ui+1

qi+1−qi

h= qi

⇔(

qi+1

qi+1

)

=

(

1 h−hk 1−hd

)(

qi

qi

)

+

(

0h

)

ui+1

(1.123)

The eigenvaluesγ1 and γ2 of

(

1 h−hk 1−hd

)

have a modulus equal to

12

(2−hd)2+h2(4k−d2). The condition for the modulus to be< 1 is h <dk .

Therefore, ifk is too large then the explicit Euler method is unstable, the systemis stiff. Let us now try a fully implicit Euler method. In order to simplify the calcula-tions, we considerd = 0, i.e. the system is conservative. One obtains

qi+1− qi

h=−kqi+1+ui+1

qi+1−qi

h= qi+1

⇔(

qi+1

qi+1

)

=a(h,k)

(

1 h−hk 1

)(

qi

qi

)

+ha(h,k)

(

h1

)

ui+1

(1.124)

with a(h,k) = (1+h2k)−1. This problem is no longer stiff since the modulus of theeigenvalues in this time is equal to 1 (in cased > 0 we would obtain a modulussmaller than 1 for anyh > 0). However, the ratio of the imaginary and the real partof the eignevalues ish

√k, indicating indeed possible high-frequency oscillations.

5 The discretization is written withi instead ofk to avoid confusion between the stiffness andthe number of steps.

Page 73: Numerical Methods for Nonsmooth Dynamical …Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics Vincent Acary, Bernard Brogliato To cite this

Hal

INR

IA s

ampl

e

52 1 Nonsmooth Dynamical Systems: Motivating Examples and Basic Concepts

1.5.2 The Switching Conditions

We have not discussed yet about the switching condition between the free and thecontact motions. Let us rewrite the system (1.121) withd = 0 as

q(t) = u(t)−max(kq(t),0) (1.125)

This is easily shown to be equivalent to the relative degree zero complementaritysystem

q(t) = u(t)−λ (t)

0 6 λ (t) ⊥ λ (t)−kq(t) > 0(1.126)

whose implicit Euler discretization is

qi+1− qi = hui+1−hλi+1

qi+1−qi = hqi+1

0 6 λi+1 ⊥ λi+1−kqi+1 > 0

(1.127)

which after few manipulations becomes the LCP

0 6 λi+1 ⊥ (1+h2k)λi+1−khqi −kh2ui+1−kqi > 0 (1.128)

that is easily solved forλi+1 and permits to advance the method from stepi to stepi + 1. With the switching conditionqi+1 > 0 or qi+1 6 0, one retrieves the implicitmethod (1.124). If the complementarity relation is taken as06 λi+1 ⊥ λi+1−kqi > 0andqi+1−qi = hqi , one recovers the explicit method with a switching condition qi >

0 or qi 6 0. We conclude that the complementarity formulation of (1.121) allows usto clarify the choice of the switching variable and of the manner to compute the newstatevia an LCP, but does not bring any novelty concerning the stiff/nonstiff issue.One also notes that the explicit method for (1.125) yields again (1.123). Therefore,applying an explicit Euler method to (1.121), (1.125), or (1.126) is equivalent. Theimplicit discretization of (1.125), i.e. ˙qi+1 = qi + hui+1−hmax(kqi + khqi+1,0), isobviously also equivalent to (1.127). But its direct solving without resorting to theLCP in (1.128) is not quite clear. One may say that the CP formalism is a way toimplicitly discretize the projection.

All these comments apply to the circuits(a) and (b) in (1.11) (1.12), and thevarious formulations in (1.15) through (1.22).

Remark 1.11.Without the complementarity interpretation in (1.126) that yields theLCP (1.128), one may encounter difficulties in implementingthe switching withqi+1 andqi+1 − qi = hqi+1, because the system is a piecewise linear system withan implicit switching condition. Consequently, one often chooses an implicit methodwith an explicit switching variableqi+1 − qi = hqi. This boils down to a semi ex-plicit/implicit method which also yields a stiff system.

Page 74: Numerical Methods for Nonsmooth Dynamical …Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics Vincent Acary, Bernard Brogliato To cite this

Hal

INR

IA s

ampl

e

1.6 Summary of the Main Ideas 53

1.5.3 Discretization of the Relative Degree Two Complementarity System

Moreau’s time stepping method for (1.122) is

qi+1+eqi1+e = prox[TIR+(qi+1); qi +

h1+eu(ti+1)]

qi+1 = qi +hqi

(1.129)

which is nothing else but solving a simple LCP (or a QP) at eachstep. It is noteworthythat we could have written a fully implicit scheme withqi+1 = qi + hqi+1 withoutmodifying the conclusion: Moreau’s time stepping method isnot stiff.

1.6 Summary of the Main Ideas

• Simple physical systems yield different types of dynamics:– ODEs with Lipschitz-continuous vector field– Differential inclusions with compact, convex right-handsides (like Filippov’s

inclusions)– Differential inclusions in normal cones (like Moreau’s sweeping process)– Measure differential inclusions– Evolution variational inequalities– Linear complementarity systems

Some of these formalisms may be shown to be equivalent, see (Brogliatoet al. (2006)).

• The nonsmooth formalisms may be useful to avoid stiff problems. All these sys-tems possess solutions which are not differentiable everywhere, and may evenjump (absolutely continuous, locally bounded variation solutions).

• There exist two types of numerical schemes for the integration of these nons-mooth systems:

– The event-driven (or event-tracking) schemes. One supposes that betweenevents (instants of nondifferentiability), the solutionsare differentiableenough, so that any standard high-order scheme (Runge–Kutta methods, ex-trapolation methods, multistep methods, . . . ) may be used until an event isdetected. The event detection/localization has to be accurate enough so thatthe order is preserved. Once the event has been treated, continue the integra-tion with your favorite scheme. This procedure may fail whenthere are toomany events (like for instance an accumulation).

– The time-stepping (or event-capturing) schemes. The whole dynamics (dif-ferential and algebraic parts) is discretized in one shot. Habitually low-order(Euler-like) schemes are used (other, higher order methodsmay in somecases be applied, however, the nonsmoothness brings back the order to one).Advancing the scheme from stepk to stepk+ 1 requires to solve a comple-mentarity problem, or a quadratic problem, or a projection algorithm. Con-vergence results have been proved.

Page 75: Numerical Methods for Nonsmooth Dynamical …Numerical Methods for Nonsmooth Dynamical Systems: Applications in Mechanics and Electronics Vincent Acary, Bernard Brogliato To cite this

Hal

INR

IA s

ampl

e

54 1 Nonsmooth Dynamical Systems: Motivating Examples and Basic Concepts

• Though the time-stepping schemes look like Euler schemes, they are not. Theprimary variables are chosen so that even in the presence of Dirac measures, allthe calculated quantities are bounded for all times. These schemes do not try toapproximate the Dirac measures at an impact. They approximate the measuresof the integration intervals, which indeed are always bounded. From a mathe-matical point of view, this may be explained from the fact that the right-handsides are cones (hence pre-multiplication by the time steph > 0 is equivalent topre-multiplication by 1).

• There are strong analogies between nonsmooth electrical circuits and nonsmoothmechanical systems. More may be found in Möller & Glocker (2007). The solu-tions of nonsmooth electrical circuits may jump, so that they are rigorously repre-sented bymeasure differential inclusions. The fact that switching networks maycontain Dirac measures has been noticed since a long time in the circuits litera-ture (Bedrosian & Vlach, 1992). Proper simulation tools fornonsmooth systemsare necessary, because the integrators based on stiff, so-called “physical” modelsmay provide poor, unreliable results (Bedrosian & Vlach, 1992).