13

Automated Model Generation and Observer Design for Interconnected Systems

KARLSRUHER BEITRÄGE ZUR REGELUNGS-UND STEUERUNGSTECHNIK

# Martin Pfeifer

## Automated Model Generation and Observer Design for Interconnected Systems

A Port-Hamiltonian Approach

Martin Pfeifer

## **Automated Model Generation and Observer Design for Interconnected Systems**

A Port-Hamiltonian Approach

Karlsruher Beiträge zur Regelungs- und Steuerungstechnik Karlsruher Institut für Technologie

Band 13

## **Automated Model Generation and Observer Design for Interconnected Systems**

A Port-Hamiltonian Approach

by Martin Pfeifer

Karlsruher Institut für Technologie Institut für Regelungs- und Steuerungssysteme

Automated Model Generation and Observer Design for Interconnected Systems: A Port-Hamiltonian Approach

Zur Erlangung des akademischen Grades eines Doktor-Ingenieurs von der KIT-Fakultät für Elektrotechnik und Informationstechnik des Karlsruher Instituts für Technologie (KIT) genehmigte Dissertation

von Martin Pfeifer, M.Sc.

Tag der mündlichen Prüfung: 11. Juni 2021 Referent: Prof. Dr.-Ing. Sören Hohmann Korreferent: Univ.-Prof. Dr.techn. Andreas Kugi

#### **Impressum**

Karlsruher Institut für Technologie (KIT) KIT Scientific Publishing Straße am Forum 2 D-76131 Karlsruhe

KIT Scientific Publishing is a registered trademark of Karlsruhe Institute of Technology. Reprint using the book cover is not allowed.

www.ksp.kit.edu

*This document – excluding parts marked otherwise, the cover, pictures and graphs – is licensed under a Creative Commons Attribution-Share Alike 4.0 International License (CC BY-SA 4.0): https://creativecommons.org/licenses/by-sa/4.0/deed.en*

*The cover page is licensed under a Creative Commons Attribution-No Derivatives 4.0 International License (CC BY-ND 4.0): https://creativecommons.org/licenses/by-nd/4.0/deed.en*

Print on Demand 2022 – Gedruckt auf FSC-zertifiziertem Papier

ISSN 2511-6312 ISBN 978-3-7315-1135-9 DOI 10.5445/KSP/1000138970

When the physics is well known and well understood the only way to advance knowledge and technology further is by way of MATHEMATICS, with its help if it already exists, with new research otherwise.

Rudolf Emil Kálmán (1930 – 2016)

## **Abstract**

Interconnected systems are a major pillar of modern society. In recent years, interconnected systems have gained an unprecedented extent. For such systems, existing approaches for deriving models and designing observers reach their limits. In consequence, models and observers are developed under severe simplifications of the systems' physics which leads to a poor applicability and underperformance. This thesis provides remedy by *automating* the processes of deriving models and designing observers. To this end, we develop automatable modeling and observation methods in the domain-unifying framework of port-Hamiltonian systems (PHSs). These methods are the first to allow for an automated model generation and observer design in a wide class of interconnected systems.

The methods and algorithms are implemented in a software prototype named AMOTO. AMOTO is applied to the automated model generation and observer design in two case studies. Numeric simulations verify the validity of the models and observers obtained from AMOTO. Moreover, they outperform the models and observers resulting from state of the art techniques which verifies the practical usefulness of the approach. Therewith, the methods, algorithms, and tools from this thesis can help to solve the upcoming challenges in the interconnected systems that constantly surround us.

## **Kurzfassung**

Vernetzte Systeme stellen einen unverzichtbaren Teil moderner Gesellschaften dar. Mit dem Ausrollen neuer Kommunikationstechnologien und in Folge der fortgeschrittenen Nutzung von Synergiepotenzialen entstanden in den letzten Jahren vernetzte Systeme ungeahnten Ausmaßes. Aufgrund der Komplexität dieser Systeme, gelangen bestehende Modellierungs- und Beobachterentwurfsmethoden an ihre Grenzen. Modelle und Beobachter können deshalb häufig nur unter erheblichen Vereinfachungen entwickelt werden. Die vorliegende Dissertation schafft Abhilfe. Leitgedanke ist es, die Vorgänge der Modellerzeugung und des Beobachterentwurfs zu *automatisieren*. Hierzu werden in dieser Arbeit automatisierbare Modellierungs- und Beobachtermethoden auf Basis der Port-Hamiltonschen Systemtheorie entwickelt.

Diese Methoden sind in einem Software-Prototyp namens AMOTO implementiert. In zwei Fallstudien wird AMOTO jeweils zur automatisierten Modellherleitung und zum automatisierten Beobachterentwurf eingesetzt. Computersimulationen weisen in beiden Fallstudien die Funktionstüchtigkeit der erzeugten Modelle und Beobachter nach und zeigen, dass diese genauere Ergebnisse liefern, als Modelle und Beobachter, die mit Methoden des bisherigen Stands der Technik entwickelt wurden. Dies unterstreicht die praktische Nutzbarkeit des vorgestellten Ansatzes. Es zeigt sich ferner, dass der Ansatz auf eine große Klasse vernetzter Systeme anwendbar ist. Somit leisten die Methoden, Algorithmen und Werkzeuge aus dieser Arbeit einen wichtigen Beitrag zur Bewältigung zukünftiger Herausforderungen in vernetzen Systemen.

## **Contents**



# Chapter 1

## Introduction

#### 1.1 Motivation

Interconnected systems are a major pillar of our modern society. Well-known examples of interconnected systems are the energy systems that constantly surround us. Over the last few years, the rollout of powerful communication networks, the pursuit of efficiency, and increased performance requirements have led to the advent of interconnected systems of unforeseen extent. In the context of energy systems, large-scale multi-carrier energy systems become reality (O'Malley et al. [2020]). Other examples that penetrate into practice are interconnected industrial systems (Gao et al. [2019]), cooperative swarms of drones (Tahir et al. [2019]), adaptive mechanic structures (Warsewa et al. [2020]), and automotive power networks for hybrid and electric vehicles (Mantilla-Pérez et al. [2020]).

From a system theoretic point of view, such interconnected systems have demanding properties. First, they comprise a large number of interdependent system variables—a quality that Duindam et al. [2009] call the "curse of dimensionality". Second, many interconnected systems cover multiple physical domains as, e.g., the electric, mechanic, hydraulic, and thermal domain. Third, such systems consist of many subsystems each of which contributes to the overall system behavior. Hence, subsystems can hardly be neglected or abstracted. Fourth, in many cases, interconnected systems feature nonlinear dynamics. Due to these reasons, the literature refers to interconnected systems often as "complex physical systems" (see, e.g., van der Schaft and Jeltsema [2014]).

Models are inevitable for the development of control systems in interconnected systems. A model in form of a set of ordinary differential equations (ODEs) is the basis for many simulations and the natural starting point for a model-based

control system design. The modeling of interconnected systems, however, is a very challenging task. This can be understood by two reasons:


It is important to note that the curse of dimensionality goes beyond the system modeling. In fact, it complicates all steps in a model-based control system development. In this thesis, we will elaborate this issue particularly for the design of observers. In interconnected systems, observers are of considerable interest as they are essential for the supervision of a system and often required for the practical implementation of a control law.

Due to the above reasons, the development of models and observers for interconnected systems is cost-intensive, cumbersome, and prone to error. In consequence, models and observers are frequently developed under severe simplifications in which the systems' physics are only roughly approximated, e.g., by neglecting important dynamics or nonlinearities. In a wide operating range, however, these approximations are inadmissible which limits the practical applicability of the obtained models and observers.

To avoid such unjustified simplifications, there are different model derivation and observer design techniques in the literature. These approaches are outlined in the next section.

## 1.2 Literature Context

In the literature, there have been multiple computer-aided methods to handle the complexity of interconnected systems in the model derivation and observer design. This section presents a brief overview of these methods. A particular literature review on methods for the modeling and observation in the framework of port-Hamiltonian systems (PHSs) can be found in sections 3.1 and 4.1, respectively.

#### 1.2.1 Model Derivation Methods

Existing methods for a computer-aided derivation of ODE models can be classified into two groups, viz. data-based methods and physical-based methods. Data-based methods compute a model based on data originating from the system or a virtual duplicate. In contrast, in physical-based methods, a model is derived from knowledge about the physical relations that govern the system. The focus of this thesis—and therewith of this subsection—is on physical-based methods.

In analytical mechanics, there is a long tradition in the algorithmic derivation of ODE models. This tradition traces back to the work of Joseph-Louis Lagrange and Sir William Rowan Hamilton and the formalisms named after them. The Lagrange and Hamilton formalisms and extensions thereof allow for a unified energy- and power-based modeling of multi-domain systems (see Jeltsema and Scherpen [2009]). Despite their prominence, the methods from analytical mechanics have received only limited attention in literature for the computer-aided model derivation in interconnected systems. Two exceptions are the papers of Leu and Hemati [1986] and Bachovchin and Ilic [2015]. In these papers, the authors ´ present methods for deriving the dynamic equations of robotic manipulators and electric power systems, respectively, based on the Lagrange formalism.

Network-based modeling offers another approach to the computer-aided derivation of ODE models for interconnected systems. The idea of a networkbased modeling is to describe the system under consideration by means of a graph. In contrast to the methods based on analytical mechanics, there exists extensive literature on the modeling of interconnected systems with network-based methods. It is neither in the scope of this section nor the intention to go into the details of all publications in this field. Instead, the pioneering works, some survey papers, and a few recent results are highlighted.

The history of network-based modeling ranges back to the work of Kirchhoff [1847] on electric network theory. The first network-based methods for an ODE modeling of electric circuits were published in the mid 1960s by Brayton and Moser [1964] and Chua and Rohrer [1965]. Roberson and Wittenburg [1968] propose a formalism for the derivation of the dynamic equations of a system of rigid bodies. The interconnection topology is described by a graph which is analytically characterized by its incidence matrix. In the mid 1980s, Cederbaum [1984] surveyed important applications of network-theory to the modeling, analysis, and synthesis of electric circuits. A method for the computer-aided

generation of the equations of motion of planar multibody systems with open and closed kinematic chains was presented by McPhee [1998]. The method integrates network modeling methods and orthogonal projection methods. Schlacher et al. [1998] combine a network-based modeling approach with the Lagrangian framework. Based hereon, the authors propose a method for the computer-aided modeling of mechatronic systems.

The research activities in the field of a network-based modeling for mechanic, electric, and mechatronic systems in the years between 2000 and 2016 have been reviewed by Garziad and Saka [2017]. Dörfler et al. [2018] survey some recent results how network- and graph-theory informs the modeling, analysis, and design of electric systems.

Network-based models have an excellent scalability which makes them appealing for the treatment of interconnected systems. The main limitation of a network-based modeling approach is the assumption that the vertices and edges of the system-describing graph represent some pre-defined system components. This assumption limits the reusability and transferability of the models to other systems, in particular across different physical domains.

#### 1.2.2 Observer Design Methods

As early as 1966, Luenberger presented a "simple algorithm for computing the observer" [Luenberger, 1966]. The development of algorithms for the practical observer design is closely linked to the development of the observer theory as a whole. Needless to say that a complete review of all algorithmic observer design methods is outside the scope of this subsection. Instead, it is focused on approaches which are particularly appealing for a computer-aided observer design in interconnected systems.

Well-known methods for the computer-aided design of observers date back to Ackermann [1972] and Kautsky et al. [1985]. The former is implemented in Wolfram Mathematica and can be accessed via the command EstimatorGains; the latter is behind the MATLAB command place. The innovation of the following decades were strongly influenced by the widespread availability of technical computing systems and an increasing computational power. These developments fostered the advent of optimization-based observer design techniques as proposed by Franceschini et al. [1994], Howell and Hedrick [2002], Ichihara [2007], and Shoukry et al. [2018]. Approaches particularly based on the

solution of linear matrix inequalities (LMIs) were presented, e.g., by Cho and Rajamani [1997], Wang et al. [2003], Moreno [2004], and Chen and Saif [2006]. Cheng et al. [1994] and Raghavan and Hedrick [1994] derive an observer design strategy which is based on the numeric solution of a Riccati equation. Similar, Edwards and Spurgeon [1994] presented an algorithm for the model-based design of sliding mode observers which requires the solution of a Lyapunov equation. Syrmos [1993] provided a computationally efficient observer design framework based on the transmission zeros of the system. An approach based on orthogonal transformations was proposed by Laila et al. [2011]. Schweers [2017] presented a method for a computer-aided design of state estimators. The methods from Schweers [2017] rely on data-based models of multi-domain systems.

The subsequent section briefly summarizes the insights of the literature review and states the objectives of this thesis.

## 1.3 Research Objectives

The modeling of interconnected systems is a cumbersome and time-consuming task which may involve experts from different engineering domains. The model derivation using the power- and energy-based methods from analytical mechanics is a promising approach to overcome these problems (cf. Jeltsema and Scherpen [2009]). However, a computer-aided model generation with these methods has received only limited attention in the literature and is, as for now, restricted to a rather small class of interconnected systems.

On the other hand, many network-based modeling methods allow for an efficient model derivation. However, these approaches are also limited to particular classes of systems as, e.g., electric networks, power systems, mechatronic systems, or multi-body systems.

A unifying computer-aided modeling method which can be applied to a large class of interconnected systems is lacking in the main literature.

For the computer-aided design of observers for interconnected systems there exist powerful methods in the literature. A limitation, however, is that these approaches are based on a purely numerical model of the system. In such a model, there is hardly any information about the physical structure of the system to be observed. On the one hand, this limits the reusability of the resulting observers, e.g., in case of variations of the physical parameters. On the other

hand, the lack of interpretability hampers the exploitation of physical system properties for the observer design.

Physical-oriented methods for a computer-aided observer design for interconnected systems have been rarely reported in the literature so far.

The thesis at hand addresses the above research gaps. The idea is to consistently *automate* the physical-based model derivation and observer design for interconnected systems. Something that is, to the best of our knowledge, neither present in the literature nor existing in practice. To this end, this thesis follows a port-Hamiltonian approach.

Port-Hamiltonian systems theory combines the Lagrangian/Hamiltonianbased modeling framework with the network-based modeling framework: on the one hand, PHSs rely on the Lagrangian/Hamiltonian paradigm in which energy serves as a unifying conserved quantity in different physical domains; on the other hand, PHSs are build upon the port-based modeling concept which emphasizes their affinity to the network-based paradigm. The combination of these two frameworks establishes the advantages of a port-Hamiltonian approach, four of which are:


For these reasons, port-Hamiltonian systems theory is the ideal methodological framework for this thesis. The research objectives—restated in the light of this methodological approach—are:


## 1.4 Structure and Notation

To ensure orientation and readability, the structure and notation of the remainder of this thesis are presented here.

**Structure** Chapter 2 outlines the terminology applied in this thesis and provides the necessary basics in port-Hamiltonian systems theory. The following three chapters contain the main contributions of this work. Chapter 3 is devoted to the development of methods and algorithms for an automated model generation. Methods and algorithms for an automated observer design are presented in Chapter 4. Chapter 5 provides a proof of principle and demonstrates the practical usefulness of the automated model generation and observer design. Finally, the main conclusions of this work are drawn together in Chapter 6.

**Notation** Sets, groups, and spaces are written in blackboard bold. The cardinality of a set <sup>M</sup> is denoted as <sup>|</sup>M|. The sets <sup>N</sup>, <sup>R</sup>, and <sup>C</sup> are the sets of natural, real, and complex numbers, respectively. For the dimension of a vector space X we write dim(X). The group of *<sup>n</sup>*×*<sup>n</sup>* orthogonal matrices is given by <sup>O</sup>(*n*). Vectors and matrices are written in bold font. Let *<sup>A</sup>* <sup>∈</sup> <sup>R</sup> *<sup>m</sup>*×*<sup>n</sup>* be a matrix with *m* rows and *n* columns. For the transpose of *A* we write *A* <sup>⊤</sup>. Now let *m* = *n*. The inverse of *A* is denoted by *A* −1 (if it exists). Spec(*A*) denotes the spectrum of *A*, i.e., its set of eigenvalues. *<sup>A</sup>* <sup>≻</sup> <sup>0</sup> and *<sup>A</sup>* <sup>⪰</sup> <sup>0</sup> mean that *<sup>A</sup>* is positive-definite and positive semi-definite, respectively. A diagonal matrix is denoted by diag(·); likewise, blkdiag(·) is a block diagonal matrix of matrices. Now let *<sup>x</sup>* <sup>∈</sup> <sup>R</sup> *<sup>m</sup>* be a (column) vector. The Euclidean norm of *<sup>x</sup>* is denoted as <sup>∥</sup>*x*∥. For the kernel, image, and rank of the linear map *<sup>x</sup>* 7→ *Ax* we write ker(*A*), im(*A*), and rank(*A*), respectively.

Throughout this thesis, when using the expressions "we" or "us", the author presumes that the readers agree to what he is saying. In particular, these types of expressions are not intended to imply any personalization of the academic discourse.

# Chapter 2

## Fundamentals

The aim of this thesis is to develop automatable port-Hamiltonian methods for the model derivation and the observer design in interconnected systems. This chapter provides the fundamentals towards this endeavor. To enable a clear and concise presentation of the technical contents, Section 2.1 outlines the terminology used throughout this work. Afterwards, Section 2.2 provides selected fundamentals in port-Hamiltonian systems theory which are necessary to derive automatable methods in chapters 3 and 4.

## 2.1 Terminology

This section is devoted to the definition of some terms of key importance for this work as, e.g., interconnected system, automated model generation, and automated observer design.

## 2.1.1 Interconnected System

Our notion of an interconnected system is guided by the terminology from Willems [2007]. To approach a formal definition of an interconnected system, we first introduce the notion of an *open graph*. The following definition is condensed from the elaboration of van der Schaft and Maschke [2013].

#### **Term 2.1 (Open graph)**

*An open graph is a directed graph* G = (V,B) *with vertices* V *and edges* B*. The set* <sup>V</sup><sup>B</sup> <sup>⊂</sup> <sup>V</sup> *is the subset of boundary vertices which represent the interfaces between the graph system and its environment. The set* V<sup>I</sup> := V \ V<sup>B</sup> *contains the inner vertices of the open graph.*

Based on the concept of an open graph, we may now introduce the concept of a *networked system*.

#### **Term 2.2 (Networked system)**

*A networked system* Σ *is a system which can be described by an open graph* <sup>G</sup> = (V,B) *with* <sup>V</sup> <sup>=</sup> <sup>V</sup><sup>I</sup> <sup>∪</sup> <sup>V</sup><sup>B</sup> *and* <sup>B</sup> <sup>=</sup> <sup>B</sup><sup>I</sup> <sup>∪</sup> <sup>B</sup>B*. The elements of* <sup>V</sup><sup>I</sup> *represent multiple, possibly heterogeneous subsystems of the networked system. The interactions between the subsystems are expressed by the set of inner edges* B<sup>I</sup> :<sup>=</sup> {(*u*, *<sup>v</sup>*) <sup>∈</sup> <sup>B</sup> <sup>|</sup> *<sup>u</sup>*, *<sup>v</sup>* <sup>∈</sup> <sup>V</sup>I}*. The subsystems may interact with the system environment via a set of boundary vertices* VB*. The boundary vertices are connected to the inner vertices by a set of boundary edges* B<sup>B</sup> := {(*u*, *v*) ∈ B | *u* ∈ VI, *v* ∈ VB}*.*

Figure 2.1 illustrates the open graph representation of an exemplary networked system with nine inner vertices, three boundary vertices, twelve inner edges, and four boundary edges.

**Figure 2.1:** Example of a networked system with nine inner vertices (1,...,9), three boundary vertices (*B*1,*B*2,*B*3), twelve inner edges, and four boundary edges

A networked system allows for any kind of interaction between the vertices of the open graph, e.g., by an exchange of matter, information, or energy. This thesis will focus on networked systems in which the interactions are established by an exchange of energy. The exchange of energy between vertices requires the presence of a physical interconnection between them. This motivates the notion of an *interconnected system* [Willems, 2007].

#### **Term 2.3 (Interconnected system)**

*An interconnected system* Σ *as a networked system in which the interactions between the vertices are established through an exchange of energy.*

In this thesis, we consider continuous-time, finite-dimensional, deterministic interconnected systems. Some well-known examples of such systems are electric circuits (Kugi [2001]), power systems (Dörfler et al. [2018]), gas networks (Pfeifer et al. [2018]), district heating networks (Merkert et al. [2019]), interconnected industrial systems (Gao et al. [2019]), and battery systems (Kupper [2019]). Other examples are cooperative swarms of drones (Tahir et al. [2019]), automotive power networks (Mantilla-Pérez et al. [2020]), large-scale mechatronic systems (Deroo [2016]), and adaptive mechanic structures (Warsewa et al. [2020]).

## 2.1.2 Automated Model Generation

In order to approach the notion of an automated model generation let us first clarify the meaning of a *mathematical model*. The following elaboration is inspired from Wellstead [1979]:

#### **Term 2.4 (Mathematical model)**

*Consider a system* Σ*. A mathematical model is an objective-specific description of* Σ *in the form of mathematical functions and equations deduced from available information about the system.*

Next, the term *mathematical model* is particularized to a *physical-based model*.

#### **Term 2.5 (Physical-based model)**

*Consider a system* Σ*. A physical-based model is a mathematical model of* Σ *deduced from the physical relations that govern the system.*

Unless explicitly stated otherwise, in this work the term *model* denotes a physicalbased model. We aim at explicit ODE models in a state-space representation. *Explicit state-space models* are particularly appealing for the design, analysis, and simulation of control systems. The following definition combines the elaborations from Vidyasagar [1993, p. 1] and van der Schaft [2017, p. 10]:

#### **Term 2.6 (Explicit state-space model)** *Consider a system* Σ*. An explicit state-space model of* Σ *is a model of the form*

$$\dot{\mathbf{x}}(t) = \mathbf{f}\left(\mathbf{x}(t), \mathbf{u}(t), t\right),\tag{2.1a}$$

$$\mathbf{y}(t) = \mathbf{g}\left(\mathbf{x}(t), \mathbf{u}(t), t\right),\tag{2.1b}$$

*for all <sup>t</sup>* <sup>∈</sup> <sup>R</sup>≥<sup>0</sup>*, where <sup>u</sup>*(*t*) <sup>∈</sup> <sup>U</sup> <sup>⊆</sup> <sup>R</sup> *p , x*(*t*) ∈ X ⊆ R *n , y*(*t*) ∈ Y ⊆ R *<sup>q</sup> and sufficiently smooth mappings <sup>f</sup>* : <sup>X</sup>×U×R≥<sup>0</sup> <sup>→</sup> <sup>X</sup>*, <sup>g</sup>* : <sup>X</sup>×U×R≥<sup>0</sup> <sup>→</sup> <sup>Y</sup>*. The quantities u*(*t*)*, x*(*t*)*, and y*(*t*) *are referred to as input, state, and output of the system, respectively;* U*,* X*, and* Y *are denoted as input-space, state-space, and output-space, respectively.*

*Remark* 2.7 (Notation)*.* In the remainder of this thesis, the time-dependence "(*t*)" of vectors is omitted in the notation.

For interconnected systems, one distinguishes between global models and local models. A global model of an interconnected system Σ is a model comprising the entire open graph G = (V,B). In contrast, a local model is defined only on a connected subgraph <sup>G</sup>˜ <sup>⊂</sup> <sup>G</sup> . Moreover, we distinguish between a symbolic and a numeric model. In a symbolic model, the functions *f* and *g* from (2.1) depend (besides on *x*, *u*, and *t*) on the physical system parameters in symbolic form as, e.g., a resistance *R*, a mass *m*, etc.; in contrast, in a numeric model, the physical parameters are numerically specified, e.g., by information from data sheets or parameter identification techniques. Hence, such a model is—except for the variables *u*, *x*, and *y*—completely numerically determined.

Now we have everything prepared to introduce a term of key importance for this thesis, viz. *automated model generation*.

#### **Term 2.8 (Automated model generation)**

*Automated model generation describes the computer-aided derivation of a physical-based explicit state-space model with minimal human assistance.*

The modeling of interconnected systems may easily involve hundreds of equations. In Chapter 5, we examine two examples for this. For a human developer, dealing with such a number of equations is cumbersome and prone to error. Hence, this work particularly aims at automating the formalization step of the model derivation, i.e., the "equation deriving part".

#### 2.1.3 Automated Observer Design

Observer theory is an important topic in systems and control theory. The observer concept traces back to Luenberger [1964]. The following conception of an *observer* is taken from Trumpf et al. [2011]:

#### **Term 2.9 (Observer)**

*Given a system* Σ *whose variables can be partitioned into a set of known or measured variables and a set of unknown variables to be reconstructed. An observer for* Σ *is a deterministic dynamic system which produces reconstructions of the unknown variables on the basis of the known or measured variables.*

We aim at "asymptotic observers" (Trumpf [2013]), i.e., observers where the reconstructions asymptotically converge towards the values of the unknown variables. If the Euclidean norm of the reconstruction error converges exponentially to zero, the observer is called exponentially convergent (cf. Khalil [2002, Def. 4.5]). Moreover, we distinguish between two observer architectures, viz. a centralized and a distributed observer architecture (cf. Kupper [2019, Def. 2.5]). Given an interconnected system Σ, in a centralized architecture, there is a single observer which receives information from all measurement sources to calculate reconstructions of all unknown variables from Σ. In contrast, in a distributed architecture, there is a dedicated observer for each subsystem of Σ. In each observer, the available measurement information and the variables to be reconstructed are local with respect to the subsystem.

Next, let us clarify the terms *observer design* and *model-based observer design*.

#### **Term 2.10 (Observer design)**

*Observer design refers to the process of specifying the parameters of an observer.*

#### **Term 2.11 (Model-based observer design)**

*Model-based observer design is an observer design which is based on a mathematical model of the system under consideration.*

This thesis focuses on an observer design on the basis of physical-based explicit state-space models. Such an observer design can rely either on global or local model knowledge (cf. Deroo [2016]). The latter is of particular interest for the design of a distributed observer.

A model-based observer design can rely either on a symbolic or a numeric model. Accordingly, these two cases are denoted as symbolic and numeric observer design, respectively. The former leads to an observer in which the observer parameters depend on the physical parameters in symbolic form; the latter results in observer parameters that are completely numerically specified. A symbolic observer design has two advantages over a numeric observer design. First, a symbolic design provides more insight into the physical background of the observer parameters. In Chapter 4, it will be shown that this insight allows us to use the physical properties of the system beneficially for the observer design. Second, a symbolic observer design enables the reusability of the resulting observer, e.g., in case of parameter variations. A drawback of a symbolic observer design is that it may lead to computationally expensive operations on large symbolic expressions. Both, symbolic and numeric observer designs, are in the scope of this thesis.

Next, let us introduce a notion of major importance for this work, viz. *automated observer design*.

#### **Term 2.12 (Automated observer design)**

*Automated observer design refers to a computer-aided model-based observer design with minimal human assistance.*

The following example motivates the practical usefulness of an automated observer design:

#### **Example 2.13:**

*Power systems are well-known examples of interconnected systems. State estimation techniques are crucial for the operation of a power system. The state estimators applied in nowadays control centers are static. Recently, an IEEE taskforce pointed out that in consequence of the energy transition, a static state estimation is increasingly inadequate and "should be reassessed*

*and enhanced with new monitoring tools, such as dynamic state estimation" [Zhao et al., 2019]. However, the extent of a power system with hundred and more inputs, states, and outputs significantly hampers the design of a dynamic state estimator. An automated observer design can overcome this problem—as will be seen in Section 5.2.*

## 2.2 Port-Hamiltonian Systems

This section provides some fundamentals in port-Hamiltonian systems theory which are necessary for the development of automatable modeling and observer design methods in chapters 3 and 4, respectively.

In Subsection 2.2.1, we briefly recapitulate the notion of generalized power variables. Afterwards, Subsection 2.2.2 introduces the concept of a Dirac structure. The focus of this thesis is on explicit state-space models in form of inputstate-output PHSs. This particular class of PHSs is introduced in Subsection 2.2.3.

#### 2.2.1 Generalized Power Variables

PHSs follow the power- and energy-based concept of the Lagrangian/Hamiltonian modeling paradigm. A thorough introduction into this concept can be found, e.g., in Breedveld [2009], Jeltsema and Scherpen [2009], and in the ageless book authored by Wellstead [1979].

The core idea of an energy-based modeling is to use energy as universally, domain-independent conserved quantity. The interaction between two elements, subsystems, systems, etc. is coupled to an exchange of energy, i.e., *E* = R *P*d*t*. The power *P* is described by two time-dependent, generalized power variables, viz. a flow *<sup>f</sup>* <sup>∈</sup> <sup>F</sup> and an effort *<sup>e</sup>* <sup>∈</sup> <sup>E</sup> with <sup>F</sup> an abstract finite-dimensional vector space and E its dual vector space E := F ∗ .The exchanged instantaneous power is given by the dual pairing *<sup>P</sup>* <sup>=</sup> ⟨*<sup>e</sup>* <sup>|</sup> *<sup>f</sup>*⟩.

The generalized variables have straightforward correspondences to system variables from different physical domains. Table 2.1 summarizes the correspondences between the generalized variables and the domain-specific variables for the electric, magnetic, mechanic, hydraulic, thermal, and chemical domain.

This thesis makes use of a correspondence scheme which is known as *thermodynamic framework of domains and variables* [Breedveld, 2009, p. 24]. In this framework, the generalized state *x* is defined as the integral of the generalized flow over time, i.e., *x* := R *f* d*t*, see Table 2.1. Moreover, note that for each domain the product of the flow- and the effort-related variable has the unit of power.


**Table 2.1:** Correspondences between generalized variables and physical variables in the thermodynamic framework of domains and variables (cf. Breedveld [2009, p. 24])

The following example illustrates how the concept of generalized power variables contributes to a unified modeling of physical systems. The example will be successively applied in this chapter.

#### **Example 2.14:**

*Consider the electromagnetic, mechanic, and hydraulic systems in Figure 2.2 (a), (b), and (c), respectively. The systems are structured as follows:*


*Let us introduce the generalized power variables as follows:*


*Under these correspondences the systems from Figure 2.2 (a), (b), and (c) obey the same network equations:*

$$f\_0 - f\_{\mathbf{C},1} - e\_{\mathbf{C},3} = 0,\tag{2.2a}$$

$$e\_0 - f\_{\mathbf{C},3} - e\_{\mathbf{R}} - e\_{\mathbf{C},2} = 0,\tag{2.2b}$$

$$e\_{\mathbf{C},3} - f\_{\mathbf{R}} = \mathbf{0},\tag{2.2c}$$

$$f\_{\mathbf{R}} - f\_{\mathbf{C},2} = 0,\tag{2.2d}$$

$$e\_0 - e\_{C,1} = 0.\tag{2.2e}$$

#### 2.2.2 Dirac Structures

The notion of a Dirac structure is of central importance for the port-Hamiltonian framework. The Dirac structure establishes the link between the Lagrangian/Hamiltonian and the network-based point of view. It describes the network interconnections in form of a power-conserving, geometric structure. Therewith, the Dirac structure generalizes the symplectic geometry of the phase-space from the classical Hamiltonian equations of motion [van der Schaft, 2009, p. 74]. The power-conservation is ensured by relating generalized power variables *f* and *e* in such a way that the total power entering (or leaving) the Dirac structure is zero.

In Chapter 3, the determination of a Dirac structure will be the enabling step for an automated model generation. A detailed introduction into the concept of a Dirac structure can be found in Bloch and Crouch [1999] and van der Schaft and Jeltsema [2014]. The following definition is taken from the latter:

<sup>1</sup>The fluid capacitances *C*f,*<sup>i</sup>* can be calculated as *C*f,*<sup>i</sup>* = *Ai*/(ρ*g*), where *A<sup>i</sup>* is the cross-sectional area of tank *i*, ρ the mass density of the (incompressible) fluid, and *g* the gravitational constant (*i* = 1,2).

#### **Definition 2.15 (Dirac structure)**

*Consider the flows <sup>f</sup>* <sup>∈</sup> <sup>F</sup> *and the efforts <sup>e</sup>* <sup>∈</sup> <sup>E</sup> <sup>=</sup> <sup>F</sup> <sup>∗</sup> *where* F *is an abstract finite-dimensional vector space. A constant Dirac structure is a subspace* <sup>D</sup> <sup>⊂</sup> <sup>F</sup>×<sup>E</sup> *such that*

$$(i) \quad \langle \mathbf{e} \mid \mathbf{f} \rangle = 0, \quad \forall (\mathbf{f}, \mathbf{e}) \in \mathbb{D}, \tag{2.3a}$$

$$\mathbb{P}(ii) \quad \dim \mathbb{D} = \dim \mathbb{F}.\tag{2.3b}$$

Property (*i*) represents the power-conservation of the Dirac structure. The maximal dimension of any subspace <sup>D</sup> <sup>⊂</sup> <sup>F</sup>×<sup>E</sup> satisfying property (*i*) is dim<sup>F</sup> [van der Schaft, 2009, p. 56]. Hence, property (*ii*) requires D to be of maximal dimension.

The following definition extends Definition 2.15 to the situation where a Dirac structure is modulated by a state vector *<sup>x</sup>* <sup>∈</sup> <sup>X</sup>:

#### **Definition 2.16 (Modulated Dirac structure)**

*<sup>A</sup>* modulated Dirac structure *is a family of constant Dirac structures* <sup>D</sup>(*x*) <sup>⊂</sup> <sup>F</sup>×<sup>E</sup> *indexed over <sup>x</sup>* <sup>∈</sup> <sup>X</sup>*.*

*Remark* 2.17 (Real vector spaces)*.* Throughout this thesis we have F = R *n* . As E = (R *n* ) ∗ is isomorphic to R *n* , we identify E with R *n* .

Definitions 2.15 and 2.16 are coordinate-free. For the practical work, matrix representations of Dirac structures are of paramount importance. The following definition presents two matrix representations, viz. the *kernel representation* and the *input-output representation*.

#### **Definition 2.18 (Kernel representation)**

*A kernel representation of a modulated Dirac structure* <sup>D</sup>(*x*) <sup>⊂</sup> <sup>R</sup> *<sup>n</sup>* <sup>×</sup><sup>R</sup> *<sup>n</sup> with x* ∈ X *is*

$$\mathbb{D}(\mathbf{x}) = \{ (\mathbf{f}, \mathbf{e}) \in \mathbb{R}^n \times \mathbb{R}^n \mid \mathbf{F} \left( \mathbf{x} \right) \mathbf{f} + \mathbf{E} \left( \mathbf{x} \right) \mathbf{e} = \mathbf{0} \},\tag{2.4}$$

*where the matrices F* (*x*) *and E* (*x*) *satisfy*

$$(i) \quad \mathbf{E}\left(\mathbf{x}\right)\mathbf{F}^{\top}\left(\mathbf{x}\right) + \mathbf{F}\left(\mathbf{x}\right)\mathbf{E}^{\top}\left(\mathbf{x}\right) = \mathbf{0},\tag{2.5a}$$

$$\mathbf{E}(i\mathbf{i})\quad\text{rank}(\mathbf{F}(\mathbf{x})\cdot\mathbf{E}(\mathbf{x}))=n,\tag{2.5b}$$

*for all <sup>x</sup>* <sup>∈</sup> <sup>X</sup>*. The power balance of* (2.4) *is*

$$\mathbf{e}^{\top}\mathbf{f} = 0, \quad \forall (\mathbf{f}, \mathbf{e}) \in \mathbb{D}\left(\mathbf{x}\right). \tag{2.6}$$

*Remark* 2.19 (Uniqueness of the kernel representation)*.* The matrices *F* (*x*) and *E* (*x*) are not uniquely determined by the kernel representation. For example, both matrices can be multiplied from the left by an arbitrary invertible matrix *T* (*x*) without changing D.

#### **Proposition 2.20 (Input-output representation)**

*Let* D(*x*) ⊂ R *<sup>n</sup>* <sup>×</sup><sup>R</sup> *<sup>n</sup> with <sup>x</sup>* <sup>∈</sup> <sup>X</sup> *be a Dirac structure in kernel representation. Let* rank(*<sup>F</sup>* (*x*)) = *<sup>m</sup>* (<sup>≤</sup> *<sup>n</sup>*)*. We select <sup>m</sup> independent columns of <sup>F</sup>* (*x*) *and group them into a matrix <sup>F</sup>*<sup>1</sup> (*x*)*. The remaining <sup>n</sup>*−*<sup>m</sup> columns are collected in a matrix F*<sup>2</sup> (*x*)*. Possibly after permutations, we write F* (*x*) = (*F*<sup>1</sup> (*x*) *F*<sup>2</sup> (*x*))*. Correspondingly, we split E* (*x*)*, f , and e into* (*E*<sup>1</sup> (*x*) *E*<sup>2</sup> (*x*))*, f* ⊤ 1 *f* ⊤ 2 ⊤ *, and e* ⊤ 1 *e* ⊤ 2 ⊤ *, respectively. Then, the matrix* (*F*<sup>1</sup> (*x*) *E*<sup>2</sup> (*x*)) *is invertible for all <sup>x</sup>* <sup>∈</sup> <sup>X</sup> *and an input-output representation of* <sup>D</sup>(*x*) *is given by*

$$\mathbb{D}(\mathbf{x}) = \{ (\mathbf{f}, \mathbf{e}) \in \mathbb{R}^n \times \mathbb{R}^n \mid \mathbf{y} = \mathbf{Z}(\mathbf{x})\,\mathbf{u} \}\tag{2.7}$$

*with*

$$\mathbf{Z}(\mathbf{x}) = -\left(\mathbf{F}\_1(\mathbf{x})\,\mathbf{E}\_2(\mathbf{x})\right)^{-1} \left(\mathbf{E}\_1(\mathbf{x})\,\mathbf{F}\_2(\mathbf{x})\right). \tag{2.8}$$

*The matrix <sup>Z</sup>* (*x*) *satisfies <sup>Z</sup>* (*x*) = <sup>−</sup>*<sup>Z</sup>* (*x*) ⊤ *for all <sup>x</sup>* <sup>∈</sup> <sup>X</sup>*. The vectors <sup>u</sup>* <sup>=</sup> (*e* ⊤ 1 *f* ⊤ 2 ) <sup>⊤</sup> *and y* = (*f* ⊤ <sup>1</sup> *e*<sup>⊤</sup> 2 )<sup>⊤</sup> *are referred to as input vector and output vector, respectively. The power balance of* (2.7) *is*

$$\mathbf{u}^{\top}\mathbf{y} = \mathbf{e}\_1^{\top}\mathbf{f}\_1 + \mathbf{f}\_2^{\top}\mathbf{e}\_2 = 0,\ \forall \begin{pmatrix} \mathbf{f}\_1\\\mathbf{f}\_2 \end{pmatrix}, \begin{pmatrix} \mathbf{e}\_1\\\mathbf{e}\_2 \end{pmatrix}) \in \mathbb{D}\left(\mathbf{x}\right). \tag{2.9}$$

#### Proof:

Bloch and Crouch [1999] prove this statement for a constant Dirac structure, i.e., the case where *F* (*x*) = *F* = const., *E* (*x*) = *E* = const.; the pointwise application of the proof from Bloch and Crouch [1999] then proves the statement in Proposition 2.20.

*Remark* 2.21 (Implicit and explicit representations)*.* Due to the structure of the equation systems, the kernel representation (2.4) and the input-output representation (2.7) are denoted as implicit and explicit representations, respectively.

In the following, we continue with the example to illustrate the kernel and the input-output representation of a Dirac structure.

#### **Example 2.22:**

*Consider the three systems from Example 2.14. By rearranging the network equations* (2.2)*, the internal interconnection structure of each of the systems can be described by a Dirac structure in kernel representation* (2.4)*:*

$$\mathbb{D} = \{ ( \begin{pmatrix} f\_{\mathbb{C},1} \\ f\_{\mathbb{C},2} \\ f\_{\mathbb{C},3} \\ f\_{\mathbb{R}} \\ f\_0 \end{pmatrix}, \begin{pmatrix} e\_{\mathbb{C},1} \\ e\_{\mathbb{C},2} \\ e\_{\mathbb{C},3} \\ e\_{\mathbb{R}} \\ e\_0 \end{pmatrix} \} \in \mathbb{R}^5 \times \mathbb{R}^5 \mid \begin{pmatrix} -1 & 0 & 0 & 0 & -1 \\ 0 & 0 & 1 & 0 & 0 \\ 1 & 0 & 0 & 1 & 1 \\ 1 & 1 & 0 & 0 & 1 \\ 0 & 0 & 0 & 0 & 0 \end{pmatrix} \begin{pmatrix} -f\_{\mathbb{C},1} \\ -f\_{\mathbb{C},2} \\ -f\_{\mathbb{C},3} \\ -f\_{\mathbb{R}} \\ f\_0 \end{pmatrix} + \{ ( \begin{array}{c} \\ -f\_{\mathbb{C},1} \\ -f\_{\mathbb{R},2} \\ f\_0 \end{array} \}$$

$$\begin{pmatrix} 0 & 0 & 1 & 0 & 0 \\ 0 & -1 & 0 & -1 & 1 \\ 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 \\ -1 & 0 & 0 & 0 & 1 \end{pmatrix} \begin{pmatrix} e\_{\mathbb{C},1} \\ e\_{\mathbb{C},2} \\ e\_{\mathbb{C},3} \\ e\_{\mathbb{R}} \\ e\_0 \end{pmatrix} = \begin{pmatrix} 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \end{pmatrix} . \tag{2.10}$$

*It can be easily verified that the matrices in* (2.10) *satisfy the conditions* (2.5)*. An input-output representation of* (2.10) *is given by*

$$\begin{aligned} \mathbb{D} &= \{ ( \begin{array}{c} f\_{\mathbb{C},1} \\ f\_{\mathbb{C},2} \\ f\_{\mathbb{C},3} \\ f\_{\mathbb{R}} \\ f\_{0} \end{array} \} , \begin{array}{c} e\_{\mathbb{C},1} \\ e\_{\mathbb{C},2} \\ e\_{\mathbb{R},3} \\ e\_{\mathbb{R}} \\ e\_{0} \end{array} \} \end{aligned} \rangle \in \mathbb{R}^{5} \times \mathbb{R}^{5} \mid \\
\begin{pmatrix} -f\_{\mathbb{C},1} \\ -f\_{\mathbb{C},2} \\ -f\_{\mathbb{C},3} \\ -f\_{\mathbb{R}} \\ -f\_{\mathbb{R}} \\ e\_{0} \end{pmatrix} = \begin{pmatrix} 0 & 0 & 1 & 0 & 1 & -1 \\ 0 & 0 & -1 & 0 & 0 \\ -1 & 1 & 0 & 1 & 0 & 0 \\ \dots & 1 & 0 & 1 & 0 & 0 \\ 0 & 0 & -1 & 0 & 0 & 0 \\ 1 & 0 & 0 & 0 & 0 & 0 \end{pmatrix} \begin{pmatrix} e\_{\mathbb{C},1} \\ e\_{\mathbb{C},2} \\ e\_{\mathbb{C},3} \\ e\_{\mathbb{R}} \\ f\_{0} \end{pmatrix} . \tag{2.11} \} \end{aligned}$$

*Note that the equation systems in* (2.10) *and* (2.11) *are equivalent to* (2.2)*. The division of the matrix in* (2.11) *into matrix blocks will be relevant in the following chapter.*

Example 2.22 gives a first hint that the matrix representations of a Dirac structure can be derived from the network equations of the system. The structured derivation of such representations is a central aspect of Chapter 3.

#### 2.2.3 Input-State-Output Port-Hamiltonian Systems

In this thesis, we consider the class of *explicit input-state-output PHSs*. This is a particularly important class of PHSs as it represents the starting point for the majority of controller and observer design methods from the port-Hamiltonian theory, see, e.g., Ortega et al. [2008], Venkatraman and van der Schaft [2010], Vincent et al. [2016], van der Schaft [2017], Yaghmaei and Yazdanpanah [2019b].

Explicit input-state-output PHSs have first been introduced in the 1990s; amongst others, pioneering works are from Maschke and van der Schaft [1992], Maschke et al. [1992], and van der Schaft and Maschke [1995]. Kugi [2001] was the first to use this system class to solve practical control engineering problems. Comprehensive information about the theoretical background of explicit inputstate-output PHSs can be found in the textbooks from Duindam et al. [2009], van der Schaft and Jeltsema [2014], and van der Schaft [2017]. The following definition is based on the latter:

**Definition 2.23 (Explicit input-state-output PHS with feedthrough)** *An explicit input-state-output PHS with feedthrough is an explicit state-space model of the form*

$$\mathbf{x} = \left(\mathbf{J}\left(\mathbf{x}\right) - \mathbf{R}\left(\mathbf{x}\right)\right) \frac{\partial H}{\partial \mathbf{x}}\left(\mathbf{x}\right) + \left(\mathbf{G}\left(\mathbf{x}\right) - \mathbf{P}\left(\mathbf{x}\right)\right)\mathbf{u},\tag{2.12a}$$

$$\mathbf{y} = \left(\mathbf{G}(\mathbf{x}) + \mathbf{P}(\mathbf{x})\right)^{\top} \frac{\partial H}{\partial \mathbf{x}}\left(\mathbf{x}\right) + \left(\mathbf{M}\left(\mathbf{x}\right) + \mathbf{S}\left(\mathbf{x}\right)\right)\mathbf{u},\tag{2.12b}$$

*where x* ∈ X ⊆ R *n , u* ∈ U ⊆ R *p , and <sup>y</sup>* <sup>∈</sup> <sup>Y</sup> <sup>⊆</sup> <sup>R</sup> *<sup>p</sup> are the state vector, the input vector, and the output vector, respectively. The Hamiltonian H is a continuously differentiable function with <sup>H</sup>* : <sup>X</sup> <sup>→</sup> <sup>R</sup> *that is bounded from below. The matrices <sup>J</sup>* (*x*)*, <sup>R</sup>* (*x*) <sup>∈</sup> <sup>R</sup> *n*×*n , G* (*x*)*, P* (*x*) ∈ R *n*×*p , M* (*x*)*, S* (*x*) ∈ R *<sup>p</sup>*×*<sup>p</sup> satisfy <sup>J</sup>* (*x*) = <sup>−</sup>*<sup>J</sup>* <sup>⊤</sup>(*x*)*, <sup>M</sup>* (*x*) = <sup>−</sup>*M*⊤(*x*)*, and*

$$\boldsymbol{\Theta}(\mathbf{x}) := \begin{pmatrix} \mathbf{R}(\mathbf{x}) & \mathbf{P}(\mathbf{x}) \\ \mathbf{P}^{\top}(\mathbf{x}) & \mathbf{S}(\mathbf{x}) \end{pmatrix} = \begin{pmatrix} \mathbf{R}(\mathbf{x}) & \mathbf{P}(\mathbf{x}) \\ \mathbf{P}^{\top}(\mathbf{x}) & \mathbf{S}(\mathbf{x}) \end{pmatrix}^{\top} \succeq \mathbf{0}, \,\forall \mathbf{x} \in \mathbb{X}. \tag{2.13}$$

In the remainder of this work, the class of explicit input-state-output PHSs is briefly denoted as *explicit PHSs*. The matrices, functions, and vectors in (2.12) allow for a deep physical interpretation which is an essential advantage of an explicit PHS over an ordinary state-space representation: the matrix *J* (*x*) represents the internal energy-preserving interconnection in the system; *R* (*x*) accounts for energy-dissipating effects; *G* (*x*), *P* (*x*), *M* (*x*), and *S* (*x*) specify the interaction between the system and its environment via the system ports. The Hamiltonian *H* is a storage function which is strongly related to the total energy contained in the system. The instantaneous power exchange between the system and its environment is given by *u* ⊤*y*.

A limitation of explicit PHSs is given for systems with irreversible thermodynamic processes. For such systems, the energy function is defined implicitly as a Legendre submanifold of the thermodynamic phase-space [Arnold, 1989, Appendix 4]. This implicit definition of the energy function impedes an explicit modeling.

In the sequel, we turn our attention to a well-known special case of (2.12), viz. to explicit PHSs without feedthrough.

#### **Definition 2.24 (Explicit PHS without feedthrough)**

*An explicit input-state-output PHS without feedthrough is an explicit statespace model of the form*

$$
\dot{\mathbf{x}} = \left( \mathbf{J}(\mathbf{x}) - \mathbf{R}(\mathbf{x}) \right) \frac{\partial H}{\partial \mathbf{x}}(\mathbf{x}) + \mathbf{G}(\mathbf{x}) \boldsymbol{\mu}, \tag{2.14a}
$$

$$\mathbf{y} = \mathbf{G}^{\top}(\mathbf{x}) \frac{\partial H}{\partial \mathbf{x}}(\mathbf{x}),\tag{2.14b}$$

*where <sup>x</sup>, <sup>u</sup>, <sup>y</sup>, and <sup>H</sup> as in Definition 2.23 and <sup>J</sup>* (*x*) = <sup>−</sup>*<sup>J</sup>* <sup>⊤</sup>(*x*)*, R* (*x*) = *R* <sup>⊤</sup>(*x*) ⪰ 0*.*

The PHS (2.14) is particularly transparent with respect to the underlying Dirac structure. The input-output representation of the Dirac structure (cf. Proposition 2.20) is specified by the skew-symmetric matrix

$$\mathbf{Z}(\mathbf{x}) = \begin{pmatrix} -\mathbf{J}(\mathbf{x}) & -\mathbf{G}\_{\mathbb{R}}(\mathbf{x}) & -\mathbf{G}(\mathbf{x}) \\ \mathbf{G}\_{\mathbb{R}}^{\top}(\mathbf{x}) & \mathbf{0} & \mathbf{0} \\ \mathbf{G}^{\top}(\mathbf{x}) & \mathbf{0} & \mathbf{0} \end{pmatrix}. \tag{2.15}$$

Hence, in the non-feedthrough case, the matrices *J* (*x*) and *G* (*x*) of the PHS (2.14) can directly be determined from the Dirac structure. Likewise, the matrix *R* (*x*) results from *R* (*x*) = *G*<sup>R</sup> (*x*)*R*˜ (*x*)*G* ⊤ R (*x*) for some resistive relation *<sup>f</sup>* <sup>R</sup> <sup>=</sup> <sup>−</sup>*R*˜ (*x*) *<sup>e</sup>*<sup>R</sup> with *R*˜ (*x*) = *R*˜ <sup>⊤</sup> (*x*) <sup>⪰</sup> 0. Our successive example illustrates the formulation of an explicit PHS based on a Dirac structure.

#### **Example 2.25:**

*Consider the three systems from Example 2.14. The energy-dissipating elements of the three systems obey a linear resistive relation of the form <sup>f</sup>*<sup>R</sup> <sup>=</sup> <sup>−</sup>*De*<sup>R</sup> *where <sup>D</sup>* <sup>=</sup> <sup>1</sup>/*R, <sup>D</sup>* <sup>=</sup> *<sup>b</sup>, and <sup>D</sup>* <sup>=</sup> <sup>1</sup>/*R*<sup>f</sup> *for the electromagnetic, mechanic, and hydraulic system, respectively. From the resistive relation*

*and the Dirac structure* (2.11) *we can calculate the following explicit PHS:*

$$\frac{d}{dt}\begin{pmatrix} \mathbf{x}\_1\\ \mathbf{x}\_2\\ \mathbf{x}\_3 \end{pmatrix} = (\begin{pmatrix} 0 & 0 & -1\\ 0 & 0 & 1\\ 1 & -1 & 0 \end{pmatrix} - \begin{pmatrix} 0 & 0 & 0\\ 0 & 0 & 0\\ 0 & 0 & D^{-1} \end{pmatrix}) \frac{\partial H}{\partial \mathbf{x}}(\mathbf{x}) + \begin{pmatrix} 1\\ 0\\ 0 \end{pmatrix} u,\tag{2.16a}$$

$$\mathbf{y} = \begin{pmatrix} 1 & 0 & 0 \end{pmatrix} \frac{\partial H}{\partial \mathbf{x}}(\mathbf{x}).\tag{2.16b}$$

*The states in* (2.16) *correspond to the generalized states of the energystoring elements of the systems. For the electromagnetic system, the states x*<sup>1</sup> *and x*<sup>2</sup> *are given by the charges Q*<sup>1</sup> *and Q*<sup>2</sup> *on the capacitors C*<sup>1</sup> *and C*2*, respectively; the state x*<sup>3</sup> *relates to the flux linkage of the inductor L. The input and output of the model are given by the current I*<sup>0</sup> *and the voltageV*0*, respectively. For the mechanic and hydraulic systems, one can draw similar correspondences as summarized in the following table:*


*The Hamiltonian in* (2.16) *is the sum of the energies of the individual energy-storing elements and can be expressed as*

$$H(\mathbf{x}) = \frac{1}{2} \mathbf{x}^{\top} \begin{pmatrix} q\_1 & 0 & 0 \\ 0 & q\_2 & 0 \\ 0 & 0 & q\_3 \end{pmatrix} \mathbf{x},\tag{2.17}$$

*where q*1*, q*2*, q*<sup>3</sup> *are equal to C* −1 1 *, C* −1 2 *, L* −1 *for the electromagnetic system; m* −1 1 *, m* −1 2 *, k for the mechanic system; and C* −1 f,1 *, C* −1 f,2 *, L* −1 f *for the hydraulic system.*

The previous example shows that PHSs can be used to model systems from different domains in a unifying framework. The three systems are *form equivalent* and lead to structurally identical port-Hamiltonian models. This, however, is an

absolute special case. In general, different systems will lead to port-Hamiltonian models of different structures.

Example 2.25 illustrates that a PHS preserves the underlying physical structure of the system and therewith allows for a deep physical insight. Moreover, we have seen that a port-Hamiltonian modeling approach differentiates between the network model and the constitutive relations of the components. The Dirac structure is the connecting element as it links the generalized port variables to the constitutive relations of the components connected to the ports. This gives the port-Hamiltonian approach a high degree of modularity.

Another advantageous property of explicit PHSs is that they are inherently *passive*.

#### **Proposition 2.26 (Passivity of explicit PHSs)**

*The explicit PHS from Definition 2.23 is passive. Moreover, if the matrix* Θ (*x*) *in* (2.13) *is positive-definite for all <sup>x</sup>* <sup>∈</sup> <sup>X</sup>*, the PHS is strictly passive.*

#### Proof:

The proof can be found in Appendix A.1.

*Remark* 2.27 (Passivity of non-feedthrough PHSs)*.* The claim from Proposition 2.26 applies also for the PHS from Definition 2.24. For strict passivity, the requirement of positive definiteness in (2.13) simplifies to *R* (*x*) = *R* <sup>⊤</sup>(*x*) <sup>≻</sup> <sup>0</sup> for all *<sup>x</sup>* <sup>∈</sup> <sup>X</sup>.

The inherent passivity of PHSs facilitates the use of this system class for passivity-based control design techniques [van der Schaft, 2017]. In Chapter 4, the passivity of PHSs will be exploited for the automated model-based design of observers.

Another noteworthy property of an explicit PHS is that the system output *y* is determined mainly on the basis of physical considerations, cf. Example 2.25. Hence, in general, the output variables are different from the measured variables.<sup>2</sup> This will also be taken into account in Chapter 4.

This concludes the fundamentals chapter. Based on this groundwork, we will develop port-Hamiltonian methods for an automated model generation and observer design in the following two chapters.

<sup>2</sup>An exception in which the output variables coincide with the measurement variables is given for a collocated actuator/sensor configuration.

# Chapter 3

## Automated Model Generation

This chapter addresses the development of methods for an automated generation of explicit port-Hamiltonian models for interconnected systems. First, in Section 3.1 we review the techniques that are available in the literature for describing an interconnected systems as a PHS. We will identify a research gap in which existing methods suffer from different shortcomings impeding an automated model generation. Based on this research gap the aims of this chapter are formulated. Section 3.2 addresses these aims by deriving new methods for the modeling of interconnected systems as PHSs. These methods constitute algorithms which allow for the automated generation of explicit PHSs. The results from Section 3.2 will be discussed in Section 3.3. The chapter ends with a brief summary of the main insights in Section 3.4.

## 3.1 Literature Review

There have been different approaches for the derivation of port-Hamiltonian models of interconnected systems. The basic idea of these approaches is to formulate a PHS by describing the topological structure of the system as a graph. The available methods from the literature are detailed in the sequel.

A pioneering work on the graph-based derivation of PHSs stems from Kugi [2001]. The author describes electromagnetic systems as directed graphs. Based on the graph description, a method for the structured derivation of an explicit port-Hamiltonian model is proposed. Another milestone in this field stems from van der Schaft and Maschke [2013]. The authors describe various interconnected systems as open directed graphs. Based on the directed graphs, explicit port-Hamiltonian models are obtained. Fiaz et al. [2013] take up the idea from van der Schaft and Maschke [2013] and propose a systematic framework for the portHamiltonian modeling of power networks. Circuit graphs are used by Falaize and Hélie [2016] to derive port-Hamiltonian models of analog circuits. The method from Falaize and Hélie [2016] has been implemented in a Python tool to enable an automated model generation of differential-algebraic equation (DAE) models, see Falaize and Hélie [2019]. Another graph approach is proposed by Scheuermann et al. [2020]. The authors use solid graphs to derive discrete-time port-Hamiltonian models for the heat transfer in metallic foams. A graph-based port-Hamiltonian model for adaptive mechanic structures has been presented by Warsewa et al. [2020]. Gernandt et al. [2021] derive a method for a graph-based modeling of nonlinear electrical circuits as implicit PHSs.

The above graph-based approaches are easy to automate and allow for a timeefficient modeling of different classes of interconnected systems. However, as pointed out in the conclusion of van der Schaft and Maschke [2013], approaches based on classical graphs are limited to conservation or balance laws within a particular physical domain. This is emphasized by the fact that each of the above-mentioned graph-based modeling techniques aims at a special class of interconnected systems. Hence, these approaches cannot be applied for a wide class of interconnected systems. In particular, they disallow for a treatment of multi-domain systems.

The bond graph methodology is a promising framework to overcome the limitations imposed by classical graph approaches [van der Schaft and Maschke, 2013]. Bond graphs are a domain-neutral graphical representation of physically networked systems. By this, bond graphs are an ideal starting point for the modeling of a large class of interconnected systems involving the electric, mechanic, hydraulic, thermal, and chemical domains [Breedveld, 2009, p. 24]. The bond graph concept was devised by Paynter [1961] and refined by Karnopp, Rosenberg, and others. For a thorough introduction into the bond graph framework refer to Borutzky [2010] or Karnopp et al. [2012]. For the derivation of a PHS, bond graphs are particularly appealing as both—bond graphs and PHSs—share the same physically unifying power- and energy-based modeling paradigm.

Rosenberg [1971] was the first to systematically derive a state-space formulation of bond graphs. The method is based on a mathematical representation of the bond-graph referred to as field representation. The formulation of a bond graph as a PHS was first investigated by Golo et al. [2003]. The authors show that each well-posed bond graph permits an implicit port-Hamiltonian formulation. Such an implicit PHS aims at a use in numerical simulations. For the design of port-Hamiltonian control methods, however, an explicit PHS is required. The transfer

from an implicit to an explicit port-Hamiltonian representation is non-trivial. In particular, as will be seen later, the existence of an explicit port-Hamiltonian formulation of a bond graph is not guaranteed, even if the bond graph is well-posed. Lopes [2016] addresses the formulation of a bond graph as differential-algebraic PHS. It has been shown that such a differential-algebraic PHS can possibly be transferred into an explicit input-state-output PHS [Lopes, 2016]. Concerning this transfer, there exists a sufficient condition which, however, is restrictive as it demands some block matrices of the underlying Dirac structure to be zero. A necessary condition for the existence of an explicit port-Hamiltonian formulation of a bond graph is missing in the literature. Donaire and Junco [2009] provide a method transferring a class of causal bond graphs to an explicit input-state-output PHS. The approach is restricted to non-feedthrough systems. As with Rosenberg [1971], the starting point of Donaire and Junco [2009] is a bond graph field representation. In the field representation, the authors assume some of the block matrices to be constant or zero. Dai [2016] proposes a concept for formulating bond graphs as simulation models with port-Hamiltonian dynamics. However, the models are not formulated as input-state-output PHSs and are restricted to a use in numerical simulations.

As can be seen from the above, bond graphs are a promising starting point for the generation of port-Hamiltonian models. Nevertheless, the automated explicit port-Hamiltonian formulation of bond graphs has only been treated for various special cases in literature so far. Lopes [2016] and Donaire and Junco [2009] address this topic but are restricted to particular classes of bond graphs. Moreover, the literature lacks necessary conditions for the existence of an explicit port-Hamiltonian formulation of bond graphs. The results of Lopes [2016] suggest that an automated generation of port-Hamiltonian models from bond graphs is possible. However, a specific method which can be fully automated is missing.

The remainder of this chapter addresses the automated generation of explicit port-Hamiltonian models from bond graphs. The specific aims are:


## 3.2 Main Results

The previous section stated the aims of this chapter. This section presents the the main results to reach these aims. Subsection 3.2.1 first present the solution strategy. Afterwards, subsections 3.2.2 to 3.2.6 follow a stepwise procedure which will lead to the main results to be presented in subsections 3.2.7 and 3.2.8. The results from this research have been reported by Pfeifer et al. [2019b], Pfeifer et al. [2020a], Pfeifer et al. [2020b].

#### 3.2.1 Basic Idea and Notation

PHSs and bond graphs are related by their port- and energy-based foundations. The leading idea of the following subsections is to exploit this relationship to a high degree. To this end, we strictly distinguish between balance equations and constitutive relations. The former are described by means of a Dirac structure. Transferring this Dirac structure from an implicit to an explicit representation will be the crucial step on the way to an explicit PHS.

The structure of the approach is depicted in Figure 3.1. Subsection 3.2.2 initially presents a formal description of a bond graph. The formalized bond graph builds the basis for an algorithmic implementation of the developed methods. In Subsection 3.2.3, the power-conserving, energy-routing elements of the bond graph are described by a set of Dirac structures in implicit form. The set of Dirac structures is composed into one single Dirac structure in Subsection 3.2.4. In Subsection 3.2.5, we transfer the composite Dirac structure from an implicit to an explicit representation. Based on the constitutive relations of storages and resistors from Subsection 3.2.2 and the explicit form of the Dirac structure, an explicit port-Hamiltonian formulation of a bond graph is derived in Subsection 3.2.6. Subsection 3.2.7 summarizes the insights from the previous sections in a theorem and a corresponding algorithm. Subsection 3.2.8 refines the result from Subsection 3.2.7 for a case of particular practical interest, viz. for bond graphs containing dependent storages.

This section makes use the following notation. Let G = (V,B) be a directed graph. G is *weakly connected* if replacing its directed edges with undirected edges yields a connected (undirected) graph. The set

$$\mathbb{B}(\mu) := \{ (\nu, \mu), (\mu, \nu) \in \mathbb{B} \mid \nu \in \mathbb{V} \}\tag{3.1}$$


**Figure 3.1:** Structure of the approach for an automated generation of explicit PHSs from bond graphs

with *<sup>M</sup>*(*u*) :<sup>=</sup> <sup>|</sup>B(*u*)<sup>|</sup> contains all incident edges at *<sup>u</sup>* <sup>∈</sup> <sup>V</sup>. The sets

$$\overleftarrow{\mathbb{B}}\left(\mu\right) := \{ (\nu, \mu) \in \mathbb{B} \mid \nu \in \mathbb{V} \},\tag{3.2a}$$

$$\overrightarrow{\mathbb{E}}\,(\mathsf{u}) \coloneqq \{ (\mathsf{u}, \mathsf{v}) \in \mathbb{B} \mid \mathsf{v} \in \mathbb{V} \}\tag{3.2b}$$

are the ingoing and outgoing edges at *<sup>u</sup>* <sup>∈</sup> <sup>V</sup>, respectively. Moreover, let <sup>M</sup> be a set of indices. For each *<sup>i</sup>* <sup>∈</sup> <sup>M</sup>, let *<sup>A</sup><sup>i</sup>* <sup>∈</sup> <sup>R</sup> *<sup>n</sup>*×*m<sup>i</sup>* be a matrix with *n* rows and *m<sup>i</sup>* columns. For the horizontal concatenation of all *A<sup>i</sup>* we write (*Ai*) and append "for all *<sup>i</sup>* <sup>∈</sup> <sup>M</sup>". Further, for each *<sup>i</sup>* <sup>∈</sup> <sup>M</sup>, suppose a (column) vector *<sup>x</sup><sup>i</sup>* <sup>∈</sup> <sup>R</sup> *n* . For the vertical concatenation of all *<sup>x</sup><sup>i</sup>* we write (*xi*) and append "for all *<sup>i</sup>* <sup>∈</sup> <sup>M</sup>".

#### 3.2.2 Bond Graph Formalization

Let us consider *<sup>K</sup>*-dimensional bond graphs (*<sup>K</sup>* <sup>∈</sup> <sup>N</sup>≥<sup>1</sup>) in the generalized bond graph framework<sup>1</sup> with the following types of elements: storages (C), modulated resistors (R), sources of flow (Sf), sources of effort (Se), 0-junctions (0), 1-junctions (1), modulated transformers (TF) and modulated gyrators (GY). Figure 3.2 illustrates the graphical representations of the different types of elements. The set

$$\mathbb{E} := \{ \mathbf{C}, \mathbf{R}, \mathbf{S}f, \mathbf{S}e, 0, 1, \mathbf{TF}, \mathbf{GY} \}\tag{3.3}$$

collects the different types of elements. We now describe the topology of a bond graph by a directed graph. For each <sup>α</sup> <sup>∈</sup> <sup>E</sup>, let us define a set <sup>V</sup><sup>α</sup> of cardinality

<sup>1</sup> In contrast to the standard bond graph framework, the generalized bond graph framework comprises only one type of storage elements, viz. C-type storages [Breedveld, 2009, p. 24].

**Figure 3.2:** Graphical representation of different types of bond graph elements

*<sup>N</sup>*<sup>α</sup> :<sup>=</sup> <sup>|</sup>Vα<sup>|</sup> which contains all elements of type <sup>α</sup>. Elements of type C, R, Sf, Se are denoted as *exterior elements*; elements of type 0, 1, TF, GY are referred to as *interior elements*. The sets of exterior and interior elements are defined as

$$\mathbb{V}\_{\rm E} := \mathbb{V}\_{\rm C} \cup \mathbb{V}\_{\rm R} \cup \mathbb{V}\_{\rm Sf} \cup \mathbb{V}\_{\rm Se}, \qquad \mathbb{V}\_{\rm E} := |\mathbb{V}\_{\rm E}|, \tag{3.48a}$$

$$N\_{\rm I} := \mathbb{A}\_0 \cup \mathbb{V}\_{\rm I} \cup \mathbb{V}\_{\rm TF} \cup \mathbb{V}\_{\rm GY}, \qquad N\_{\rm I} := |\mathbb{V}\_{\rm I}|, \tag{3.4b}$$

respectively. The union <sup>V</sup> :<sup>=</sup> <sup>∪</sup>α∈EV<sup>α</sup> <sup>=</sup> <sup>∪</sup>α∈{E,I}V<sup>α</sup> is the set of all bond graph elements (*<sup>N</sup>* :<sup>=</sup> <sup>|</sup>V|). The *<sup>N</sup>* elements of <sup>V</sup> are connected by a set <sup>B</sup> of *<sup>M</sup>* bonds, i.e., *<sup>M</sup>* :<sup>=</sup> <sup>|</sup>B|. Each bond *<sup>j</sup>* <sup>∈</sup> <sup>B</sup> carries a flow *<sup>f</sup> <sup>j</sup>* ∈ R *<sup>K</sup>* and an effort *<sup>e</sup> <sup>j</sup>* <sup>∈</sup> R *K* ∗ . 2

The directed graph G = (V,B) describes the topology of the bond graph. Analogous to the naming of elements, we define sets of exterior and interior bonds:

$$\mathbb{E}\mathbb{E}\_{\mathrm{E}} := \{ (\mu, \nu), (\nu, \mu) \in \mathbb{B} \mid \nu \in \mathbb{V}\_{\mathrm{E}}, \mu \in \mathbb{V}\_{\mathrm{I}} \}, \qquad \mathrm{M}\_{\mathrm{E}} := |\mathbb{B}\_{\mathrm{E}}|, \tag{3.5a}$$

BI := {(*u*, *v*) ∈ B | *u*, *v* ∈ VI}, *M*<sup>I</sup> := |BI|. (3.5b)

The set B<sup>E</sup> contains bonds which connect an exterior element to an interior element; B<sup>I</sup> contains bonds which connect two interior elements with each other.<sup>3</sup> We consider bond graphs that are non-degenerate, i.e., bond graphs where G = (V,B) is weakly connected, and where each exterior element is connected by exactly one bond to one interior element, i.e., for each *<sup>v</sup>* <sup>∈</sup> <sup>V</sup><sup>E</sup> we have <sup>V</sup>(*v*) <sup>⊂</sup> <sup>V</sup><sup>I</sup>

<sup>2</sup>As R *K* ∗ is isomorphic to R *<sup>K</sup>* it is identified with R *K*.

<sup>3</sup>Without loss of generality we exclude the presence of bonds interlinking two exterior elements.

with <sup>|</sup>B(*v*)<sup>|</sup> <sup>=</sup> <sup>1</sup> and <sup>|</sup>V(*v*)<sup>|</sup> <sup>=</sup> 1. Moreover, we use the bond orientation rules from standard bond graph literature [Borutzky, 2010, p. 59] in which bonds are incoming to storages and resistors and outgoing from sources of flow and effort. Without loss of generality, we assume each transformer and each gyrator to have exactly one incoming and exactly one outgoing bond in order to enable an unambiguous definition of transformer and gyrator ratios.

Next, we define and analyze an essential part of the bond graph, viz. the *junction structure*.

#### **Definition 3.1 (Junction structure)**

*The junction structure of a bond graph is the subgraph* <sup>G</sup><sup>I</sup> <sup>⊂</sup> <sup>G</sup> *with* <sup>G</sup><sup>I</sup> <sup>=</sup> (VI,BI)*.*

#### **Property 3.2 (Bond graph properties)**

*From the properties of a non-degenerate bond graph, it follows:* G<sup>I</sup> *is weakly connected,* B = B<sup>E</sup> ∪B<sup>I</sup> *, and M*<sup>E</sup> = *N*E*.*

So far, we described the topology of the bond graph by means of a directed graph. Next, we formalize the constitutive relations of the bond graph elements. To this end, let us first make the following two assumptions:

#### **Assumption 3.3 (Modulation)**

*Modulation of resistors, transformers and gyrators can be expressed only in dependence on states of* C*-type elements and constant parameters.*

#### **Assumption 3.4 (Dissipation)**

*The constitutive relations of modulated resistors are linear with respect to the respective power-port variables and in Onsager form.*<sup>4</sup>

Borutzky [2010, p. 159] has shown that bond graphs violating Assumption 3.3 cannot in general be formulated in an explicit form. Likewise, Assumption 3.4 is a well-known requirement for formulating an explicit PHS of the form (2.12) (cf. van der Schaft and Jeltsema [2014, p. 53]).

Now the constitutive relations for the different types of bond graph elements can be specified.

<sup>4</sup>For the notion of the Onsager form, refer to Borutzky [2010, p. 364].

◦ Each storage element *<sup>i</sup>* <sup>∈</sup> <sup>V</sup><sup>C</sup> is specified by a constitutive relation of the form

$$\mathbf{f}\_{\ j} = \dot{\mathbf{x}}\_{l}, \qquad \mathbf{e}\_{\dot{\jmath}} = \frac{\partial V\_{l}}{\partial \mathbf{x}\_{l}}(\mathbf{x}\_{l}), \tag{3.6}$$

with *<sup>j</sup>* <sup>∈</sup> <sup>B</sup>(*i*) and energy state *<sup>x</sup><sup>i</sup>* <sup>∈</sup> <sup>X</sup>*i*, dim(X*i*) = *<sup>K</sup>* (cf. [Borutzky, 2010, p. 357]). The function *<sup>V</sup><sup>i</sup>* : <sup>X</sup>*<sup>i</sup>* <sup>→</sup> <sup>R</sup>, *<sup>x</sup><sup>i</sup>* 7→ *<sup>V</sup>i*(*xi*) is a differentiable storage function that is bounded from below. This storage function describes the energy contained in storage *i*. The energy states of all storage elements are collected in an overall energy state *<sup>x</sup>* := (*xi*) for all *<sup>i</sup>* <sup>∈</sup> <sup>V</sup><sup>C</sup> with *<sup>x</sup>* <sup>∈</sup> <sup>X</sup>, dim(X) = *KN*C. The composite storage function *<sup>V</sup>*(*x*) :<sup>=</sup> <sup>∑</sup>*i*∈V<sup>C</sup> *<sup>V</sup>i*(*xi*) describes the energy of all storages.<sup>5</sup>

◦ Each resistive element *<sup>i</sup>* <sup>∈</sup> <sup>V</sup><sup>R</sup> is given by a constitutive relation in Onsager (conductance) form [Borutzky, 2010, p. 365]

$$\mathbf{f}\_{\ j} = \mathbf{D}\_{i}(\mathbf{x})\mathbf{e}\_{j},\tag{3.7}$$

with *j* ∈ B(*i*), *Di*(*x*) ∈ R *<sup>K</sup>*×*<sup>K</sup>*, and *Di*(*x*) = *Di*(*x*) <sup>⊤</sup> <sup>⪰</sup> 0. The matrices *<sup>D</sup>i*(*x*) are collected in an overall dissipation matrix *D*(*x*) := blkdiag(*Di*(*x*)) for all *<sup>i</sup>* <sup>∈</sup> <sup>V</sup><sup>R</sup> with *<sup>D</sup>*(*x*) = *<sup>D</sup>*(*x*) <sup>⊤</sup> ⪰ 0.

◦ Elements *<sup>i</sup>* of type 0 and type 1 obey

$$i \in \mathbb{V}\_0: \sum\_{\substack{j \in \overline{\mathbb{B}}(i) \ j}} \mathbf{f}\_j - \sum\_{\substack{j \in \overline{\mathbb{B}}(i) \ j}} \mathbf{f}\_j = \mathbf{0}, \quad \mathbf{e}\_j = \mathbf{e}\_k, \quad \forall j, k \in \mathbb{B}(i) \tag{3.8}$$

and

$$i \in \mathbb{V}\_1: \sum\_{\substack{j \in \overline{\mathbb{B}}(i) \ j \in \overline{\mathbb{B}}(j)}} \mathbf{e}\_j - \sum\_{\substack{j \in \overline{\mathbb{B}}(i) \ j \end{pmatrix}} \mathbf{e}\_j = \mathbf{0}, \quad \mathbf{f}\_j = \mathbf{f}\_k, \quad \forall j, k \in \mathbb{B}(i). \tag{3.9}$$

<sup>5</sup>Note that from the properties of *Vi*(*xi*) it follows that *V*(*x*) is differentiable and bounded from below.

◦ Transformers and gyrators are determined by constitutive relations of the form

$$i \in \mathbb{V}\_{\text{TF}} : \qquad \mathbf{f}\_j = \mathbf{U}\_i(\mathbf{x}) \, \mathbf{f}\_k, \quad \mathbf{e}\_k = \mathbf{U}\_i^\top(\mathbf{x}) \, \mathbf{e}\_j,\tag{3.10}$$

and

$$\dot{\boldsymbol{a}} \in \mathbb{V}\_{\rm GY} : \qquad \mathbf{e}\_{j} = \mathbf{W}\_{i}(\mathbf{x}) \, \mathbf{f}\_{k}, \quad \mathbf{e}\_{k} = \mathbf{W}\_{i}^{\top}(\mathbf{x}) \, \mathbf{f}\_{j}, \tag{3.11}$$

where *j* ∈ ←− B (*i*), *k* ∈ −→<sup>B</sup> (*i*) [Borutzky, 2010, pp. 358–359]. The square matrices *<sup>U</sup>i*(*x*) and *<sup>W</sup> <sup>i</sup>*(*x*) have full rank *<sup>K</sup>* for all *<sup>x</sup>* <sup>∈</sup> <sup>X</sup> and are assembled in a transformer matrix *U* (*x*) := blkdiag(*Ui*(*x*)) and a gyrator matrix *<sup>W</sup>* (*x*) :<sup>=</sup> blkdiag(*<sup>W</sup> <sup>i</sup>*(*x*)) for all *<sup>i</sup>* <sup>∈</sup> <sup>V</sup>TF and <sup>V</sup>GY, respectively.

Source elements *<sup>i</sup>* <sup>∈</sup> <sup>V</sup>Sf <sup>∪</sup>VSe describe conditions at the system boundary. Thus, these elements are not subject to specific constitutive relations.

Now we have all prerequisites for a formal definition of a *bond graph*.

**Definition 3.5 (Bond graph)** *Let assumptions 3.3 and 3.4 hold. A bond graph is a tuple*

$$
\mathcal{AB}\emptyset := \left( \mathbb{V}, \mathbb{B}, \mathbb{X}, \mathbb{V}, \mathbf{D}, \mathbf{U}, \mathbf{W}, K \right), \tag{3.12}
$$

*with a set of elements* V*, a set of bonds* B*, a state-space* X*, an energy storage function <sup>V</sup>* : <sup>X</sup> 7→ <sup>R</sup>*, a dissipation matrix <sup>D</sup>* (*x*)*, a transformer matrix U* (*x*)*, a gyrator matrix W* (*x*)*, and dimension K. The matrices D*,*U*,*W are parametrized over <sup>x</sup>* <sup>∈</sup> <sup>X</sup>*.*

*Remark* 3.6 (Single- und multi-bond graphs)*.* In the literature, bond graphs with *K* = 1 are referred to as single-bond graphs and bond graphs with *K* > 1 are denoted as multi-bond graphs Borutzky [2010]. Unless stated otherwise, the term "bond graph" refers to a multi-bond graph.

In the following, the formal definition of a bond graph is applied to an example system. In the course of chapters 3 and 4, this example system will continuously be used to exemplify the developed methods. This demonstrates the algorithmic nature of these methods.

#### **Example 3.7:**

*Consider the K-dimensional bond graph in Figure 3.3.*

1 TF: *U*(*x*1) 0 GY: *I* Se Sf C: *V*1(*x*1) C: *V*2(*x*2) R: *D* C: *V*3(*x*3) *e*1 *f* 1 *e*2 *f* 2 *e*<sup>3</sup> *f* <sup>3</sup> *e*C<sup>3</sup> *f* <sup>C</sup><sup>3</sup> *e*Sf *f* Sf *e*Se *f* Se *e*<sup>R</sup> *f* <sup>R</sup> *e*C<sup>1</sup> *f* <sup>C</sup><sup>1</sup> *e*C<sup>2</sup> *f* <sup>C</sup><sup>2</sup>

**Figure 3.3:** Exemplary bond graph

*The elements and bonds are summarized in* <sup>V</sup> <sup>=</sup> <sup>V</sup><sup>E</sup> <sup>∪</sup> <sup>V</sup><sup>I</sup> *,* B = B<sup>E</sup> ∪ B<sup>I</sup> *, respectively, with* <sup>V</sup><sup>E</sup> <sup>=</sup> {*C*1,*C*2,*C*3,*R*,*S f*,*Se*}*,* <sup>V</sup><sup>I</sup> <sup>=</sup> {0,1,*T F*,*GY*}*,* <sup>B</sup><sup>E</sup> <sup>=</sup> {*C*1,*C*2,*C*3,*R*,*S f*,*Se*}*, and* <sup>B</sup><sup>I</sup> <sup>=</sup> {1,2,3}*. Note that in Figure 3.3 the elements of* B *are not explicitly highlighted but can be identified from the indices of the efforts and flows. The system state vector is x* = *x* ⊤ 1 *x* ⊤ 2 *x* ⊤ 3 ⊤ ∈ X *where*

$$\mathbb{X} = \{ \begin{pmatrix} \mathbf{x}\_1 \\ \mathbf{x}\_2 \\ \mathbf{x}\_3 \end{pmatrix} \in \mathbb{R}^{\otimes K} \mid ||\mathbf{x}\_1|| < \ast \}. \tag{3.13}$$

*Suppose an arbitrary, differentiable, non-negative storage function*

$$V\left(\mathbf{x}\right) = V\_1(\mathbf{x}\_1) + V\_2(\mathbf{x}\_2) + V\_3(\mathbf{x}\_3). \tag{3.14}$$

*The* <sup>R</sup>*-type element is specified by a matrix <sup>D</sup>* <sup>∈</sup> <sup>R</sup> *<sup>K</sup>*×*<sup>K</sup> with D* = *D* <sup>⊤</sup> ≻ 0*. The transformer T F is modulated by x*1*. The transformation ratio is given by a full rank matrix U* (*x*) = *U* <sup>⊤</sup> (*x*) ∈ R *<sup>K</sup>*×*<sup>K</sup> with*

$$\mathcal{U}(\mathfrak{x}\_{\mathsf{l}}) = \exp\left(-\mathsf{x}\,\mathrm{diag}(\mathfrak{x}\_{\mathsf{l}})\right). \tag{3.15}$$

*where* exp(·) *denotes the matrix exponential. The gyrator GY has a constant gyration ration of <sup>W</sup>* <sup>=</sup> *<sup>I</sup>* <sup>∈</sup> <sup>R</sup> *<sup>K</sup>*×*<sup>K</sup>. The formal description of the bond-graph* *from Figure 3.3 is then given by*

$$\begin{split} \mathcal{AB}\mathcal{Y} &= \left( \left\{ \mathbf{C}\_{1}, \mathbf{C}\_{2}, \mathbf{C}\_{3}, \mathbf{R}, \mathbf{S}f, \mathbf{S}e, \mathbf{0}, 1, TF, GY \right\}, \left\{ \mathbf{C}\_{1}, \mathbf{C}\_{2}, \mathbf{C}\_{3}, \mathbf{R}, \mathbf{S}f, \mathbf{S}e, 1, 2, 3 \right\}, \\ &\mathbb{X}, V\_{1}(\mathbf{x}\_{1}) + V\_{2}(\mathbf{x}\_{2}) + V\_{3}(\mathbf{x}\_{3}), \mathbf{D}, \exp\left( -\mathbf{x} \, \text{diag}(\mathbf{x}\_{1}) \right), \mathbf{I}, \mathbf{K} \right), \end{split} \tag{3.16}$$

#### *where* X *and D as described above.*

Recall that the problem addressed in this chapter is to derive an automatable modeling method that transfers a bond graph into an explicit input-state-output PHS. In this context, it is crucial that such a PHS respects the causality of the source elements of the bond graph. In other words, the input vector of the PHS has to include flows of Sf elements and efforts of Se elements, while the output vector has to include efforts of Sf elements and flows of Se elements. This is formalized in the following property:

#### **Property 3.8 (Inputs and outputs)**

*Let* <sup>B</sup><sup>α</sup> <sup>=</sup> <sup>∪</sup>*i*∈VαB(*i*) *for* <sup>α</sup> ∈ {Sf,Se}*. The input vector <sup>u</sup> consists of* (*<sup>f</sup> j* )*,* (*ek*) *while the output vector y consists of* (*e <sup>j</sup>*)*,* (*f <sup>k</sup>* ) *for all <sup>j</sup>* <sup>∈</sup> <sup>B</sup>Sf*, <sup>k</sup>* <sup>∈</sup> <sup>B</sup>Se*.*

Based on Definition 3.5 and Property 3.8 we may now formally specify the problem under consideration.

**Problem 3.9 (Automated port-Hamiltonian formulation of a bond graph)** *Given a bond graph as in Definition 3.5. What is an automated modeling method that formulates the bond graph as a PHS* (2.12) *with Property 3.8? Under which conditions does such a port-Hamiltonian formulation of a bond graph exist?*

In the following subsections 3.2.3 to 3.2.6, we elaborate a solution to Problem 3.9.

#### 3.2.3 Description of Interior Elements as Dirac Structures

Let us first focus on the junction structure of the bond graph. The idea in this subsection is to describe each element of the junction structure by a dedicated

<sup>6</sup>The state-space is restricted to bounded values of *x*<sup>1</sup> in order to ensure the full rank property of the matrix (3.15) for all *<sup>x</sup>* <sup>∈</sup> <sup>X</sup>.

Dirac structure. For the Dirac structure we formulate a generic pattern which makes its generation appealing for an automation. Before we consider the main lemma of this subsection, viz. Lemma 3.12, we introduce two preliminary statements. In the sequel, we will often modify flows and efforts from Dirac structures by means of permutations. If the flows and efforts of a particular Dirac structure are permuted in the same manner, this can be seen as a change of basis. Intuitively, such a change of basis should not alter the fact that the considered vector space is a Dirac structure. Proposition 3.10 and Corollary 3.11 formally analyze this intuition and provide a practical calculation law to formulate the Dirac structure in the new coordinates.

#### **Proposition 3.10 (Orthogonal transformation)**

*Consider a modulated Dirac structure* (2.4) *and let <sup>T</sup>* (*x*) <sup>∈</sup> <sup>O</sup>(*n*) *be a family of orthogonal matrices parametrized over <sup>x</sup>* <sup>∈</sup> <sup>X</sup>*. Then*

$$\tilde{\mathbb{D}}(\mathbf{x}) = \{ (\tilde{\mathbf{f}}, \tilde{\mathbf{e}}) \in \mathbb{R}^n \times \mathbb{R}^n \, | \, \tilde{\mathbf{F}}(\mathbf{x}) \tilde{\mathbf{f}} + \tilde{\mathbf{E}}(\mathbf{x}) \tilde{\mathbf{e}} = \mathbf{0} \}\tag{3.17}$$

*with F*˜ (*x*) = *F* (*x*)*T* (*x*) ⊤ *, E*˜ (*x*) = *E* (*x*)*T* (*x*) ⊤ *is a modulated Dirac structure.*

#### Proof:

Inserting *f* = *T* (*x*) ⊤ ˜ *f* and *e* = *T* (*x*) ⊤ *e*˜ into (2.4) gives (3.17). Equation (3.17) is a Dirac structure as it fulfills (2.5):

$$(i)\ \tilde{\boldsymbol{F}}\left(\mathbf{x}\right)\tilde{\boldsymbol{E}}^{\top}\left(\mathbf{x}\right) + \tilde{\boldsymbol{E}}\left(\mathbf{x}\right)\tilde{\boldsymbol{F}}^{\top}\left(\mathbf{x}\right) = \boldsymbol{\mathcal{F}}\left(\mathbf{x}\right)\boldsymbol{\mathcal{E}}^{\top}\left(\mathbf{x}\right) + \boldsymbol{\mathcal{E}}\left(\mathbf{x}\right)\boldsymbol{\mathcal{F}}^{\top}\left(\mathbf{x}\right) = \mathbf{0}, \quad \text{(3.18a)}$$

$$(ii)\ \text{rank}\left(\tilde{\boldsymbol{F}}\left(\mathbf{x}\right)\quad\tilde{\boldsymbol{E}}\left(\mathbf{x}\right)\right) = \text{rank}\left(\left(\boldsymbol{\mathcal{F}}\left(\mathbf{x}\right)\quad\boldsymbol{\mathcal{E}}\left(\mathbf{x}\right)\right)\boldsymbol{\mathcal{T}}^{\top}\left(\mathbf{x}\right)\right)$$

$$= \text{rank}\left(\boldsymbol{\mathcal{F}}\left(\mathbf{x}\right)\quad\boldsymbol{\mathcal{E}}\left(\mathbf{x}\right)\right) = n. \tag{3.18b}$$

$$\mathbb{D}$$

**Corollary 3.11 (Equivalent Dirac structures)** *Given two vector spaces* <sup>D</sup>*i*(*x*) = {(*<sup>f</sup> i* , *ei*) ∈ R *<sup>n</sup>*×<sup>R</sup> *n* | *Fi*(*x*) *f <sup>i</sup>*+*Ei*(*x*) *e<sup>i</sup>* = 0} *with <sup>x</sup>* <sup>∈</sup> <sup>X</sup>*, <sup>i</sup>* ∈ {1,2}*. If for every <sup>x</sup>* <sup>∈</sup> <sup>X</sup> *there exists a <sup>T</sup>* (*x*) <sup>∈</sup> <sup>O</sup>(*n*) *such that*

(*f* <sup>1</sup> , *e*1) 7→ (*T* (*x*) *f* <sup>1</sup> ,*T* (*x*) *e*1) *is a bijection between* D<sup>1</sup> (*x*) *and* D<sup>2</sup> (*x*)*, then "*D<sup>1</sup> (*x*) *is a Dirac structure" is equivalent to "*D<sup>2</sup> (*x*) *is a Dirac structure".*

#### Proof:

The proof follows directly from a twofold application of Lemma 3.10.

Now follows the main lemma of this subsection. This lemma makes use of the following notation: <sup>0</sup>*<sup>K</sup>* is the *<sup>K</sup>* <sup>×</sup>*K*-dimensional zero matrix; <sup>0</sup> *a*,*b K* is an (*a*×*b*) block matrix of zero matrices <sup>0</sup>*K*. Analogously, *<sup>I</sup><sup>K</sup>* is the *<sup>K</sup>* <sup>×</sup> *<sup>K</sup>*-dimensional identity matrix and *I a*×*b K* is an (*a*×*b*) block matrix of identity matrices *<sup>I</sup>K*.

#### **Lemma 3.12 (Set of Dirac structures)**

*Given a bond graph* (3.12) *with the set of interior elements* <sup>V</sup><sup>I</sup> <sup>=</sup> <sup>V</sup><sup>0</sup> <sup>∪</sup> <sup>V</sup><sup>1</sup> <sup>∪</sup> <sup>V</sup>TF <sup>∪</sup> <sup>V</sup>GY*, <sup>N</sup>*<sup>I</sup> <sup>=</sup> <sup>|</sup>VI|*. The constitutive relations of all elements of* <sup>V</sup><sup>I</sup> *can be described by a set of Dirac structures* DS *with* <sup>|</sup>DS<sup>|</sup> <sup>=</sup> *<sup>N</sup>*<sup>I</sup> *. For each element <sup>i</sup>* <sup>∈</sup> <sup>V</sup><sup>I</sup> *there exists a corresponding element* <sup>D</sup>*i*(*x*) <sup>∈</sup> DS *with*

$$\begin{split} \mathbb{D}\_{l}(\mathbf{x}) &= \{ \left( \begin{pmatrix} \mathbf{f}\_{j} \\ \mathbf{f}\_{k} \end{pmatrix} \right), \begin{pmatrix} \mathbf{e}\_{j} \\ \mathbf{e}\_{k} \end{pmatrix} \} \in \mathbb{R}^{K \cdot M(l)} \times \mathbb{R}^{K \cdot M(i)} \mid \\ & \mathbf{F}\_{i}(\mathbf{x}) \begin{pmatrix} \mathbf{f}\_{j} \\ -\mathbf{(f}\_{k}) \end{pmatrix} + \mathbf{E}\_{i}(\mathbf{x}) \begin{pmatrix} \mathbf{e}\_{j} \\ \mathbf{(e}\_{k}) \end{pmatrix} = \mathbf{0} \}, \end{split} \tag{3.19}$$

*where j* ∈ ←− B (*i*), *k* ∈ −→<sup>B</sup> (*i*)*, and* <sup>B</sup>(*i*) = ←− B (*i*) <sup>S</sup>−→<sup>B</sup> (*i*) *with <sup>M</sup>*(*i*) :<sup>=</sup> <sup>|</sup>B(*i*)|*. Depending on the type of i, the matrices Fi*(*x*) *and Ei*(*x*) *in* (3.19) *are of one of the following forms:*

$$i \in \mathbb{V}\_0: \mathbf{F}\_l(\mathbf{x}) = \begin{pmatrix} \mathbf{I}\_K^{1 \times M(l)} \\ \mathbf{0}\_K^{(M(l)-1) \times M(l)} \end{pmatrix},\tag{3.20a}$$
 
$$\mathbf{E}\_l(\mathbf{x}) = \begin{pmatrix} \mathbf{0}\_K & \mathbf{0}\_K^{1 \times (M(l)-1)} \\ \mathbf{I}\_K^{(M(l)-1) \times 1} \end{pmatrix},\tag{3.20b}$$

$$i \in \mathbb{V}\_1 : \mathbf{F}\_l(\mathbf{x}) = \begin{pmatrix} \mathbf{I}\_K^{(M(i)-1)\times 1} & -\mathbf{I}\_{K(M(i)-1)}, \\ \mathbf{0}\_K & \mathbf{0}\_K^{1 \times (M(i)-1)}, \\ \mathbf{I}\_K^{(M(i)-1)\times 1} & -\mathbf{I}\_{K(M(i)-1)} \end{pmatrix} \begin{pmatrix} \mathbf{I}\_{K \cdot \left| \overleftarrow{\mathbb{B}}\_{(i)\vert} \right|} & \mathbf{0} \\ \mathbf{0} & -\mathbf{I}\_{K \cdot \left| \overleftarrow{\mathbb{B}}\_{(i)\vert} \right|} \end{pmatrix},\tag{3.20c}$$

$$\mathbf{E}\_{l}(\mathbf{x}) = \begin{pmatrix} \mathbf{I}\_{K}^{1 \times M(i)} \\ \mathbf{0}\_{K}^{(M(i)-1) \times M(i)} \end{pmatrix} \begin{pmatrix} \mathbf{I}\_{K \cdot |\stackrel{\leftarrow}{\boxtimes}(i)|} & \mathbf{0} \\ \mathbf{0} & -\mathbf{I}\_{K \cdot |\stackrel{\rightarrow}{\boxtimes}(i)|} \end{pmatrix},\tag{3.20d}$$
 
$$\mathbf{I}\_{K \cdot |\stackrel{\leftarrow}{\boxtimes}} = \left( \mathbf{I}\_{K} \cdot \mathbf{U}\_{l}(\mathbf{x}) \right) \tag{3.20e}$$

$$\forall i \in \mathbb{V}\_{\text{TF}} : \mathbf{F}\_i(\mathbf{x}) = \begin{pmatrix} \mathbf{I}\_K & \mathbf{U}\_i(\mathbf{x}) \\ \mathbf{0}\_K & \mathbf{0}\_K \\ \mathbf{0}\_K & \mathbf{0}\_K \end{pmatrix},\tag{3.20e}$$

$$\mathbf{E}\_{l}(\mathbf{x}) = \begin{pmatrix} \mathbf{0}\_{K} & \mathbf{0}\_{K} \\ -\mathbf{U}\_{l}^{\top}(\mathbf{x}) & \mathbf{I}\_{K} \end{pmatrix},\tag{3.20f}$$

$$i \in \mathbb{V}\_{\rm GY} : \mathbf{F}\_i(\mathbf{x}) = \begin{pmatrix} \mathbf{0}\_K & \mathbf{W}\_i(\mathbf{x}) \\ -\mathbf{W}\_i^\top(\mathbf{x}) & \mathbf{0}\_K \end{pmatrix},\tag{3.20g}$$
 
$$\mathbf{E}\_i(\mathbf{x}) = \begin{pmatrix} \mathbf{I}\_K & \mathbf{0}\_K \\ \mathbf{0}\_K & \mathbf{I}\_K \end{pmatrix}.\tag{3.20h}$$

#### Proof:

First, we prove that each element <sup>D</sup>*i*(*x*) <sup>∈</sup> DS describes the constitutive relations of the corresponding interior element *<sup>i</sup>* <sup>∈</sup> <sup>V</sup>I. Second, we show that the elements <sup>D</sup>*i*(*x*) <sup>∈</sup> DS define Dirac structures.

For *<sup>i</sup>* <sup>∈</sup> <sup>V</sup><sup>0</sup> <sup>∪</sup> <sup>V</sup>TF,∪VGY, we insert (3.20a), (3.20b); (3.20e), (3.20f); (3.20g), (3.20h) into the equation system of (3.19) and obtain the constitutive relations (3.8), (3.10), (3.11), respectively. Analogously, for *<sup>i</sup>* <sup>∈</sup> <sup>V</sup><sup>1</sup> we may write (3.9) as *F*˜ *i* ˜ *f <sup>i</sup>* +*E*˜ *<sup>i</sup>e*˜*<sup>i</sup>* = 0 with

$$
\begin{pmatrix}
\mathbf{0}\_K & \mathbf{0}\_K^{1 \times (M(i)-1)} \\
\mathbf{I}\_K^{(M(i)-1)\times 1} & -\mathbf{I}\_{K(M(i)-1)}
\end{pmatrix}
\begin{pmatrix}
(\tilde{\mathbf{J}}\_j) \\
(\tilde{\mathbf{J}}\_k)
\end{pmatrix} + 
\begin{pmatrix}
\mathbf{I}\_K^{1 \times M(i)} \\
\mathbf{0}\_K^{(M(i)-1)\times M(i)}
\end{pmatrix}
\begin{pmatrix}
(\tilde{\mathbf{e}}\_j) \\
\end{pmatrix} = \mathbf{0},\tag{3.21}
$$

for all *<sup>j</sup>* <sup>∈</sup> ←− B (*i*), *k* ∈ −→<sup>B</sup> (*i*). To bring (3.21) to the form of the equation system in (3.19), we perform a change of coordinates *f <sup>i</sup>* = *T* ⊤ *i* ˜ *f i* , *e<sup>i</sup>* = *T* ⊤ *<sup>i</sup> e*˜*i*, with *<sup>T</sup> <sup>i</sup>* <sup>=</sup> blkdiag(*IK*·|←− B (*i*)| ,−*IK*·|−→<sup>B</sup> (*i*)<sup>|</sup> ) which yields ((3.20c),(3.20d)).

Inserting the matrices *Fi*(*x*) and *Ei*(*x*)from (3.20a), (3.20b); (3.20e), (3.20f); (3.20g), (3.20h) into (2.5) shows that these matrices indeed define Dirac structures. Analogously, the matrices *F*˜ *<sup>i</sup>* and *E*˜ *<sup>i</sup>* from (3.21) define a Dirac structure. As *<sup>T</sup> <sup>i</sup>* <sup>∈</sup> <sup>O</sup>(*M*(*i*)), by Corollary 3.11 the matrices (3.20c), (3.20d) then also define a Dirac structure.

*Remark* 3.13 (Dirac structures for 0- and 1-type elements)*.* In Lemma 3.12, for *<sup>i</sup>* <sup>∈</sup> <sup>V</sup><sup>0</sup> <sup>∪</sup> <sup>V</sup><sup>1</sup> we have *<sup>F</sup>* <sup>=</sup> const. and *<sup>E</sup>* <sup>=</sup> const., i.e., the matrices *<sup>F</sup>* (*x*) and *E* (*x*) are independent of *x*. The corresponding Dirac structures are thus non-modulated Dirac structures.

With the following example we continue Example 3.7 and illustrate the generation of Dirac structures according to Lemma 3.12:

#### **Example 3.14:**

*Consider the K-dimensional bond graph from Example 3.7 with its formal description* (3.16)*. The set of interior elements is given by* V<sup>I</sup> = {0,1,*T F*,*GY*} *with <sup>N</sup>*<sup>I</sup> <sup>=</sup> <sup>4</sup>*. Define a corresponding set of Dirac structures* DS <sup>=</sup> {D0,D1,D*T F*,D*GY* } *where the elements* <sup>D</sup>*<sup>i</sup> are of the form* (3.19) *(<sup>i</sup>* <sup>∈</sup> <sup>V</sup>I*). By applying the calculation rules from the above Lemma 3.12, the equation systems of the Dirac structures read:* <sup>7</sup>

$$\mathbb{D}\_{0}: \begin{pmatrix} I & I & I & I \\ \mathbf{0} & \mathbf{0} & \mathbf{0} \\ \mathbf{0} & \mathbf{0} & \mathbf{0} \\ \mathbf{0} & \mathbf{0} & \mathbf{0} \end{pmatrix} \begin{pmatrix} f\_{Sf} \\ f\_{2} \\ -f\_{C} \\ -f\_{3} \end{pmatrix} + \begin{pmatrix} \mathbf{0} & \mathbf{0} & \mathbf{0} \\ I & -I & \mathbf{0} \\ I & \mathbf{0} & -I \\ I & \mathbf{0} & \mathbf{0} \end{pmatrix} \begin{pmatrix} \mathbf{e}\_{Sf} \\ \mathbf{e}\_{1} \\ \mathbf{e}\_{2} \\ \mathbf{e}\_{3} \end{pmatrix} = \mathbf{0},\tag{3.22a}$$
 
$$\mathbb{D}\_{1}: \begin{pmatrix} \mathbf{0} & \mathbf{0} & \mathbf{0} \\ I & I & \mathbf{0} \\ I & \mathbf{0} & I & \mathbf{0} \\ I & \mathbf{0} & \mathbf{0} & I \end{pmatrix} \begin{pmatrix} f\_{Se} \\ -f\_{C} \\ -f\_{R} \\ -f\_{1} \end{pmatrix} + \begin{pmatrix} I & -I & -I & -I \\ \mathbf{0} & \mathbf{0} & \mathbf{0} & \mathbf{0} \\ \mathbf{0} & \mathbf{0} & \mathbf{0} & \mathbf{0} \\ \mathbf{0} & \mathbf{0} & \mathbf{0} & \mathbf{0} \end{pmatrix} \begin{pmatrix} \mathbf{e}\_{Se} \\ \mathbf{e}\_{1} \\ \mathbf{e}\_{2} \\ \mathbf{e}\_{1} \end{pmatrix} = \mathbf{0},\tag{3.22b}$$
 
$$\mathbb{D}\_{TF}: \begin{pmatrix} I & \mathbf{U}(\mathbf{x}\_{1}) \\ \mathbf{0} & \mathbf{0} \end{pmatrix} \begin{pmatrix} f\_{1} \\ -f\_{2} \end{pmatrix} \\ -f\_{Z} \end{$$

*where <sup>U</sup>*(*x*1) = exp(−<sup>κ</sup> diag(*x*1)) *(cf.* (3.15)*).*

#### 3.2.4 Composition into a Single Dirac Structure

From Lemma 3.12 we obtain *N*<sup>I</sup> Dirac structures which describe the constitutive equations of the *N*<sup>I</sup> interior elements of the bond graph. Next, we compose these *N*<sup>I</sup> Dirac structures obtained into one single Dirac structure. To this end, we follow the idea from Batlle et al. [2011] who proposed to describe the interconnection of some Dirac structures again by a Dirac structure—a so-called *interconnection Dirac structure* [Batlle et al., 2011].

The *N*<sup>I</sup> Dirac structures from Lemma 3.12 are formulated such that the vectors and matrices are ordered according to ingoing and outgoing bonds. For the determination of an interconnection Dirac structure, we first rewrite these Dirac structures such that the interconnection variables (i.e., the flows and efforts of interior bonds) become visible.

<sup>7</sup>Throughout this example, square zero matrices and identity matrices are of dimension *K*.

#### **Proposition 3.15 (Rewriting the Dirac structures)**

*Consider the situation from Lemma 3.12 with the set of Dirac structures* DS*. Let* <sup>B</sup>I(*i*) *and* <sup>B</sup>E(*i*) *denote the sets of interior and exterior bonds at <sup>i</sup>* <sup>∈</sup> <sup>V</sup><sup>I</sup> *, respectively. For all <sup>i</sup>* <sup>∈</sup> <sup>V</sup><sup>I</sup> *, the elements* <sup>D</sup>*<sup>i</sup>* <sup>∈</sup> DS *can then be written such that the vectors and matrices of* D*<sup>i</sup> are sorted by exterior and interior bonds:*

$$\begin{aligned} \mathbb{D}\_{l}(\mathbf{x}) &= \{ \left( \begin{pmatrix} \mathbf{f}\_{j} \\ \mathbf{f}\_{k} \end{pmatrix} \right), \begin{pmatrix} \mathbf{e}\_{j} \\ \mathbf{e}\_{k} \end{pmatrix} \} \in \mathbb{R}^{K \cdot M(l)} \times \mathbb{R}^{K \cdot M(l)} \mid \\\ \left( \begin{pmatrix} \mathbf{F}\_{j} \end{pmatrix} \begin{pmatrix} \mathbf{F}\_{k} \left( \mathbf{x} \right) \end{pmatrix} \right) & \left( \begin{pmatrix} \mathbf{e}(j)\mathbf{f}\_{j} \\ \mathbf{e}(k)\mathbf{f}\_{k} \end{pmatrix} \right) + \left( \begin{pmatrix} \mathbf{E}\_{j} \left( \mathbf{x} \right) \end{pmatrix} \begin{pmatrix} \mathbf{E}\_{k} \left( \mathbf{x} \right) \end{pmatrix} \right) \begin{pmatrix} \mathbf{e}\_{j} \\ \mathbf{e}\_{k} \end{pmatrix} = \mathbf{0} \}, \end{aligned} \tag{3.23}$$

*for all <sup>j</sup>* <sup>∈</sup> <sup>B</sup>E(*i*), *<sup>k</sup>* <sup>∈</sup> <sup>B</sup>I(*i*) *where* <sup>ε</sup> : <sup>B</sup>(*i*) → {−1,1} *is a sign function with*

$$\mathfrak{e}(b) = \begin{cases} \quad 1, & b \in \overleftarrow{\mathbb{B}}\ (i), \\ -1, & b \in \overleftarrow{\mathbb{B}}\ (i). \end{cases} \tag{3.24}$$

#### Proof:

From Property 3.2 we know that <sup>B</sup> <sup>=</sup> <sup>B</sup><sup>E</sup> <sup>∪</sup>BI. It follows that for each *<sup>i</sup>* <sup>∈</sup> <sup>V</sup><sup>I</sup> we can permute the vectors and matrices of <sup>D</sup>*<sup>i</sup>* <sup>∈</sup> DS in (3.19) such that they are sorted by exterior and interior bonds. The rest follows from Corollary 3.11.

Based on Proposition 3.15, we may now formulate an interconnection Dirac structure by relating the flows and efforts of the interior bonds of (3.23).

**Proposition 3.16 (Interconnection Dirac stucture)** *Consider the Dirac structures* (3.23)*. For each <sup>i</sup>* <sup>∈</sup> <sup>V</sup><sup>I</sup> *, let us define f* IC *i* := (ε(*k*)*f <sup>k</sup>* ) *and e* IC *i* := (*ek*) *for all <sup>k</sup>* <sup>∈</sup> <sup>B</sup>I(*i*)*. For the Dirac structures* (3.23)*, we can obtain an interconnection Dirac structure of the following form:*

$$\mathbb{D}\_{\mathrm{IC}} = \{ (\mathbf{f}^{\mathrm{IC}}, \mathbf{e}^{\mathrm{IC}}) \in \mathbb{R}^{2KM\_{\mathrm{I}}} \times \mathbb{R}^{2KM\_{\mathrm{I}}} \mid \left( \mathbf{F}\_{i}^{\mathrm{IC}} \right) \left( \mathbf{f}\_{i}^{\mathrm{IC}} \right) + \left( \mathbf{E}\_{i}^{\mathrm{IC}} \right) \left( \mathbf{e}\_{i}^{\mathrm{IC}} \right) = \mathbf{0}, \forall i \in \mathbb{V}\_{\mathrm{I}} \}, \tag{3.25}$$
 
$$\text{where } \mathbf{f}^{\mathrm{IC}} := (\mathbf{f}\_{i}^{\mathrm{IC}}), \mathbf{e}^{\mathrm{IC}} := (\mathbf{e}\_{i}^{\mathrm{IC}}), \text{ and } \mathbf{F}\_{i}^{\mathrm{IC}}, \mathbf{E}\_{i}^{\mathrm{IC}} \in \mathbb{R}^{2KM\_{\mathrm{I}} \times KM\_{\mathrm{I}}(i)} \text{ for all } i \in \mathbb{V}\_{\mathrm{I}}.$$

#### Proof:

We have to show that (i) the equation system in (3.25) indeed describes the interconnections between the Dirac structures (3.23) and (ii) that (3.25) is a Dirac structure.

The junction structure consists of *N*<sup>I</sup> interior elements which are connected by *M*<sup>I</sup> interior bonds (cf. Definition 3.1). Each interior bond is incident to two interior elements. Thus, for each *<sup>k</sup>* <sup>∈</sup> <sup>B</sup><sup>I</sup> the flow *<sup>f</sup> <sup>k</sup>* appears exactly twice in *<sup>f</sup>* IC: once with a positive sign and once with a negative sign. Analogously, for each *<sup>k</sup>* <sup>∈</sup> <sup>B</sup><sup>I</sup> the effort *e<sup>k</sup>* appears exactly twice in *e* IC, both times with a positive sign. Let us equate these variables appearing twice by setting

$$
\begin{pmatrix}
\mathbf{I}\_{KM\_{\parallel}} & \mathbf{I}\_{KM\_{\parallel}} \\
\mathbf{0}\_{KM\_{\parallel}} & \mathbf{0}\_{KM\_{\parallel}}
\end{pmatrix}
\begin{pmatrix}
\begin{pmatrix}
\mathbf{f}\_{k}
\end{pmatrix}
\\
\mathbf{f}\_{k}
\end{pmatrix}
\end{pmatrix} +
\begin{pmatrix}
\mathbf{0}\_{KM\_{\parallel}} & \mathbf{0}\_{KM\_{\parallel}} \\
\mathbf{I}\_{KM\_{\parallel}} & -\mathbf{I}\_{KM\_{\parallel}}
\end{pmatrix}
\begin{pmatrix}
\begin{pmatrix}
\mathbf{e}\_{k}
\end{pmatrix}
\\
\begin{pmatrix}
\mathbf{e}\_{k}
\end{pmatrix}
\end{pmatrix} = \mathbf{0},\tag{3.26}
$$

for all *<sup>k</sup>* <sup>∈</sup> <sup>B</sup>I. The matrices in (3.26) satisfy (2.5) and can thus be related to a Dirac structure. By permutations, we rearrange the entries of the vectors in (3.26) such that they are in the same order as in *f* IC and *e* IC (cf. Corollary 3.11). <sup>8</sup> Finally, we rename the columns of the resulting matrices according to their affiliation to elements of V<sup>I</sup> and obtain the equation system in (3.25).

Proposition 3.16 provides a constructive<sup>9</sup> way for determining an interconnection Dirac structure for the *N*<sup>I</sup> Dirac structures describing the interior elements. The interconnection Dirac structure exclusively contains flows and efforts of the interior bonds. The overall number of Dirac structures is then *N*<sup>I</sup> + 1, i.e., *N*<sup>I</sup> Dirac structures from the interior elements plus one interconnection Dirac structure. In the next lemma, we compose the *N*<sup>I</sup> +1 Dirac structures into one single Dirac structure.

#### **Lemma 3.17 (Composition of Dirac structures)**

*Consider N*<sup>I</sup> *Dirac structures of the form* (3.23) *with a corresponding interconnection Dirac structure* (3.25)*. Then, the N*<sup>I</sup> + 1 *Dirac structures can be merged into a single Dirac structure:*

<sup>8</sup>Note that by 2*M*<sup>I</sup> <sup>=</sup> <sup>∑</sup>*i*∈V<sup>I</sup> *<sup>M</sup>*I(*i*), the sizes of the matrices in (3.26) and (3.25) are equal.

<sup>9</sup>As a matter of fact, the construction rules are mainly in the proof of Proposition 3.16

$$\mathbb{D}\left(\mathbf{x}\right) = \{\begin{pmatrix} \mathbf{f}\_{\text{C}}\\ \mathbf{f}\_{\text{R}}\\ \mathbf{f}\_{\text{S}\text{f}}\\ \mathbf{f}\_{\text{S}\text{e}} \end{pmatrix}, \begin{pmatrix} \mathbf{e}\_{\text{C}}\\ \mathbf{e}\_{\text{R}}\\ \mathbf{e}\_{\text{S}\text{e}} \end{pmatrix}\} \in \mathbb{R}^{K\mathbb{N}\_{\mathbb{E}}} \times \mathbb{R}^{K\mathbb{N}\_{\mathbb{E}}} \mid$$

$$\underbrace{\begin{pmatrix} \mathbf{F}\_{\text{C}}\left(\mathbf{x}\right)\mathbf{F}\_{\text{R}}\left(\mathbf{x}\right)\mathbf{F}\_{\text{S}\text{f}}\left(\mathbf{x}\right)\mathbf{F}\_{\text{Se}}\left(\mathbf{x}\right)}\_{=\mathbf{F}\left(\mathbf{x}\right)}\end{pmatrix}}\_{=\mathbf{F}\left(\mathbf{x}\right)} + \begin{pmatrix} -\mathbf{f}\_{\text{C}}\\ \mathbf{f}\_{\text{R}}\\ \mathbf{f}\_{\text{S}\text{f}}\\ \mathbf{f}\_{\text{Se}} \end{pmatrix} +$$

$$\underbrace{\{\mathbf{E}\_{\text{C}}\left(\mathbf{x}\right)\mathbf{E}\_{\text{R}}\left(\mathbf{x}\right)\mathbf{E}\_{\text{S}\text{f}}\left(\mathbf{x}\right)\mathbf{E}\_{\text{Se}}\left(\mathbf{x}\right)}\_{=\mathbf{E}\left(\mathbf{x}\right)}\right)}\_{=\mathbf{E}\left(\mathbf{x}\right)}\left(\underbrace{\begin{pmatrix} \mathbf{e}\_{\text{C}}\\ \mathbf{e}\_{\text{S}\text{f}}\\ \mathbf{e}\_{\text{S}\text{f}}\\ \mathbf{e}\_{\text{S}\text{e}} \end{pmatrix}}\_{\in\mathbf{S}\text{e}},\tag{3.27}$$

*where f* <sup>α</sup> , *e*<sup>α</sup> ∈ R *KN*<sup>α</sup> *and <sup>F</sup>* <sup>α</sup> (*x*),*<sup>E</sup>* <sup>α</sup> (*x*) <sup>∈</sup> <sup>R</sup> *KN*E×*KN*<sup>α</sup> *for* <sup>α</sup> ∈ {C,R,Sf,Se}*.* 10 *The composite Dirac structure* (3.27) *can be calculated as follows: Define a full-rank matrix* Γ <sup>⊤</sup> (*x*) ∈ R <sup>2</sup>*KM*I×*K*(2*M*I+*M*E) *as a* (1×*N*I) *block matrix* Γ <sup>⊤</sup> (*x*) = (Γ ⊤ *i* (*x*)) *of matrices* Γ ⊤ *i* (*x*) ∈ R 2*KM*I×*KM*(*i*) *for all <sup>i</sup>* <sup>∈</sup> <sup>V</sup><sup>I</sup> *with*

$$\mathbf{F}\_{i}^{\top}\left(\mathbf{x}\right) = \mathbf{F}\_{i}^{\mathrm{IC}}\left(\mathbf{E}\_{k}\left(\mathbf{x}\right)\right)^{\top} + \mathbf{E}\_{i}^{\mathrm{IC}}\left(\mathbf{F}\_{k}\left(\mathbf{x}\right)\right)^{\top}, \forall k \in \mathbb{B}\_{\mathrm{I}}(i). \tag{3.28}$$

*Choose a matrix* <sup>Λ</sup>(*x*) <sup>∈</sup> <sup>R</sup> *KM*E×*K*(2*M*I+*M*E) *such that* im(Λ <sup>⊤</sup> (*x*)) = ker(Γ ⊤ (*x*)) *for all <sup>x</sup>* <sup>∈</sup> <sup>X</sup>*. Since* rank(<sup>Γ</sup> <sup>⊤</sup> (*x*)) = 2*KM*<sup>I</sup> *, we have* dim(ker(Γ <sup>⊤</sup> (*x*))) = *KM*<sup>E</sup> *and such a matrix* <sup>Λ</sup>(*x*) *always exists. Matrix* <sup>Λ</sup>(*x*) *can be written as a* (1<sup>×</sup> *<sup>N</sup>*I) *block matrix* (Λ*i*(*x*)) *of matrices* <sup>Λ</sup>*i*(*x*) <sup>∈</sup> <sup>R</sup> *KM*E×*KM*(*i*) *for all <sup>i</sup>* <sup>∈</sup> <sup>V</sup><sup>I</sup> *. Then, a composite Dirac structure is given by:*

$$\mathbb{D}\left(\mathbf{z}\right) = \left\{ \left( \left( \mathbf{f}\_{j} \right), \left( \mathbf{e}\_{j} \right) \right) \in \mathbb{R}^{K M\_{\mathbb{E}}} \times \mathbb{R}^{K M\_{\mathbb{E}}} \mid \right.$$

$$\underbrace{\left( \mathbf{A}\_{i} \left( \mathbf{x} \right) \left( \mathbf{F}\_{j} \left( \mathbf{x} \right) \right) \right)}\_{=\mathbf{F}\left( \mathbf{x} \right)} \left( \mathbf{f}\_{j} \right) + \underbrace{\left( \mathbf{A}\_{i} \left( \mathbf{x} \right) \left( \mathbf{E}\_{j} \left( \mathbf{x} \right) \right) \right)}\_{=\mathbf{E}\left( \mathbf{x} \right)} \left( \mathbf{e}\_{j} \right) = \mathbf{0} \right\}, \quad \text{(3.29)}$$

*for all <sup>j</sup>* <sup>∈</sup> <sup>B</sup>E(*i*)*, <sup>i</sup>* <sup>∈</sup> <sup>V</sup><sup>I</sup> *, where F*˜ (*x*)*, E*˜ (*x*) *are square matrices of size KM*E*. The Dirac structure* (3.29) *relates the flows f <sup>j</sup> and efforts e <sup>j</sup> of only the exterior bonds <sup>j</sup>* <sup>∈</sup> <sup>B</sup>E*. Hence, by permutations we can easily obtain* (3.27)*.*

#### Proof:

Batlle et al. [2011] consider the general composition of an arbitrary number of Dirac structures coupled by any interconnection Dirac structure. The authors show that (3.29) is a calculation rule for a composite Dirac structure in which the interconnection variables have been eliminated [Batlle et al., 2011, Eq. (44),(45)]. In the case of Lemma 3.17, the interconnection variables are the flows and efforts of the interior bonds. These variables have been eliminated from the composite Dirac structure (3.29). Hence, (3.29) contains only flows and efforts corresponding to exterior bonds. By permutations, we can then rewrite (3.29) as (3.27) (cf. Corollary 3.11).

*Remark* 3.18 (Signs of *f* <sup>C</sup> and *f* <sup>R</sup>)*.* The negative sign of *f* <sup>C</sup> and *f* <sup>R</sup> in the equation system of (3.27) stems from the bond orientation rules in which bonds are incoming to storages and resistors (cf. Subection 3.2.2).

*Remark* 3.19 (Automated composition)*.* The calculations in this subsection can be easily automated in standard computer algebra systems. In particular, this includes the determination of a matrix Λ satisfying im(Λ <sup>⊤</sup>) = ker(Γ <sup>⊤</sup>) in Lemma 3.17 [Batlle et al., 2011].

In the following, we proceed with our example and illustrate the composition of the Dirac structures.

#### **Example 3.20:**

*Consider the four Dirac structures specified by* (3.22) *from Example 3.14. By permutations, we may rewrite the equation systems from* (3.22) *in the form* (3.23)*:*

<sup>10</sup>Note that *M*<sup>E</sup> = *N*<sup>E</sup> (cf. Property 3.2).

D<sup>0</sup> : *I I I I* 0 0 0 0 0 0 0 0 0 0 0 0 −*f <sup>C</sup>*<sup>2</sup> *f S f* −*f* <sup>3</sup> *f* 2 + 0 0 0 0 0 *I* 0 −*I* <sup>−</sup>*I I* 0 0 0 *I* −*I* 0 *eC*<sup>2</sup> *eS f e*3 *e*2 = 0, (3.30a) D<sup>1</sup> : 0 0 0 0 *I* 0 *I* 0 0 *I I* 0 0 0 *I I* −*f <sup>C</sup>*<sup>1</sup> −*f <sup>R</sup> f Se* −*f* <sup>1</sup> + <sup>−</sup>*<sup>I</sup>* <sup>−</sup>*I I* <sup>−</sup>*<sup>I</sup>* 0 0 0 0 0 0 0 0 0 0 0 0 *eC*<sup>1</sup> *eR eSe e*1 = 0, (3.30b) D*T F* : *I U*(*x*1) 0 0 *<sup>f</sup>* <sup>1</sup> −*f* <sup>2</sup> + 0 0 −*U*(*x*1) *I e*<sup>1</sup> *e*2 = 0, (3.30c) D*GY* : *I* 0 0 −*I* −*f <sup>C</sup>*<sup>3</sup> *f* 3 ! + 0 *I I* 0 *eC*<sup>3</sup> *e*3 ! = 0, (3.30d)

*whereU*(*x*1) = exp(−<sup>κ</sup> diag(*x*1))*. The dashed lines indicate the partitioning of the flow and effort vectors with respect to the affiliation of the variables to exterior and interior bonds. Next, we determine an interconnection Dirac structure* DIC (3.25)*. From Proposition 3.16, one obtains the following equation system for* DIC*:*

*Equation* (3.31) *relates flow and efforts only of interior bonds. In this case, the dashed lines separate the vector entries with respect to their origin from the different interior elements. As can be seen, the matrices in* (3.31) *are simply column-wise permutations of the matrices in* (3.26)*. Now we can compose the Dirac structures according to Lemma 3.17. By using* (3.30) *and* (3.31) *we calculate* (3.28) *and obtain the following expression for* Γ ⊤ (*x*)*:*

*With a computer algebra system, we evaluate* im(Λ <sup>⊤</sup>(*x*1)) = ker(Γ <sup>⊤</sup>(*x*1)) *and obtain the following expression for* Λ <sup>⊤</sup>(*x*1)*:*


*Finally, with* (3.33) *and* (3.30) *we calculate* (3.29) *and obtain a single Dirac structure describing the equations of the junction structure. The equation system of the composed Dirac structure reads*

$$+\underbrace{\begin{pmatrix}\mathbf{0} & -I & \mathbf{0} & \mathbf{0} & -I & -U^{-1}(\mathbf{x}\_{1})\\\mathbf{0} & \mathbf{0} & I & \mathbf{0} & \mathbf{0} & \mathbf{0}\\\mathbf{0} & \mathbf{0} & \mathbf{0} & \mathbf{0} & \mathbf{0} & \mathbf{0}\\\mathbf{0} & \mathbf{0} & I & \mathbf{0} & I & \mathbf{0}\\I & \mathbf{0} & \mathbf{0} & \mathbf{0} & \mathbf{0} & I\\\hline\\F\_{C} & F\_{R} & F\_{S1} & F\_{Sc}(\mathbf{x}\_{1})\\\\H(\mathbf{x}\_{1}) & \mathbf{0} & \mathbf{0} & \mathbf{0} & I & \mathbf{0}\\\mathbf{0} & \mathbf{0} & \mathbf{0} & U(\mathbf{x}\_{1}) & I & -U(\mathbf{x}\_{1})\\\mathbf{0} & \mathbf{0} & \mathbf{0} & \mathbf{0} & \mathbf{0} & \mathbf{0}\\\mathbf{0} & \mathbf{0} & \mathbf{0} & \mathbf{0} & \mathbf{0} & \mathbf{0}\\\hline\\\mathbf{0} & -I & \mathbf{0} & \mathbf{0} & I & \mathbf{0}\\\hline\\\end{pmatrix} \begin{pmatrix} \mathbf{c}\_{C\_{1}}\\\mathbf{c}\_{C\_{2}}\\\mathbf{c}\_{C\_{3}}\\\mathbf{c}\_{S}\\\end{pmatrix} = \mathbf{0}.\tag{3.34}$$

*It can be seen that* (3.34) *relates flows and efforts of only exterior bonds. Moreover,* (3.34) *is in the form of the equation system from* (3.27)*.*

#### 3.2.5 Explicit Representation of the Dirac Structure

The Dirac structure obtained from Lemma 3.17 is in kernel representation which is an implicit form. For the derivation of an explicit PHS, the natural next step is to transfer the Dirac structure from an implicit form into an explicit form. In the following, we consider methods for transferring a Dirac structure from an (implicit) kernel representation into an (explicit) input-output representation (2.7). The basic idea to this end is simple: we rearrange the implicit equations in (3.27) such that a suitable explicit representation is obtained.

Bloch and Crouch [1999] show that for each Dirac structure in kernel representation there exists an input-output representation and vice versa. However, as with the kernel representation (cf. Remark 2.19), the input-output representation of a Dirac structure is not unique. In particular, not all input-output representations of a Dirac structure allow for a subsequent derivation of an explicit PHS with a suitable choice of inputs and outputs, viz. an explicit PHS with Property 3.8. The inputs and outputs of an explicit PHS are determined by the inputs and outputs of the underlying explicit form of the Dirac structure. Thus, based on Property 3.8, we deduce that the input vector of the input-output representation has to contain all flows corresponding to Sf elements and all efforts corresponding to Se elements; the output vector has to contain the corresponding conjugated variables. This is formalized in the following property:

#### **Property 3.21 (Inputs and outputs of the Dirac structure)**

*Let* <sup>B</sup><sup>α</sup> <sup>=</sup> <sup>∪</sup>*i*∈VαB(*i*) *for* <sup>α</sup> ∈ {Sf,Se}*. The input vector of the explicit Dirac structure includes* (*f j* )*,* (*ek*) *while the output vector includes* (*e <sup>j</sup>*)*,* (*f <sup>k</sup>* ) *for all j* ∈ BSf*, k* ∈ BSe*.*

We seek to formulate the Dirac structure (3.27) in an explicit representation that has Property 3.21. To this end, it is essential that the bond graph does not contain dependent sources. Dependent sources occur if the values imposed by two sources are conflicting. For example, think of an electric circuit with two voltage sources in parallel or two current sources in series. Intuitively, for such systems, it is impossible to find a model which has both conflicting variables as inputs. Hence, we assume the source elements of the bond graph to be independent—which is ensured by the following assumption:

## **Assumption 3.22 (Independent sources)**

*The matrices in* (3.27) *fulfill*

rank(*E*Sf(*x*) *<sup>F</sup>*Se (*x*)) = *<sup>K</sup>*(*N*Sf <sup>+</sup>*N*Se), <sup>∀</sup>*<sup>x</sup>* <sup>∈</sup> <sup>X</sup>. (3.35)

In Appendix B.1, is is proven that the source elements from the bond graph are independent if and only if Assumption 3.22 is met. Conversely, if Assumption 3.22 is violated, the junction structure implies a dependency between source elements. Dependent sources are serious modeling inconsistencies which may occur from physically implausible structures in the bond graph. They must be resolved by modifications of the bond graph [Karnopp et al., 2012, p. 169]. Based on the exclusion of dependent sources in Assumption 3.22, one can now state the following lemma:

#### **Lemma 3.23 (Input-output representation)**

*Consider a Dirac structure* (3.27) *which fulfills Assumption 3.22. The Dirac structure can be formulated in an input-output representation with Property 3.21:*

$$\mathbb{D}(\mathbf{x}) = \{ (\begin{pmatrix} \mathbf{f}\_{\mathbf{C}} \\ \mathbf{f}\_{\mathbf{R}} \\ \mathbf{f}\_{\mathbf{S}\mathbf{f}} \\ \mathbf{f}\_{\mathbf{S}\mathbf{e}} \end{pmatrix}, \begin{pmatrix} \mathbf{e}\_{\mathbf{C}} \\ \mathbf{e}\_{\mathbf{R}} \\ \mathbf{e}\_{\mathbf{S}\mathbf{f}} \\ \mathbf{e}\_{\mathbf{S}\mathbf{e}} \end{pmatrix} \} \in \mathbb{R}^{K\mathbb{N}\_{\mathbb{R}}} \times \mathbb{R}^{K\mathbb{N}\_{\mathbb{R}}} \mid \begin{pmatrix} \mathbf{y}\_{\mathbf{C}} \\ \mathbf{y}\_{\mathbf{R}} \\ \mathbf{y}\_{\mathbf{P}} \end{pmatrix} = \mathbf{Z}\left(\mathbf{x}\right) \begin{pmatrix} \mathbf{u}\_{\mathbf{C}} \\ \mathbf{u}\_{\mathbf{R}} \\ \mathbf{u}\_{\mathbf{P}} \end{pmatrix} \}, \tag{3.36}$$

*where <sup>Z</sup>* (*x*) *is skew-symmetric for all <sup>x</sup>* <sup>∈</sup> <sup>X</sup> *and*

$$\mathfrak{u}\_{\rm C} = \begin{pmatrix} \mathbf{e}\_{\rm C,1} \\ -\mathbf{f}\_{\rm C,2} \end{pmatrix}, \qquad \mathfrak{u}\_{\rm R} = \begin{pmatrix} \mathbf{e}\_{\rm R,1} \\ -\mathbf{f}\_{\rm R,2} \end{pmatrix}, \qquad \mathfrak{u}\_{\rm P} = \begin{pmatrix} \mathbf{f}\_{\rm Sf} \\ \mathbf{e}\_{\rm Se} \end{pmatrix}, \tag{3.37a}$$

$$\mathbf{y\_C} = \begin{pmatrix} -\mathbf{f\_{C,1}} \\ \mathbf{e\_{C,2}} \end{pmatrix}, \qquad \mathbf{y\_R} = \begin{pmatrix} -\mathbf{f\_{R,1}} \\ \mathbf{e\_{R,2}} \end{pmatrix}, \qquad \mathbf{y\_P} = \begin{pmatrix} \mathbf{e\_{Sf}} \\ \mathbf{f\_{Se}} \end{pmatrix}. \tag{3.37b}$$

*The matrix <sup>Z</sup>* (*x*) *exists for all <sup>x</sup>* <sup>∈</sup> <sup>X</sup> *and is given by:*

$$\begin{split} \mathbf{Z}(\mathbf{x}) &= \begin{pmatrix} \mathbf{F}\_{\mathrm{C},1}(\mathbf{x}) & \mathbf{E}\_{\mathrm{C},2}(\mathbf{x}) & \mathbf{F}\_{\mathrm{R},1}(\mathbf{x}) & \mathbf{E}\_{\mathrm{R},2}(\mathbf{x}) & \mathbf{E}\_{\mathrm{Sf}}(\mathbf{x}) & \mathbf{F}\_{\mathrm{Se}}(\mathbf{x}) \end{pmatrix}^{-1} \\ & \cdot \begin{pmatrix} \mathbf{E}\_{\mathrm{C},1}(\mathbf{x}) & \mathbf{F}\_{\mathrm{C},2}(\mathbf{x}) & \mathbf{E}\_{\mathrm{R},1}(\mathbf{x}) & \mathbf{F}\_{\mathrm{R},2}(\mathbf{x}) & \mathbf{F}\_{\mathrm{Sf}}(\mathbf{x}) & \mathbf{E}\_{\mathrm{Se}}(\mathbf{x}) \end{pmatrix}. \end{split} \tag{3.38}$$

*The matrices in* (3.38) *can be obtained from splitting (possibly after some permutations) F* <sup>C</sup> (*x*) *and F* <sup>R</sup> (*x*) *into* (*F* <sup>C</sup>,<sup>1</sup> (*x*) *F* <sup>C</sup>,<sup>2</sup> (*x*)) *and* (*F* <sup>R</sup>,<sup>1</sup> (*x*) *F* <sup>R</sup>,<sup>2</sup> (*x*))*, respectively, such that*

$$\begin{aligned} &(i) \quad \begin{pmatrix} \mathbf{F}\_{\mathbf{C},1}(\mathbf{x}) & \mathbf{F}\_{\mathbf{R},1}(\mathbf{x}) & \mathbf{E}\_{\mathbf{S}\mathbf{f}}(\mathbf{x}) & \mathbf{F}\_{\mathbf{S}\mathbf{e}}(\mathbf{x}) \end{pmatrix} \text{ has full column rank} \quad \text{(3.39a)}\\ &(ii) \text{ rank} \begin{pmatrix} \mathbf{F}\_{\mathbf{C},1}(\mathbf{x}) & \mathbf{F}\_{\mathbf{R},1}(\mathbf{x}) & \mathbf{E}\_{\mathbf{S}\mathbf{f}}(\mathbf{x}) & \mathbf{F}\_{\mathbf{S}\mathbf{e}}(\mathbf{x}) \end{pmatrix} = \end{aligned}$$

rank *F* <sup>C</sup> (*x*) *F* <sup>R</sup> (*x*) *E*Sf(*x*) *F*Se (*x*) , (3.39b)

*for all <sup>x</sup>* <sup>∈</sup> <sup>X</sup>*. According to the manner in which <sup>F</sup>* <sup>C</sup> (*x*) *and <sup>F</sup>* <sup>R</sup> (*x*) *are split, we partition E*<sup>C</sup> (*x*) *and E*<sup>R</sup> (*x*)*into* (*E*C,<sup>1</sup> (*x*) *E*C,<sup>2</sup> (*x*)) *and* (*E*R,<sup>1</sup> (*x*) *E*R,<sup>2</sup> (*x*))*, respectively. In the same way, we split f* <sup>C</sup>*, e*<sup>C</sup> *and f* <sup>R</sup>*, e*<sup>R</sup> *.*

#### Proof:

Let Assumption 3.22 hold. For the sake of notation, we neglect the argument *<sup>x</sup>* and the supplement "for all *<sup>x</sup>* <sup>∈</sup> <sup>X</sup>" in this proof. We apply the ideas from Bloch and Crouch [1999, Theorem 4] to show that we always find decompositions (*F* <sup>R</sup>,1,*F* <sup>R</sup>,2), (*F* <sup>C</sup>,1,*F* <sup>C</sup>,2), (*E*C,1,*E*C,2), (*E*R,1,*E*R,2) for *F* <sup>C</sup>, *F* <sup>R</sup>, *E*C, *E*R, respectively, such that

$$\text{rank}\begin{pmatrix} \mathbf{F}\_{\text{C},1} & \mathbf{E}\_{\text{C},2} & \mathbf{F}\_{\text{R},1} & \mathbf{E}\_{\text{R},2} & \mathbf{E}\_{\text{Sf}} & \mathbf{F}\_{\text{Se}} \end{pmatrix} = K N\_{\text{E}} \tag{3.40}$$

holds. Choose decompositions of *F* <sup>C</sup> and *F* <sup>R</sup> (possibly after some permutations) such that the conditions in (3.39) are fulfilled. Let *F* <sup>C</sup>,2, *F* <sup>R</sup>,<sup>2</sup> denote the rest of *F* <sup>C</sup>, *F* <sup>R</sup>, respectively, i.e., *F* <sup>C</sup> = (*F* <sup>C</sup>,<sup>1</sup> *F* <sup>C</sup>,2), *F* <sup>R</sup> = (*F* <sup>R</sup>,<sup>1</sup> *F* <sup>R</sup>,2). Next, split *E*<sup>C</sup> and *E*<sup>R</sup> according to the decomposition chosen for *F* <sup>C</sup> and *F* <sup>R</sup>, respectively, into *E*<sup>C</sup> = (*E*C,<sup>1</sup> *E*C,2) and *E*<sup>R</sup> = (*E*R,<sup>1</sup> *E*R,2). By (3.39a) the matrix (*F* <sup>C</sup>,<sup>1</sup> *F* <sup>R</sup>,<sup>1</sup> *E*Sf *F*Se) has full column rank. Thus, its adjoint (*F* <sup>C</sup>,<sup>1</sup> *F* <sup>R</sup>,<sup>1</sup> *E*Sf *F*Se) ⊤

is surjective. In particular we have

$$\begin{aligned} \operatorname{im} \begin{pmatrix} \mathbf{E}\_{\mathrm{C},1} & \mathbf{E}\_{\mathrm{R},1} & \mathbf{F}\_{\mathrm{S}\mathrm{f}} & \mathbf{E}\_{\mathrm{Se}} \end{pmatrix} \\ &= \operatorname{im} \left( \begin{pmatrix} \mathbf{E}\_{\mathrm{C},1} & \mathbf{E}\_{\mathrm{R},1} & \mathbf{F}\_{\mathrm{S}\mathrm{f}} & \mathbf{E}\_{\mathrm{Se}} \end{pmatrix} \cdot \begin{pmatrix} \mathbf{F}\_{\mathrm{C},1} & \mathbf{F}\_{\mathrm{R},1} & \mathbf{E}\_{\mathrm{S}\mathrm{f}} & \mathbf{F}\_{\mathrm{Se}} \end{pmatrix}^{\top} \right) \\ &= \operatorname{im} \left( \mathbf{E}\_{\mathrm{C},1} \mathbf{F}\_{\mathrm{C},1}^{\top} + \mathbf{E}\_{\mathrm{R},1} \mathbf{F}\_{\mathrm{R},1}^{\top} + \mathbf{F}\_{\mathrm{S}\mathrm{f}} \mathbf{E}\_{\mathrm{S}\mathrm{f}}^{\top} + \mathbf{E}\_{\mathrm{Se}} \mathbf{F}\_{\mathrm{Se}}^{\top} \right) . \end{aligned} \tag{3.4.1}$$

For (3.27), equation (2.5a) reads

$$\begin{aligned} \mathbf{0} &= \mathbf{E} \mathbf{F}^{\top} + \mathbf{F} \mathbf{E}^{\top} \\ &= \mathbf{E}\_{\mathbf{C},1} \mathbf{F}\_{\mathbf{C},1}^{\top} + \mathbf{E}\_{\mathbf{C},2} \mathbf{F}\_{\mathbf{C},2}^{\top} + \mathbf{E}\_{\mathbf{R},1} \mathbf{F}\_{\mathbf{R},1}^{\top} + \mathbf{E}\_{\mathbf{R},2} \mathbf{F}\_{\mathbf{R},2}^{\top} + \mathbf{E}\_{\mathbf{S} \mathbf{f}} \mathbf{F}\_{\mathbf{S} \mathbf{f}}^{\top} + \mathbf{E}\_{\mathbf{S} \mathbf{e}} \mathbf{F}\_{\mathbf{S} \mathbf{e}}^{\top} + \\ &\quad \mathbf{F}\_{\mathbf{C},1} \mathbf{E}\_{\mathbf{C},1}^{\top} + \mathbf{F}\_{\mathbf{C},2} \mathbf{E}\_{\mathbf{C},2}^{\top} + \mathbf{F}\_{\mathbf{R},1} \mathbf{E}\_{\mathbf{R},1}^{\top} + \mathbf{F}\_{\mathbf{R},2} \mathbf{E}\_{\mathbf{R},2}^{\top} + \mathbf{F}\_{\mathbf{S} \mathbf{f}} \mathbf{E}\_{\mathbf{S} \mathbf{f}}^{\top} + \mathbf{F}\_{\mathbf{S} \mathbf{e}} \mathbf{E}\_{\mathbf{S} \mathbf{e}}^{\top}, \end{aligned} \tag{3.42}$$

from which follows

im *E*C,1*F* ⊤ <sup>C</sup>,<sup>1</sup> +*E*R,1*F* ⊤ <sup>R</sup>,<sup>1</sup> +*F*Sf*E* ⊤ Sf +*E*Se*F* ⊤ Se <sup>=</sup> im *F* <sup>C</sup>,1*E* ⊤ <sup>C</sup>,<sup>1</sup> +*F* <sup>C</sup>,2*E* ⊤ <sup>C</sup>,<sup>2</sup> +*E*C,2*F* ⊤ <sup>C</sup>,<sup>2</sup> +*F* <sup>R</sup>,1*E* ⊤ R,1 + *F* <sup>R</sup>,2*E* ⊤ <sup>R</sup>,<sup>2</sup> +*E*R,2*F* ⊤ <sup>R</sup>,<sup>2</sup> +*E*Sf*F* ⊤ Sf +*F*Se*E* ⊤ Se <sup>⊆</sup> im *F* <sup>C</sup>,1*E* ⊤ <sup>C</sup>,<sup>1</sup> *F* <sup>C</sup>,2*E* ⊤ <sup>C</sup>,<sup>2</sup> *E*C,2*F* ⊤ <sup>C</sup>,<sup>2</sup> *F* <sup>R</sup>,1*E* ⊤ R,1 *F* <sup>R</sup>,2*E* ⊤ <sup>R</sup>,<sup>2</sup> *E*R,2*F* ⊤ <sup>R</sup>,<sup>2</sup> *E*Sf*F* ⊤ Sf *F*Se*E* ⊤ Se <sup>⊆</sup> im *F* <sup>C</sup>,<sup>1</sup> *F* <sup>C</sup>,<sup>2</sup> *E*C,<sup>2</sup> *F* <sup>R</sup>,<sup>1</sup> *F* <sup>R</sup>,<sup>2</sup> *E*R,<sup>2</sup> *E*Sf *F*Se (3.39) = im *F* <sup>C</sup>,<sup>1</sup> *E*C,<sup>2</sup> *F* <sup>R</sup>,<sup>1</sup> *E*R,<sup>2</sup> *E*Sf *F*Se . (3.43)

Combining (3.41) and (3.43) we can derive

$$\begin{split} \operatorname{im} \begin{pmatrix} \mathbf{F} & \mathbf{E} \end{pmatrix} &= \operatorname{im} \begin{pmatrix} \mathbf{E}\_{\mathbf{C},1} & \mathbf{E}\_{\mathbf{R},1} & \mathbf{F}\_{\operatorname{Sf}} & \mathbf{E}\_{\operatorname{Se}} \end{pmatrix} + \\ & \operatorname{im} \begin{pmatrix} \mathbf{F}\_{\mathbf{C},1} & \mathbf{F}\_{\mathbf{C},2} & \mathbf{E}\_{\mathbf{C},2} & \mathbf{F}\_{\mathbf{R},1} & \mathbf{F}\_{\mathbf{R},2} & \mathbf{E}\_{\mathbf{R},2} & \mathbf{E}\_{\operatorname{Sf}} & \mathbf{F}\_{\operatorname{Se}} \end{pmatrix} \\ & \subseteq \operatorname{im} \begin{pmatrix} \mathbf{F}\_{\mathbf{C},1} & \mathbf{E}\_{\mathbf{C},2} & \mathbf{F}\_{\mathbf{R},1} & \mathbf{E}\_{\mathbf{R},2} & \mathbf{E}\_{\operatorname{Sf}} & \mathbf{F}\_{\operatorname{Se}} \end{pmatrix} \subseteq \operatorname{im} \begin{pmatrix} \mathbf{F} & \mathbf{E} \end{pmatrix}. \end{split} \tag{3.444}$$

Thus, equality holds in the above formula and we have

$$\text{rank}\begin{pmatrix} \mathbf{F}\_{\text{C},1} & \mathbf{E}\_{\text{C},2} & \mathbf{F}\_{\text{R},1} & \mathbf{E}\_{\text{R},2} & \mathbf{E}\_{\text{Sf}} & \mathbf{F}\_{\text{Se}} \end{pmatrix} = \text{rank}\begin{pmatrix} \mathbf{F} & \mathbf{E} \end{pmatrix} \stackrel{\text{(2.5b)}}{=} \text{KN}\_{\text{E}}. \tag{3.45}$$

Hence, the square matrix (*F* <sup>C</sup>,<sup>1</sup> *E*C,<sup>2</sup> *F* <sup>R</sup>,<sup>1</sup> *E*R,<sup>2</sup> *E*Sf *F*Se) has full rank and is invertible. From Bloch and Crouch [1999] it follows that under the above rank condition (3.45) the kernel representation (3.27) can be formulated as the inputoutput representation (3.36). The matrix *Z* can be determined by the following calculation law which is formally derived in Appendix B.2:

$$\mathbf{Z} = -\mathbf{Z}^{\top} = -\begin{pmatrix} \mathbf{F}\_{\mathrm{C},1} & \mathbf{E}\_{\mathrm{C},2} & \mathbf{F}\_{\mathrm{R},1} & \mathbf{E}\_{\mathrm{R},2} & \mathbf{E}\_{\mathrm{Sf}} & \mathbf{F}\_{\mathrm{Se}} \end{pmatrix}^{-1} \tag{3.46}$$

$$\cdot \begin{pmatrix} \mathbf{E}\_{\mathrm{C},1} & \mathbf{F}\_{\mathrm{C},2} & \mathbf{E}\_{\mathrm{R},1} & \mathbf{F}\_{\mathrm{R},2} & \mathbf{F}\_{\mathrm{Sf}} & \mathbf{E}\_{\mathrm{Se}} \end{pmatrix}.$$

We continue with our example to illustrate the reformulation of a Dirac structure in an explicit input-output form.

#### **Example 3.24:**

*Consider the Dirac structure from Example 3.20 given in an implicit representation:*

<sup>D</sup>(*x*1) = {( *f C*1 *f C*2 *f C*3 *f R f S f f Se* , *eC*<sup>1</sup> *eC*<sup>2</sup> *eC*<sup>3</sup> *eR eS f eSe* ) ∈ R <sup>6</sup>*<sup>K</sup>* <sup>×</sup><sup>R</sup> 6*K* | 0 −*I* 0 0 0 *I* 0 0 0 0 0 0 *I* 0 0 0 0 0 | {z } *F*<sup>C</sup> 0 0 0 *I* 0 0 |{z} *F*<sup>R</sup> −*I* 0 0 0 0 0 | {z } *F*Sf −*U* −1 (*x*1) 0 0 *I I* 0 | {z } *F*Se(*x*1) −*f <sup>C</sup>*<sup>1</sup> −*f <sup>C</sup>*<sup>2</sup> −*f <sup>C</sup>*<sup>3</sup> −*f <sup>R</sup> f S f f Se* + 0 0 *I* 0 0 0 *U*(*x*1) 0 0 0 0 0 0 0 0 0 −*I* 0 | {z } *E*C(*x*1) 0 0 *U*(*x*1) 0 0 0 | {z } *E*R(*x*1) 0 *I I* 0 0 *I* |{z} *E*Sf 0 0 −*U*(*x*1) 0 0 0 | {z } *E*Se(*x*1) *eC*<sup>1</sup> *eC*<sup>2</sup> *eC*<sup>3</sup> *eR eS f eSe* = 0}. (3.47)

*Recall that N*<sup>C</sup> = 3*, N*<sup>R</sup> = 1 = *N*Sf = 1 = *N*Se = 1 *and that U*(*x*1) *has full rank (see Example 3.7). With the matrices in* (3.47)*, Assumption 3.22 is fulfilled as* rank(*E*Sf *F*Se(*x*1)) = 2*K. Hence, we can apply Lemma 3.23 to determine an explicit representation of* (3.47)*. First, we search splittings of F* <sup>C</sup> (*x*) *and*

*F* <sup>R</sup> (*x*) *such that* (3.39a) *and* (3.39b) *are fulfilled. Take*

$$\boldsymbol{\mathcal{F}}\_{\rm C,1} = \begin{pmatrix} -I & \mathbf{0} \\ \mathbf{0} & I \\ \mathbf{0} & \mathbf{0} \\ \mathbf{0} & \mathbf{0} \\ \mathbf{0} & \mathbf{0} \\ \mathbf{0} & \mathbf{0} \end{pmatrix}, \quad \boldsymbol{\mathcal{F}}\_{\rm C,2} = \begin{pmatrix} \mathbf{0} \\ \mathbf{0} \\ \mathbf{0} \\ \mathbf{0} \\ I \\ \mathbf{0} \end{pmatrix}, \tag{3.48}$$

*and F* <sup>R</sup>,<sup>1</sup> = *F* <sup>R</sup>*, i.e., F* <sup>R</sup>,<sup>2</sup> *is an empty matrix. It can be easily verified that this choice satisfies the conditions in* (3.39)*. Thus, we may evaluate* (3.38) *with this splitting choice to determine the matrix Z* (*x*) *and obtain the following explicit representation of* (3.47)*:*

$$\mathbb{D}(\mathbf{x}\_{1}) = \{ (\begin{pmatrix} \mathbf{f}\_{C\_{1}} \\ \mathbf{f}\_{C\_{2}} \\ \mathbf{f}\_{C\_{3}} \\ \mathbf{f}\_{R} \\ \mathbf{f}\_{S\varepsilon} \end{pmatrix}, \begin{pmatrix} \mathbf{e}\_{C\_{1}} \\ \mathbf{e}\_{C\_{2}} \\ \mathbf{e}\_{C\_{3}} \\ \mathbf{e}\_{R} \\ \mathbf{e}\_{S\varepsilon} \end{pmatrix} \} \in \mathbb{R}^{6K} \times \mathbb{R}^{6K} \mid$$

$$\begin{pmatrix} -\mathbf{f}\_{C\_{2}} \\ -\mathbf{f}\_{C\_{3}} \\ \mathbf{e}\_{C\_{1}} \\ -\mathbf{f}\_{R} \\ \mathbf{e}\_{S\varepsilon} \\ \mathbf{f}\_{S\varepsilon} \end{pmatrix} = \begin{pmatrix} \mathbf{0} & -I & -\mathbf{U}^{-1}(\mathbf{x}\_{1}) & \mathbf{0} & I & \mathbf{0} \\ I & \mathbf{0} & \mathbf{0} & \mathbf{0} & \mathbf{0} & \mathbf{0} \\ \mathbf{U}^{-1}(\mathbf{x}\_{1}) & \mathbf{0} & \mathbf{0} & I & \mathbf{0} & -I \\ \mathbf{0} & \mathbf{0} & -I & \mathbf{0} & \mathbf{0} & \mathbf{0} \\ -I & \mathbf{0} & \mathbf{0} & \mathbf{0} & \mathbf{0} & \mathbf{0} \\ \mathbf{0} & \mathbf{0} & I & \mathbf{0} & \mathbf{0} & \mathbf{0} \end{pmatrix} \begin{pmatrix} \mathbf{e}\_{C\_{2}} \\ \mathbf{e}\_{C\_{3}} \\ -f\_{C\_{1}} \\ \mathbf{e}\_{R} \\ \mathbf{e}\_{S\varepsilon} \\ \mathbf{e}\_{S\varepsilon} \end{pmatrix} \mid. \tag{3.49}$$

As can be seen from the above example, Lemma 3.23 assigns the variables of the source elements appropriately to inputs and outputs of the Dirac structure (cf. (3.37)). By this, the resulting Dirac structure has Property 3.21. It follows from Lemma 3.23, that Assumption 3.22 is a sufficient condition for the existence of a Dirac structure representation with Property 3.21. Of course, it would be desirable to show that Assumption 3.22 is also necessary. However, for a proof of necessity, the non-uniqueness of an input-output representation of a Dirac

structure is a stumbling block. As a remedy, the next proposition shows that there is some kind of uniqueness, viz. that the input-output representation is unique for a certain arrangement of variables.

**Proposition 3.25 (Uniqueness of** *Z* (*x*)**)** *For any given order of the variables in* (3.37)*, the matrix Z* (*x*) *in* (3.36) *is unique. This statement is independent of Assumption 3.22.*

#### Proof:

For the sake of releasing notational burden we will suppress the argument *x* to the matrices during the proof. Let *Z* and *Z* ′ ∈ R *KN*E×*KN*<sup>E</sup> be two matrices fulfilling the equations

$$
\begin{pmatrix} \mathbf{y}\_{\text{C}} \\ \mathbf{y}\_{\text{R}} \\ \mathbf{y}\_{\text{P}} \end{pmatrix} = \mathbf{Z} \begin{pmatrix} \mathbf{u}\_{\text{C}} \\ \mathbf{u}\_{\text{R}} \\ \mathbf{u}\_{\text{P}} \end{pmatrix} \qquad \text{and} \qquad \begin{pmatrix} \mathbf{y}\_{\text{C}} \\ \mathbf{y}\_{\text{R}} \\ \mathbf{y}\_{\text{P}} \end{pmatrix} = \mathbf{Z}' \begin{pmatrix} \mathbf{u}\_{\text{C}} \\ \mathbf{u}\_{\text{R}} \\ \mathbf{u}\_{\text{P}} \end{pmatrix}. \tag{3.50}
$$

Recall (3.37) and that dimD = *KN*E. As (*y* ⊤ C *y* ⊤ R *y* ⊤ P ) <sup>⊤</sup> linearly depends on (*u* ⊤ <sup>C</sup> *u* ⊤ <sup>R</sup> *u* ⊤ P ) <sup>⊤</sup>, we have that D is isomorphic to R *KN*<sup>E</sup> via

$$\mathbb{R}^{KN\_{\rm E}} \to \mathbb{D}, \quad \begin{pmatrix} \mathfrak{u}\_{\rm C} \\ \mathfrak{u}\_{\rm R} \\ \mathfrak{u}\_{\rm P} \end{pmatrix} \mapsto \left( \begin{pmatrix} \mathbf{f}\_{\rm C,1} \\ \mathbf{f}\_{\rm C,2} \\ \mathbf{f}\_{\rm R,1} \\ \mathbf{f}\_{\rm R,2} \\ \mathbf{f}\_{\rm S\rm C} \\ \mathbf{f}\_{\rm S\rm e} \end{pmatrix}, \begin{pmatrix} \mathfrak{e}\_{\rm C,1} \\ \mathbf{e}\_{\rm C,2} \\ \mathbf{e}\_{\rm R,1} \\ \mathbf{e}\_{\rm S\rm e} \\ \mathbf{e}\_{\rm S\rm e} \end{pmatrix} \right) \quad \text{where} \quad \begin{pmatrix} \mathfrak{y}\_{\rm C} \\ \mathfrak{y}\_{\rm R} \\ \mathfrak{y}\_{\rm P} \end{pmatrix} = \mathbf{Z} \begin{pmatrix} \mathfrak{u}\_{\rm C} \\ \mathfrak{u}\_{\rm R} \\ \mathfrak{u}\_{\rm P} \end{pmatrix}, \tag{3.51}$$

$$\mathbb{D} \to \mathbb{R}^{KN\_{\mathbb{E}}}, \quad \left( \begin{array}{c} \mathbf{e}\_{\text{C},1} \\ \mathbf{e}\_{\text{C},2} \\ \mathbf{e}\_{\text{R},1} \\ \mathbf{e}\_{\text{S},2} \\ \mathbf{e}\_{\text{Se}} \end{array} \right), \left( \begin{array}{c} \mathbf{f}\_{\text{C},1} \\ \mathbf{f}\_{\text{C},2} \\ \mathbf{f}\_{\text{R},1} \\ \mathbf{f}\_{\text{S},2} \\ \mathbf{f}\_{\text{Se}} \end{array} \right) \mapsto \left( \begin{array}{c} \mathbf{u}\_{\text{C}} \\ \mathbf{u}\_{\text{R}} \\ \mathbf{u}\_{\text{P}} \end{array} \right). \tag{3.52}$$

From (3.50) it follows that

$$\mathbf{Z}\begin{pmatrix}\mu\_{\rm C} \\ \mu\_{\rm R} \\ \mu\_{\rm P}\end{pmatrix} = \mathbf{Z}'\begin{pmatrix}\mu\_{\rm C} \\ \mu\_{\rm R} \\ \mu\_{\rm P}\end{pmatrix} \tag{3.53}$$

and thus *Z* = *Z* ′ as *u* ⊤ <sup>C</sup> *u* ⊤ <sup>P</sup> *u* ⊤ R ⊤ ranges over all of R *KN*E.

Based on Proposition 3.25, we can now show that Assumption 3.22 is also a necessary condition for the existence of an explicit Dirac structure representation with Property 3.21.

#### **Proposition 3.26 (Existence condition)**

*Assumption 3.22 is a necessary and sufficient condition for the existence of an input-output representation of* (3.27) *which has Property 3.21. This statement is true independent of the specific realization of F* (*x*) *and E* (*x*)*in* (3.27) *(cf. Remark 2.19).*

#### Proof:

From the proof of Lemma 3.23 it follows that Assumption 3.22 is a sufficient condition for transferring (3.27) into an input-output representation with Property 3.21. So it is left to show that it is also necessary. To this end, we use the uniqueness of *Z* (*x*) from Proposition 3.25. For the sake of brevity, we neglect the argument *<sup>x</sup>* and the supplement "for all *<sup>x</sup>* <sup>∈</sup> <sup>X</sup>" in this proof. Moreover, we give a shorthand to two matrices:

$$\mathbf{X} = \begin{pmatrix} \mathbf{F}\_{\mathbf{C},1} & \mathbf{E}\_{\mathbf{C},2} & \mathbf{F}\_{\mathbf{R},1} & \mathbf{E}\_{\mathbf{R},2} & \mathbf{E}\_{\mathbf{S}f} & \mathbf{F}\_{\mathbf{S}e} \end{pmatrix} \in \mathbb{R}^{K\mathbb{N}\_{\mathbb{E}} \times K\mathbb{N}\_{\mathbb{E}}},\tag{3.54a}$$

$$\mathbf{Y} = \begin{pmatrix} \mathbf{E}\_{\mathbf{C},1} & \mathbf{F}\_{\mathbf{C},2} & \mathbf{E}\_{\mathbf{R},1} & \mathbf{F}\_{\mathbf{R},2} & \mathbf{F}\_{\mathbf{S}f} & \mathbf{E}\_{\mathbf{S}e} \end{pmatrix} \in \mathbb{R}^{K\mathbb{N}\_{\mathbb{E}} \times K\mathbb{N}\_{\mathbb{E}}}.\tag{3.54b}$$

Assume we can write D in both forms (3.27) and (3.36). Moreover, Assumption 3.22 is fulfilled if *X* has full rank. Note that in the situation of Lemma 3.23 we have *<sup>Z</sup>* <sup>=</sup> <sup>−</sup>*<sup>X</sup>* <sup>−</sup>1*<sup>Y</sup>* which gives a hint that we should prove and use *XZ* <sup>=</sup> <sup>−</sup>*<sup>Y</sup>*

along the way. As an element (*f* , *e*) of D fulfills the equations in (3.27), we have

$$\mathbf{F} \begin{pmatrix} -\mathbf{f}\_{\text{C,1}} \\ -\mathbf{f}\_{\text{C,2}} \\ -\mathbf{f}\_{\text{R,1}} \\ -\mathbf{f}\_{\text{R,2}} \\ \mathbf{f}\_{\text{Sf}} \\ \mathbf{f}\_{\text{Se}} \end{pmatrix} + \mathbf{E} \begin{pmatrix} \mathbf{e}\_{\text{C,1}} \\ \mathbf{e}\_{\text{C,2}} \\ \mathbf{e}\_{\text{R,1}} \\ \mathbf{e}\_{\text{R,2}} \\ \mathbf{e}\_{\text{Sf}} \\ \mathbf{e}\_{\text{Se}} \end{pmatrix} = \mathbf{0} \tag{3.55}$$

or equivalently—after reordering<sup>11</sup>:

$$\mathbf{X} \begin{pmatrix} \mathbf{y}\_{\text{C}} \\ \mathbf{y}\_{\text{R}} \\ \mathbf{y}\_{\text{P}} \end{pmatrix} = -\mathbf{Y} \begin{pmatrix} \mu\_{\text{C}} \\ \mu\_{\text{R}} \\ \mu\_{\text{P}} \end{pmatrix}. \tag{3.56}$$

The same element (*f* , *e*) also fulfills (3.36), i.e., we have

$$
\begin{pmatrix} \mathbf{y}\_{\text{C}} \\ \mathbf{y}\_{\text{R}} \\ \mathbf{y}\_{\text{P}} \end{pmatrix} = \mathbf{Z} \begin{pmatrix} \mu\_{\text{C}} \\ \mu\_{\text{R}} \\ \mu\_{\text{P}} \end{pmatrix}, \tag{3.57}
$$

where *Z* is unique according to Proposition 3.25. By multiplying with *X* from right we obtain

$$\mathbf{X} \begin{pmatrix} \mathbf{y}\_{\text{C}} \\ \mathbf{y}\_{\text{R}} \\ \mathbf{y}\_{\text{P}} \end{pmatrix} = \mathbf{X} \mathbf{Z} \begin{pmatrix} \mu\_{\text{C}} \\ \mu\_{\text{R}} \\ \mu\_{\text{P}} \end{pmatrix}. \tag{3.58}$$

Combining (3.56) and (3.58) yields

$$\mathbf{XZ} \begin{pmatrix} \mathfrak{u}\_{\mathrm{C}} \\ \mathfrak{u}\_{\mathrm{R}} \\ \mathfrak{u}\_{\mathrm{P}} \end{pmatrix} = -\mathbf{Y} \begin{pmatrix} \mathfrak{u}\_{\mathrm{C}} \\ \mathfrak{u}\_{\mathrm{R}} \\ \mathfrak{u}\_{\mathrm{P}} \end{pmatrix}. \tag{3.59}$$

<sup>11</sup>cf. (B.5) and (B.6)

Whence *XZ* = −*Y* since (*u* ⊤ <sup>C</sup> *u* ⊤ <sup>R</sup> *u* ⊤ P ) <sup>⊤</sup> ranges over all of R *KN*E. Let us now investigate the rank of *<sup>X</sup>*. First, note that im*<sup>X</sup>* <sup>=</sup> im(*X XZ*) as im*XZ* <sup>⊆</sup> im*X*. From this the statement that *X* has full rank follows:

$$\text{rank}\,\mathbf{X} = \text{rank}\,\left(\mathbf{X}\,\mathbf{X}\mathbf{Z}\right) \stackrel{\text{\tiny{\textbf{3.59}}}}{=} \text{rank}\,\left(\mathbf{X}\,-\mathbf{Y}\right) \stackrel{\text{\tiny{\textbf{3.54}}}}{=} \text{rank}\,\left(\mathbf{F}\,\mathbf{E}\right) \stackrel{\text{\tiny{\textbf{2.3b}}}}{=} \text{KN}\_{\text{E.}}\,\left(\mathbf{3.60}\right).$$

Note that (3.60) holds for any realization of *F* and *E*. Moreover, every submatrix in *X* must have full column rank. In particular, Assumption 3.22 holds.

Lemma 3.23 presents a method which allows to convert the Dirac structure (3.27) to an explicit form (3.36). The independence of source elements in Assumption 3.22 was proven to be necessary and sufficient for the existence of (3.36). Note that Lemma 3.23 does not make any assumptions on the presence of dependent storages. For the aim of deriving an explicit PHS, dependent storages are particularly unpleasant: they contribute to the energy in a system without having a dedicated representation in the system's state vector. Systems with dependent storages lead in general to mathematical models in forms of DAEs [Borutzky, 2010, p. 142]. Therefore, we now consider an important special case of (3.36) which—in addition to independent sources—also requires independent storages. Later, we will relax the latter restriction and allow for dependent storages.

**Assumption 3.27 (Independent storages and sources)** *The matrices in* (3.27) *fulfill* rank(*<sup>F</sup>* <sup>C</sup> (*x*) *<sup>E</sup>*Sf(*x*) *<sup>F</sup>*Se (*x*)) = *<sup>K</sup>*(*N*<sup>C</sup> <sup>+</sup>*N*Sf <sup>+</sup>*N*Se), <sup>∀</sup>*<sup>x</sup>* <sup>∈</sup> <sup>X</sup>. (3.61)

Note that Assumption 3.27 implies Assumption 3.22. The subsequent corollary makes use of Assumption 3.27 and addresses an important special case of Lemma 3.23.

**Corollary 3.28 (Input-output representation under Assumption 3.27)** *Consider a Dirac structure* (3.27) *which fulfills Assumption 3.27. The Dirac structure* (3.27) *can then be formulated in an input-output representation*

<sup>D</sup>(*x*) = {( *f* C *f* R *f* Sf *f* Se , *e*<sup>C</sup> *e*<sup>R</sup> *e*Sf *e*Se ) ∈ R *KN*<sup>E</sup> <sup>×</sup><sup>R</sup> *KN*<sup>E</sup> <sup>|</sup> *y*C *y*R *y*P = *Z*CC (*x*) −*Z*CR (*x*) −*Z*CP (*x*) *Z* ⊤ CR (*x*) *Z*RR (*x*) −*Z*RP (*x*) *Z* ⊤ CP (*x*) *Z* ⊤ RP (*x*) *Z*PP (*x*) | {z } *Z*(*x*) *u*<sup>C</sup> *u*<sup>R</sup> *u*P }, (3.62)

*where <sup>Z</sup>* (*x*) = <sup>−</sup>*<sup>Z</sup>* <sup>⊤</sup> (*x*) *for all <sup>x</sup>* <sup>∈</sup> <sup>X</sup> *and*

$$\mathfrak{u}\_{\rm C} = \mathfrak{e}\_{\rm C}, \qquad \mathfrak{u}\_{\rm R} = \begin{pmatrix} \mathfrak{e}\_{\rm R, 1} \\ -\mathfrak{f}\_{\rm R, 2} \end{pmatrix}, \qquad \mathfrak{u}\_{\rm P} = \begin{pmatrix} \mathfrak{f}\_{\rm Sf} \\ \mathfrak{e}\_{\rm Se} \end{pmatrix}, \tag{3.63a}$$

$$\mathbf{y}\_{\text{C}} = -\mathbf{f}\_{\text{C}}, \qquad \mathbf{y}\_{\text{R}} = \begin{pmatrix} -\mathbf{f}\_{\text{R},1} \\ \mathbf{e}\_{\text{R},2} \end{pmatrix}, \qquad \mathbf{y}\_{\text{P}} = \begin{pmatrix} \mathbf{e}\_{\text{Sf}} \\ \mathbf{f}\_{\text{Se}} \end{pmatrix}. \tag{3.63b}$$

*The matrix Z* (*x*) *is given by* (3.38) *with F* <sup>C</sup>,<sup>1</sup> (*x*) = *F* <sup>C</sup> (*x*)*, E*C,<sup>1</sup> (*x*) = *E*<sup>C</sup> (*x*) *and* (*F* <sup>R</sup>,<sup>1</sup> (*x*) *F* <sup>R</sup>,<sup>2</sup> (*x*)) *a splitting of F* <sup>R</sup> (*x*) *such that* (3.39) *is fulfilled. Moreover, Assumption 3.27 is necessary and sufficient for the existence of the representation* (3.62) *with vectors as in* (3.63)*.*

#### Proof:

The proof of Corollary 3.28 follows directly from Lemma 3.23 under Assumption 3.27, which also shows that Assumption 3.27 is a sufficient condition. The proof for the necessity is the same as the one given for Proposition 3.26.

Note that Corollary 3.28 requires only a splitting of R-type power variables; the splitting of C-type variables disappears.<sup>12</sup> The corollary is illustrated in the following example which continues the previous ones:

#### **Example 3.29:**

*Recall the Dirac structure from Example 3.24 in implicit representation* (3.47)*. Assumption 3.27 is satisfied as* rank(*F* <sup>C</sup> *E*Sf *F*Se(*x*1)) = 5*K for all x*1*. Hence, we can apply Corollary 3.28 to determine an explicit representation of* (3.47)*. The splitting F* <sup>R</sup>,<sup>2</sup> = *F* <sup>R</sup> *satisfies the conditions in* (3.39)*. By using this splitting we obtain the following explicit representation of* (3.47)*:*

$$\mathbb{D}(\mathbf{x}\_{1}) = \{ (\begin{pmatrix} \mathbf{f}\_{C\_{1}} \\ \mathbf{f}\_{C\_{2}} \\ \mathbf{f}\_{C\_{3}} \\ \mathbf{f}\_{R} \\ \mathbf{f}\_{S\epsilon} \end{pmatrix}, \begin{pmatrix} \mathbf{e}\_{C\_{1}} \\ \mathbf{e}\_{C\_{2}} \\ \mathbf{e}\_{C\_{3}} \\ \mathbf{e}\_{R} \\ \mathbf{e}\_{S\epsilon} \end{pmatrix} \} \in \mathbb{R}^{6K} \times \mathbb{R}^{6K} \mid$$

$$\begin{pmatrix} -\mathbf{f}\_{C\_{1}} \\ -\mathbf{f}\_{C\_{2}} \\ -\mathbf{f}\_{C\_{3}} \\ \mathbf{e}\_{R} \\ \mathbf{e}\_{S\epsilon} \\ \mathbf{e}\_{S\epsilon} \end{pmatrix} = \begin{pmatrix} \mathbf{0} & \mathbf{0} & \mathbf{0} & I & \mathbf{0} & \mathbf{0} \\ \mathbf{0} & \mathbf{0} & I & \mathbf{U}^{-1}(\mathbf{x}\_{1}) & -I & \mathbf{0} \\ \mathbf{0} & -I & \mathbf{0} & \mathbf{0} & \mathbf{0} & \mathbf{0} \\ -I & \mathbf{0} & \mathbf{0} & \mathbf{0} & \mathbf{0} & \mathbf{I} \\ -I & -\mathbf{U}^{-1}(\mathbf{x}\_{1}) & \mathbf{0} & \mathbf{0} & \mathbf{0} & \mathbf{I} \\ \mathbf{0} & I & \mathbf{0} & \mathbf{0} & \mathbf{0} & \mathbf{0} \\ \mathbf{0} & \mathbf{0} & -I & \mathbf{0} & \mathbf{0} & \mathbf{0} \end{pmatrix} \begin{pmatrix} \mathbf{e}\_{C\_{1}} \\ \mathbf{e}\_{C\_{2}} \\ \mathbf{e}\_{C\_{3}} \\ \mathbf{e}\_{S} \\ -\mathbf{f}\_{R} \\ \mathbf{e$$

*The dashed lines indicate the matrix blocks according to* (3.62)*. Compared to* (3.49) *in Example 3.29,* (3.64) *is another explicit representation of* (3.47)*. In particular, in* (3.64) *all storage flows f* <sup>C</sup> *are on the left side of the equation system.*

The previous example illustrates that Corollary 3.28 yields an explicit representation in which the flows *f* <sup>C</sup> are on the left side of the equation system. Recalling the constitutive relations of C-type elements (3.6), in particular *f* <sup>C</sup> = *x*˙, gives us a hint why this choice is useful: it paves the way for a dynamics equation of form *x*˙ = *f* (*x*,*u*). The next subsection is devoted to deriving such a model.

<sup>12</sup>In fact, this is the property with which Corollary 3.28 particularizes Lemma 3.23.

#### 3.2.6 Formulation of an Explicit Port-Hamiltonian System

Based on the Dirac structure from Corollary 3.28 we now derive an explicit PHS. To this end, we merge the explicit form of the Dirac structure with the constitutive relations of storages and resistors.

Consider a Dirac structure of the form (3.62) with vectors as in (3.63). Let us first elaborate the constitutive relations of the storage elements and the resistive elements of the bond graph. For C-type elements, the constitutive relations read

$$\mathbf{y}\_{\text{C}} \stackrel{\text{\tiny{\text{3.63}}}}{=} -\mathbf{f}\_{\text{C}} \stackrel{\text{\tiny{\text{3.6}}}}{=} -\dot{\mathbf{x}}, \qquad \mathbf{u}\_{\text{C}} \stackrel{\text{\tiny{\text{3.63}}}}{=} \mathbf{e}\_{\text{C}} \stackrel{\text{\tiny{\text{3.6}}}}{=} \frac{\partial V}{\partial \mathbf{x}}(\mathbf{x}). \tag{3.65}$$

For R-type elements, the constitutive relation (3.7) from Subsection 3.2.2 read *f* <sup>R</sup> = *D* (*x*) *e*<sup>R</sup> with *D* (*x*) = *D* (*x*) <sup>⊤</sup> <sup>⪰</sup> 0. In the Dirac structure (3.62), the vectors *f* <sup>R</sup> and *e*<sup>R</sup> are split and their components are assigned to inputs *u*<sup>R</sup> and outputs *y*R. In the following, make the assumption that this splitting can also be applied to *f* <sup>R</sup> = *D* (*x*) *e*<sup>R</sup> without loosing the positive semi-definiteness of *D* (*x*):

**Assumption 3.30 (Resistive relation in input-output form)** *The resistive relations can be reorganized as*

$$\boldsymbol{\mathfrak{u}}\_{\mathrm{R}} = -\boldsymbol{\mathfrak{R}}\left(\boldsymbol{x}\right)\mathbf{y}\_{\mathrm{R}},\tag{3.66}$$

*with R*˜ (*x*) = *R*˜ (*x*) <sup>⊤</sup> <sup>⪰</sup> <sup>0</sup> *and <sup>u</sup>*R*, <sup>y</sup>*<sup>R</sup> *as in* (3.63)*.*

In Appendix B.3 it is argued that Assumption 3.30 is not restrictive. The negative sign in (3.66) accounts for the opposite orientations of the vectors (*f* <sup>R</sup>, *e*R) and (*u*R, *y*R) (see (3.37)). Now we can merge the Dirac structure and the constitutive relations of storages and resistors into an explicit PHS.

#### **Lemma 3.31 (Port-Hamiltonian formulation)**

*Given an explicit Dirac structure* (3.62) *and constitutive relations of storages as in* (3.65)*. Let Assumption 3.30 hold, that is, let the constitutive relations of resistive elements be given as in* (3.66)*. Then,* (3.62)*,* (3.65)*, and* (3.66) *can be written as explicit input-state-output PHS of the form* (2.12)*. The state vector and the Hamiltonian of the PHS are given by x and H* (*x*) = *V* (*x*) *from* (3.65)*, respectively. The input vector of the PHS is u* = *u*P*; the output vector is y* = *y*<sup>P</sup> *. The matrices of the PHS are calculated as:*

$$\mathbf{J}\left(\mathbf{x}\right) = -\frac{1}{2}\mathbf{Z}\_{\text{CR}}\left(\mathbf{x}\right)\left(\tilde{\mathbf{K}}\left(\mathbf{x}\right)\tilde{\mathbf{R}}\left(\mathbf{x}\right) - \tilde{\mathbf{R}}\left(\mathbf{x}\right)\tilde{\mathbf{K}}^{\top}\left(\mathbf{x}\right)\right)\mathbf{Z}\_{\text{CR}}^{\top}\left(\mathbf{x}\right) - \mathbf{Z}\_{\text{CC}}\left(\mathbf{x}\right),\tag{3.67a}$$

$$\mathbf{R}(\mathbf{x}) = -\frac{1}{2}\mathbf{Z}\_{\text{CR}}(\mathbf{x})\left(\mathbf{\tilde{K}}(\mathbf{x})\mathbf{\tilde{R}}(\mathbf{x}) + \mathbf{\tilde{R}}(\mathbf{x})\mathbf{\tilde{K}}^{\top}(\mathbf{x})\right)\mathbf{Z}\_{\text{CR}}^{\top}(\mathbf{x})\,,\tag{3.67b}$$

$$\mathbf{G}(\mathbf{x}) = -\frac{1}{2}\mathbf{Z}\_{\text{CR}}(\mathbf{x}) \left( \tilde{\mathbf{K}}(\mathbf{x})\tilde{\mathbf{R}}(\mathbf{x}) - \tilde{\mathbf{R}}(\mathbf{x})\tilde{\mathbf{K}}^{\top}(\mathbf{x}) \right) \mathbf{Z}\_{\text{RP}}(\mathbf{x}) + \mathbf{Z}\_{\text{CP}}(\mathbf{x}), \tag{3.67c}$$

$$\mathbf{P}(\mathbf{x}) = -\frac{1}{2}\mathbf{Z}\_{\text{CR}}(\mathbf{x})\left(\tilde{\mathbf{K}}(\mathbf{x})\tilde{\mathbf{R}}(\mathbf{x}) + \tilde{\mathbf{R}}(\mathbf{x})\tilde{\mathbf{K}}^{\top}(\mathbf{x})\right)\mathbf{Z}\_{\text{RP}}(\mathbf{x})\,,\tag{3.67d}$$

$$\mathbf{M}(\mathbf{x}) = \left. \frac{1}{2} \mathbf{Z}\_{\mathrm{RP}}^{\top}(\mathbf{x}) \left( \tilde{\mathbf{K}}(\mathbf{x}) \tilde{\mathbf{R}}(\mathbf{x}) - \tilde{\mathbf{R}}(\mathbf{x}) \tilde{\mathbf{K}}^{\top}(\mathbf{x}) \right) \mathbf{Z}\_{\mathrm{RP}}(\mathbf{x}) + \mathbf{Z}\_{\mathrm{PP}}(\mathbf{x}), \tag{3.67e}$$

$$\mathbf{S}(\mathbf{x}) = \begin{array}{c} \frac{1}{2} \mathbf{Z}\_{\mathrm{RP}}^{\top}(\mathbf{x}) \left( \tilde{\mathbf{K}}(\mathbf{x}) \tilde{\mathbf{R}}(\mathbf{x}) + \tilde{\mathbf{R}}(\mathbf{x}) \tilde{\mathbf{K}}^{\top}(\mathbf{x}) \right) \mathbf{Z}\_{\mathrm{RP}}(\mathbf{x}), \\\\ \text{where} \end{array} \tag{3.676}$$

$$\tilde{\mathbf{K}}\left(\mathbf{x}\right) = \quad (\mathbf{I} + \tilde{\mathbf{R}}\left(\mathbf{x}\right) \mathbf{Z}\_{\text{RR}}\left(\mathbf{x}\right))^{-1}. \tag{3.679}$$

*Remark* 3.32 (Existence of *K*˜ )*.* The existence of matrix *K*˜ (*x*) in (3.67g) will be discussed later in Lemma 3.33.

#### Proof:

The proof follows four steps: (i) we eliminate the resistive variables in (3.62); (ii) we decompose the structure obtained from (i) into symmetric and skewsymmetric parts; (iii) we substitute storage variables with (3.65); (iv) we show that the definiteness condition (2.13) holds. Again, we omit the argument *x* and the supplement "for all *<sup>x</sup>* <sup>∈</sup> <sup>X</sup>" for all matrices in this proof.

Substituting the second row from the equation system in (3.62) into (3.66) yields

$$
\mu\_{\rm R} = -\tilde{\mathbf{R}} \mathbf{Z}\_{\rm CR}^{\top} \boldsymbol{\mu}\_{\rm C} + \tilde{\mathbf{R}} \mathbf{Z}\_{\rm RP} \boldsymbol{\mu}\_{\rm P} - \tilde{\mathbf{R}} \mathbf{Z}\_{\rm RR} \boldsymbol{\mu}\_{\rm R}
$$

$$
\Leftrightarrow \left(\mathbf{I} + \tilde{\mathbf{R}} \mathbf{Z}\_{\rm CR}\right) \boldsymbol{\mu}\_{\rm R} = -\tilde{\mathbf{R}} \mathbf{Z}\_{\rm CR}^{\top} \boldsymbol{\mu}\_{\rm C} + \tilde{\mathbf{R}} \mathbf{Z}\_{\rm RP} \boldsymbol{\mu}\_{\rm P}
$$

$$
\Leftrightarrow \boldsymbol{\mu}\_{\rm R} = -\tilde{\mathbf{K}} \tilde{\mathbf{R}} \mathbf{Z}\_{\rm CR}^{\top} \boldsymbol{\mu}\_{\rm C} + \tilde{\mathbf{K}} \tilde{\mathbf{R}} \mathbf{Z}\_{\rm RP} \boldsymbol{\mu}\_{\rm P}, \tag{3.68}
$$

with *K*˜ as in (3.67g). Inserting (3.68) into the first and third row from the linear equation system in (3.62) yields

$$
\begin{pmatrix} \mathbf{y\_{C}} \\ \mathbf{y\_{P}} \end{pmatrix} = \begin{bmatrix} \begin{pmatrix} \mathbf{Z\_{CC}} & -\mathbf{Z\_{CP}} \\ \mathbf{Z\_{CP}^{\top}} & \mathbf{Z\_{PP}} \end{pmatrix} + \begin{pmatrix} \mathbf{Z\_{CR}} \\ -\mathbf{Z\_{RP}^{\top}} \end{pmatrix} \mathbf{K} \mathsf{R} \begin{pmatrix} \mathbf{Z\_{CR}^{\top}} & -\mathbf{Z\_{RP}} \end{pmatrix} \end{pmatrix} \begin{pmatrix} \mathfrak{u\_{C}} \\ \mathfrak{u\_{P}} \end{pmatrix}. \tag{3.69}
$$

The first addend in the square bracket is a skew-symmetric matrix. The second addend is decomposed into a skew-symmetric and a symmetric matrix. Using this decomposition and *R*˜ = *R*˜ <sup>⊤</sup> , (3.69) reads

$$
\begin{split}
\begin{pmatrix}
\mathbf{y}\_{\text{C}} \\
\mathbf{y}\_{\text{P}}
\end{pmatrix} &= \begin{bmatrix}
\begin{pmatrix}
\mathbf{Z}\_{\text{CC}} & -\mathbf{Z}\_{\text{CP}} \\
\mathbf{Z}\_{\text{CP}}^{\top} & \mathbf{Z}\_{\text{PP}}
\end{pmatrix} + \frac{1}{2} \begin{pmatrix}
\mathbf{Z}\_{\text{CR}} \\
\end{pmatrix}
\begin{pmatrix}
\tilde{\mathbf{K}}\tilde{\mathbf{R}} - \tilde{\mathbf{R}}\tilde{\mathbf{K}}^{\top}
\end{pmatrix}
\begin{pmatrix}
\mathbf{Z}\_{\text{CR}}^{\top} & -\mathbf{Z}\_{\text{RP}}
\end{pmatrix} \\ &+ \frac{1}{2} \begin{pmatrix}
\mathbf{Z}\_{\text{CR}} \\
\end{pmatrix}
\begin{pmatrix}
\mathbf{K}\tilde{\mathbf{R}} + \tilde{\mathbf{R}}\tilde{\mathbf{K}}^{\top}
\end{pmatrix}
\begin{pmatrix}
\mathbf{Z}\_{\text{CR}}^{\top} & -\mathbf{Z}\_{\text{RP}}
\end{pmatrix}
\end{split}
\tag{3.70}
$$

Equation (3.70) can be written as

$$
\begin{pmatrix} \mathbf{y}\_{\text{C}} \\ \mathbf{y}\_{\text{P}} \end{pmatrix} = \underbrace{\begin{bmatrix} \begin{pmatrix} -\mathbf{J} & -\mathbf{G} \\ \mathbf{G}^{\top} & \mathbf{M} \end{pmatrix} + \begin{pmatrix} \mathbf{R} & \mathbf{P} \\ \mathbf{P}^{\top} & \mathbf{S} \end{pmatrix} \end{pmatrix}}\_{=\mathbf{P}} \begin{pmatrix} \mathbf{u}\_{\text{C}} \\ \mathbf{u}\_{\text{P}} \end{pmatrix},\tag{3.71}
$$

with *<sup>J</sup>*, *<sup>G</sup>*, *<sup>M</sup>*, *<sup>R</sup>*, *<sup>P</sup>*, *<sup>S</sup>* as in (3.67) and <sup>Ψ</sup> <sup>=</sup> <sup>−</sup><sup>Ψ</sup> <sup>⊤</sup>, Θ = Θ <sup>⊤</sup>. Inserting (3.65) into (3.71) then yields (2.12). Using the idea of van der Schaft and Jeltsema [2014, p. 56], we prove the positive semi-definiteness of Θ (cf. (2.13)):

$$\left(\mathfrak{u}\_{\rm C}^{\top} \quad \mathfrak{u}\_{\rm P}^{\top}\right) \Theta \begin{pmatrix} \mathfrak{u}\_{\rm C} \\ \mathfrak{u}\_{\rm P} \end{pmatrix} = \left(\mathfrak{u}\_{\rm C}^{\top} \quad \mathfrak{u}\_{\rm P}^{\top}\right) \Theta \begin{pmatrix} \mathfrak{u}\_{\rm C} \\ \mathfrak{u}\_{\rm P} \end{pmatrix} + \underbrace{\left(\mathfrak{u}\_{\rm C}^{\top} \quad \mathfrak{u}\_{\rm P}^{\top}\right) \Psi \begin{pmatrix} \mathfrak{u}\_{\rm C} \\ \mathfrak{u}\_{\rm P} \end{pmatrix}}\_{=0} \tag{3.72}$$

$$= \begin{pmatrix} \mathfrak{u}\_{\mathbf{C}}^{\top} & \mathfrak{u}\_{\mathbf{P}}^{\top} \end{pmatrix} (\boldsymbol{\Theta} + \boldsymbol{\Psi}) \begin{pmatrix} \mathfrak{u}\_{\mathbf{C}} \\ \mathfrak{u}\_{\mathbf{P}} \end{pmatrix} \tag{3.73}$$

$$\mathbf{y} = \begin{pmatrix} \mathfrak{u}\_{\mathbf{C}}^{\top} & \mathfrak{u}\_{\mathbf{P}}^{\top} \end{pmatrix} \begin{pmatrix} \mathfrak{y}\_{\mathbf{C}} \\ \mathfrak{y}\_{\mathbf{P}} \end{pmatrix} \stackrel{\text{(2.3a),(3.66)}{=}} \mathfrak{y}\_{\mathbf{R}}^{\top} \mathfrak{R} \mathfrak{y}\_{\mathbf{R}} \ge 0. \tag{3.74}$$

In the previous lemma, the calculation of the matrices of the PHS requires the existence of a matrix *K*˜ (*x*) = (*I* + *R*˜ (*x*)*Z*RR (*x*))−<sup>1</sup> , where *R*˜ (*x*) = *R*˜ <sup>⊤</sup> (*x*) ⪰ 0 and *<sup>Z</sup>*RR (*x*) = <sup>−</sup>*<sup>Z</sup>* ⊤ RR(*x*) for all *<sup>x</sup>* <sup>∈</sup> <sup>X</sup>. The matrix *<sup>K</sup>*˜ (*x*) (or related expressions) has appeared in previous publications addressing the derivation of state-space formulations of bond graphs, e.g., Rosenberg [1971, eq. (7)], Wellstead [1979, p. 199], Donaire and Junco [2009, eq. (14)], and Lopes [2016, Remark 2]. However, to the best of our knowledge, the existence of *K*˜ has not been discussed so far. The following lemma shows that *K*˜ (*x*) always exists:

**Lemma 3.33 (Existence of** *K*˜ **)** *Let X*,*Y* ∈ R *<sup>p</sup>*×*<sup>p</sup> with X* = *X* <sup>⊤</sup> ⪰ 0 *and Y* = −*Y* <sup>⊤</sup>*. Then, the matrix K* := (*I* +*XY* ) *is regular. In particular K*˜ := *K* <sup>−</sup><sup>1</sup> *always exists.*

#### Proof:

The idea of the proof is to show that (i) we can (without loss of generality) regard *X* to be diagonal; <sup>13</sup> (ii) the matrix *K* is invertible. For (ii) we investigate first the case of *X* being positive-definite. Afterwards, we generalize to the case of *X* being positive semi-definite.

Recall that *X* is symmetric and positive semi-definite and that *Y* is skew-symmetric. Without loss of generality we may assume *X* to be diagonal. Indeed, since *X* is a symmetric and real matrix, there exists (by the Spectral Theorem) an or-

<sup>13</sup>Note that this does not immediately follow from *X* = *X* <sup>⊤</sup> <sup>⪰</sup> <sup>0</sup> but must be analyzed in relation to *I* +*XY* .

thogonal matrix *<sup>T</sup>* <sup>∈</sup> <sup>O</sup>(*p*) such that *T XT* <sup>⊤</sup> is diagonal. Moreover, *<sup>I</sup>* <sup>+</sup> *XY* is invertible if and only if *T* (*I* +*XY* )*T* <sup>⊤</sup> = *I* + (*T XT* <sup>⊤</sup>)(*TY T* <sup>⊤</sup>) = *I* +*X*˜ *Y*˜ is invertible, where *X*˜ = *T XT* <sup>⊤</sup> is diagonal and positive semi-definite and *Y*˜ = *TY T* <sup>⊤</sup> is skew-symmetric. Thus, we can assume *X* to be diagonal in the remainder of the proof.

The matrix *I* +*XY* is regular if and only if 0 is not an eigenvalue of it, that is if <sup>−</sup><sup>1</sup> is not an eigenvalue of *XY* . We will show that the only possible real-valued eigenvalue of *XY* is 0. Throughout this proof we use Spec(*X*) to denote the (real) spectrum of *X*, i.e., the set of real eigenvalues of *X*.

◦ Case 1: *<sup>X</sup>* is positive-definite. Let <sup>√</sup> *X* be a diagonal matrix which is a square root of *<sup>X</sup>*, i.e., <sup>√</sup> *X* √ *X* = *X*. Such a matrix exists and is invertible since *X* is diagonal and positive-definite. Because the spectrum of a matrix is invariant under conjugation, we have

$$\begin{split} \operatorname{Spec} \left( \mathbf{X} \mathbf{Y} \right) &= \operatorname{Spec} \left( \sqrt{\mathbf{X}}^{-1} \mathbf{X} \mathbf{Y} \sqrt{\mathbf{X}} \right) \\ &= \operatorname{Spec} \left( \sqrt{\mathbf{X}} \mathbf{Y} \sqrt{\mathbf{X}} \right) = \operatorname{Spec} \left( \sqrt{\mathbf{X}} \mathbf{Y} \sqrt{\mathbf{X}}^{\top} \right) \subseteq \{0\}, \end{split} \tag{3.75}$$

where the last inclusion holds since <sup>√</sup> *XY* <sup>√</sup> *X* ⊤ is real and skew-symmetric. Thus, <sup>−</sup>1 is not an eigenvalue of *XY* and *<sup>I</sup>* <sup>+</sup>*XY* is invertible.

◦ Case 2: *<sup>X</sup>* is (genuine) positive semi-definite. By the same conjugation argument as at the beginning of the proof (this time with a permutation matrix) we may assume without loss of generality that *X* is of the form

$$\mathbf{X} = \begin{pmatrix} \mathbf{X'} & \mathbf{0} \\ \mathbf{0} & \mathbf{0} \end{pmatrix},\tag{3.76}$$

where *X* ′ ∈ R ℓ×ℓ is a positive-definite diagonal matrix. With the same block decomposition we write *Y* as

$$\mathbf{Y} = \begin{pmatrix} \mathbf{Y}' & \mathbf{Y}''\\ \ast & \ast \end{pmatrix}, \qquad \text{where } \mathbf{Y}' \in \mathbb{R}^{\ell \times \ell}. \tag{3.77}$$

We have

$$\mathbf{XY} = \begin{pmatrix} \mathbf{X'Y'} & \mathbf{X'Y''} \\ \mathbf{0} & \mathbf{0} \end{pmatrix}. \tag{3.78}$$

Thus, Spec(*XY* ) = Spec(*X* ′*Y* ′ )∪Spec(0) ⊆ {0}, where the last inclusion uses case 1 applied to *X* ′*Y* ′ . Hence, *I* +*XY* is invertible.

Let us illustrate the insights from this subsection by deriving a PHS for the example system.

#### **Example 3.34:**

*Consider the Dirac structure from Example 3.29 in explicit representation* (3.64)*. From Example 3.7 recall the constitutive relations of storages and resistors: the three storage elements are described by an arbitrary differentiable, non-negative storage function V* (*x*)*; the resistive element has been specified by f* <sup>R</sup> = *De*<sup>R</sup> *where D* = *D* <sup>⊤</sup> <sup>≻</sup> <sup>0</sup> *arbitrary. For an inputoutput splitting of* R*-type variables as in* (3.64)*, we can write*

$$\mathbf{f}\_{\mathbb{R}} = \mathbf{D} \mathbf{e}\_{\mathbb{R}} \stackrel{\text{(3,\n° $\mathbb{A}$ )}{\iff}}{\iff} \mathbf{u}\_{\mathbb{R}} = -\underbrace{\mathbf{D}}\_{=\mathbb{R}} \mathbf{y}\_{\mathbb{R}}.\tag{3.79}$$

*Thus, Assumption 3.30 is fulfilled. With the calculation rules from Lemma 3.31, we then obtain an explicit PHS of the form* (2.12)*:*

 *x*˙1 *x*˙2 *x*˙3 = ( 0 0 0 0 0 <sup>−</sup>*<sup>I</sup>* 0 *I* 0 − *D DU* <sup>−</sup><sup>1</sup> (*x*1) 0 *U* −1 (*x*1)*D U* <sup>−</sup><sup>1</sup> (*x*1)*DU* <sup>−</sup><sup>1</sup> (*x*1) 0 0 0 0 ) ∂*H* ∂ *x* (*x*) + ( 0 0 *I* 0 0 0 − 0 −*D* 0 −*U* −1 (*x*1)*D* 0 0 ) *f S f eSe* (3.80a) *eS f f Se* = ( 0 0 *I* 0 0 0 + 0 −*D* 0 −*U* −1 (*x*1)*D* 0 0 ) <sup>⊤</sup> <sup>∂</sup>*<sup>H</sup>* ∂ *x* (*x*) + 0 0 0 *D f S f eSe* . (3.80b)

*In* (3.80) *we have <sup>H</sup>* (*x*) = *<sup>V</sup>* (*x*)*, <sup>M</sup>* (*x*) = <sup>0</sup>*, <sup>U</sup>*(*x*1) = exp(−<sup>κ</sup> diag(*x*1))*, and <sup>x</sup>* <sup>∈</sup> <sup>X</sup>*. The variables from the source elements are correctly allocated to inputs and outputs; hence, the* (3.80) *has Property 3.8. By the symmetry of D and U it can be seen that the matrices in* (3.80) *indeed have the desired symmetry and skew-symmetry properties from Definition 2.23.*

*Investigating R*(*x*1) *for the case D* = *I gives:*

$$\mathbf{R}\begin{pmatrix} \mathbf{x}\_1^\top & \mathbf{x}\_2^\top & \mathbf{x}\_3^\top \end{pmatrix} \mathbf{R}(\mathbf{x}\_1) \begin{pmatrix} \mathbf{x}\_1\\\mathbf{x}\_2\\\mathbf{x}\_3 \end{pmatrix} = \left\| \mathbf{x}\_1 + \mathbf{U}^{-1}(\mathbf{x}\_1)\mathbf{x}\_2 \right\|^2 \ge 0, \quad \forall \mathbf{x} \in \mathbb{X}. \tag{3.81}$$

*Hence, for D* = *I the matrix R*(*x*1)*is positive semi-definite which verifies the definiteness condition 2.13.*

The above example illustrates how the methods from this subsection can be used to derive an explicit PHS based on a Dirac structure and the constitutive relations of storages and resistors. In the next subsection, these methods are embedded into a main theorem which addresses the derivation of an explicit PHS from a bond graph.

#### 3.2.7 Theorem and Algorithm

This subsection first provides a theorem which summarizes the insights from subsections 3.2.3 to 3.2.6. The theorem addresses the existence of an explicit port-Hamiltonian formulation of a bond graph. Afterwards, we assemble the corresponding methods in an algorithm which calculates an explicit PHS based on a given bond graph. The theorem and the algorithm are major results of this chapter.

**Theorem 3.35 (Explicit Port-Hamiltonian Formulation of Bond Graphs)** *Given a K-dimensional bond graph as in Definition 3.5. The junction structure of the bond graph can be described by a Dirac structure in implicit form:*

$$\mathbb{D}(\mathbf{x}) = \{ (\begin{pmatrix} \mathbf{f}\_{\mathbf{C}} \\ \mathbf{f}\_{\mathbf{R}} \\ \mathbf{f}\_{\mathbf{S}\mathbf{f}} \\ \mathbf{f}\_{\mathbf{S}\mathbf{e}} \end{pmatrix}, \begin{pmatrix} \mathbf{e}\_{\mathbf{C}} \\ \mathbf{e}\_{\mathbf{R}} \\ \mathbf{e}\_{\mathbf{S}\mathbf{e}} \\ \mathbf{e}\_{\mathbf{S}\mathbf{e}} \end{pmatrix} \} \in \mathbb{R}^{KN\_{\mathbf{E}}} \times \mathbb{R}^{KN\_{\mathbf{E}}} \mid$$

$$\begin{pmatrix} \mathbf{F}\_{\mathbf{C}} \left( \mathbf{x} \right) \mathbf{F}\_{\mathbf{R}} \left( \mathbf{x} \right) \mathbf{F}\_{\mathbf{S}\mathbf{f}} \left( \mathbf{x} \right) \mathbf{F}\_{\mathbf{S}\mathbf{e}} \left( \mathbf{x} \right) \end{pmatrix} \begin{pmatrix} -\mathbf{f}\_{\mathbf{C}} \\ -\mathbf{f}\_{\mathbf{R}} \\ \mathbf{f}\_{\mathbf{S}\mathbf{f}} \\ \mathbf{f}\_{\mathbf{S}\mathbf{e}} \end{pmatrix}$$

$$+ \left( \mathbf{E}\_{\mathbf{C}} \left( \mathbf{x} \right) \mathbf{E}\_{\mathbf{R}} \left( \mathbf{x} \right) \mathbf{E}\_{\mathbf{S}\mathbf{f}} \left( \mathbf{x} \right) \mathbf{E}\_{\mathbf{S}\mathbf{e}} \left( \mathbf{x} \right) \right) \begin{pmatrix} \mathbf{e}\_{\mathbf{C}} \\ \mathbf{e}\_{\mathbf{R}} \\ \mathbf{e}\_{\mathbf{S}\mathbf{e}} \\ \mathbf{e}\_{\mathbf{S} \mathbf{e}} \end{pmatrix} = \mathbf{0} \}, \tag{3.82}$$

*where f* <sup>α</sup> = (*f i* ) ∈ R *KN*<sup>α</sup> *, <sup>e</sup>*<sup>α</sup> = (*ei*) <sup>∈</sup> <sup>R</sup> *KN*<sup>α</sup> *for all <sup>i</sup>* <sup>∈</sup> <sup>V</sup><sup>α</sup> *and <sup>F</sup>* <sup>α</sup> (*x*),*<sup>E</sup>* <sup>α</sup> (*x*) <sup>∈</sup> R *KN*E×*KN*<sup>α</sup> *with* <sup>α</sup> ∈ {C,R,Sf,Se}*. Let*

$$\text{rank}\left(\mathbf{F}\_{\text{C}}\left(\mathbf{x}\right)\mathbf{E}\_{\text{Sf}}\left(\mathbf{x}\right)\mathbf{F}\_{\text{Se}}\left(\mathbf{x}\right)\right) = K\left(N\_{\text{C}} + N\_{\text{Sf}} + N\_{\text{Se}}\right), \quad \forall \mathbf{x} \in \mathbb{X}.\tag{3.83}$$

*hold (i.e., Assumption 3.27). Then,* (3.82) *can be formulated in an explicit representation*

$$\mathbb{D}\left(\mathbf{x}\right) = \{ \begin{pmatrix} \mathbf{f}\_{\text{C}} \\ \mathbf{f}\_{\text{R}} \\ \mathbf{f}\_{\text{Sf}} \\ \mathbf{f}\_{\text{Se}} \end{pmatrix}, \begin{pmatrix} \mathbf{e}\_{\text{C}} \\ \mathbf{e}\_{\text{R}} \\ \mathbf{e}\_{\text{Sf}} \\ \mathbf{e}\_{\text{Se}} \end{pmatrix} \} \in \mathbb{R}^{KN\_{\text{E}}} \times \mathbb{R}^{KN\_{\text{E}}} \mid \begin{pmatrix} \mathbf{y}\_{\text{C}} \\ \mathbf{y}\_{\text{R}} \\ \mathbf{y}\_{\text{P}} \end{pmatrix} = \mathbf{Z}\left(\mathbf{x}\right) \begin{pmatrix} \mathbf{u}\_{\text{C}} \\ \mathbf{u}\_{\text{R}} \\ \mathbf{u}\_{\text{P}} \end{pmatrix} \}, \tag{3.84}$$

*where <sup>Z</sup>* (*x*) = <sup>−</sup>*<sup>Z</sup>* <sup>⊤</sup> (*x*) ∈ R *KN*<sup>E</sup> *for all <sup>x</sup>* <sup>∈</sup> <sup>X</sup> *with <sup>u</sup>*<sup>C</sup> <sup>=</sup> *<sup>e</sup>*C*, <sup>u</sup>*<sup>R</sup> = (*<sup>e</sup>* ⊤ R,1 *f* ⊤ R,2 ) ⊤*, u*<sup>P</sup> = (*f* ⊤ Sf *e* ⊤ Se) <sup>⊤</sup>*, <sup>y</sup>*<sup>C</sup> <sup>=</sup> <sup>−</sup>*<sup>f</sup>* <sup>C</sup>*, <sup>y</sup>*<sup>R</sup> = (−*<sup>f</sup>* ⊤ <sup>R</sup>,<sup>1</sup> *e* ⊤ R,2 ) <sup>⊤</sup>*, and y*<sup>P</sup> = (*e* ⊤ Sf *f* ⊤ Se) ⊤*. Suppose the resistive relations can be reorganized as <sup>u</sup>*<sup>R</sup> <sup>=</sup> <sup>−</sup>*R*˜ (*x*) *<sup>y</sup>*<sup>R</sup> *with <sup>R</sup>*˜ (*x*) = *R*˜ (*x*) <sup>⊤</sup> <sup>⪰</sup> <sup>0</sup> *(i.e., Assumption 3.30). The bond graph can then be formulated as an explicit PHS (cf. Definition 2.23)*

$$\mathbf{x} = \left(\mathbf{J}\left(\mathbf{x}\right) - \mathbf{R}\left(\mathbf{x}\right)\right) \frac{\partial H}{\partial \mathbf{x}}\left(\mathbf{x}\right) + \left(\mathbf{G}\left(\mathbf{x}\right) - \mathbf{P}\left(\mathbf{x}\right)\right)\boldsymbol{\mu},\tag{3.85a}$$

$$\mathbf{y} = \left(\mathbf{G}(\mathbf{x}) + \mathbf{P}(\mathbf{x})\right)^{\top} \frac{\partial H}{\partial \mathbf{x}}\left(\mathbf{x}\right) + \left(\mathbf{M}\left(\mathbf{x}\right) + \mathbf{S}\left(\mathbf{x}\right)\right)\mathbf{u},\tag{3.85b}$$

*that has Property 3.8. Assumption 3.27 and Assumption 3.30 together form a sufficient condition for formulating the bond graph as an explicit PHS* (3.85) *with Property 3.8. A necessary condition for the existence of such a model is given by* rank(*E*Sf(*x*) *<sup>F</sup>*Se (*x*)) = *<sup>K</sup>*(*N*Sf <sup>+</sup>*N*Se) *for all <sup>x</sup>* <sup>∈</sup> <sup>X</sup> *(i.e., Assumption 3.22).*

#### Proof:

Consider a *K*-dimensional bond graph as in Definition 3.5. First, consider the set of interior elements <sup>V</sup><sup>I</sup> with <sup>|</sup>VI<sup>|</sup> <sup>=</sup> *<sup>N</sup>*I. According to Lemma 3.12, the equations of the elements of V<sup>I</sup> can be described by a corresponding set of Dirac structures DS with <sup>|</sup>DS<sup>|</sup> <sup>=</sup> *<sup>N</sup>*I. From Lemma 3.17 it follows that the *<sup>N</sup>*<sup>I</sup> elements of DS can be composed into a single Dirac structure in implicit form (3.82). Now let Assumption 3.27 hold. Then, (3.82) can be formulated in an explicit representation (3.84). Consider the constitutive relations (3.65) of C-type elements. Let Assumption 3.30 hold for *u*R, *y*<sup>R</sup> as in (3.84), i.e., the constitutive relation of R-type elements can be written as (3.66). According to Lemma 3.31, the equations (3.62), (3.65), and (3.66) can then be written as PHS (3.85). From

Lemma 3.31, it follows that *u* = *u*<sup>P</sup> and *y* = *y*<sup>P</sup> which is why the explicit PHS has Property 3.8.

Next, we prove sufficiency and necessity for the respective assumptions. Sufficiency of assumptions 3.27 and 3.30 follows directly from the above considerations. Now for the necessity of Assumption 3.22. Property 3.8 implies Property 3.21. In Proposition 3.26 we show that Assumption 3.22 is necessary (and sufficient) for formulating the junction structure equations as explicit Dirac structure satisfying Property 3.21. In Lemma 3.31 it is shown, that the inputs and outputs of the explicit Dirac structure directly translate into the inputs and outputs of the explicit PHS. Thus, under Property 3.8, the necessity of Assumption 3.22 from Proposition 3.26 also accounts for the subsequent derivation of an explicit PHS. This concludes the proof.

Theorem 3.35 provides two conditions, one sufficient and one necessary, for the existence of an explicit port-Hamiltonian formulation of a bond graph. The sufficient condition is composed of two subconditions, viz. (i) that the system contains no dependent sources and no dependent storages (i.e., Assumption 3.27) and (ii) that the constitutive relations of energy-dissipating elements can be formulated in a suitable input-output representation (i.e., Assumption 3.30). The necessary existence condition requires the system to contain no dependent sources (i.e., Assumption 3.22).

The methods associated to Theorem 3.35 constitute an algorithm which can be used to generate an explicit PHS from a given bond graph. A pseudo code listing is given in Algorithm 3.36. The input of the algorithm is a formal bond graph as defined in Definition 3.5. The output is a complete specification of the resulting port-Hamiltonian model, viz. the matrices, Hamiltonian, state vector, input vector, and output vector of the PHS.

It is straightforward to implement Algorithm 3.36 in a computer algebra system. Based on such an implementation, one can compute an explicit PHS from a bond graph. This computation runs fully automatic, i.e., except for the specification of the bond graph, it requires no action from the user. Thus, provided the existence conditions from Theorem 3.35 are satisfied, we can automatically generate an explicit PHS from a bond graph.

A limitation of Algorithm 3.36 is that it cannot be applied to systems with dependent storages as such systems violate Assumption 3.27. Dependent storages occur for example in multi-phase power systems with *Y*-connected inductive loads and in mechanic system with rigidly coupled masses. Of course, we are also interested in an automated modeling of such systems. Hence, in the following

subsection, we relax Assumption 3.27 in order to enable a generation of PHSs from bond graphs possibly containing dependent storages.

**Algorithm 3.36** Port-Hamiltonian formulation of a bond graph **Input:** *K*-dimensional bond graph (3.12) 1: // Methods from Subsection 3.2.3 2: **for all** *<sup>i</sup>* <sup>∈</sup> <sup>V</sup><sup>I</sup> **do** 3: compute *Fi*(*x*), *Ei*(*x*) according to (3.20) 4: construct D*i*(*x*) as in (3.19) 5: **end for** 6: // Methods from Subsection 3.2.4 7: **for all** *<sup>i</sup>* <sup>∈</sup> <sup>V</sup><sup>I</sup> **do** 8: bring D*i*(*x*) to the form (3.23) 9: compute D IC according to (3.25) 10: compute Γ ⊤ *i* (*x*) according to (3.28) 11: **end for** 12: Γ <sup>⊤</sup> (*x*) ← (Γ ⊤ *i* (*x*)) for all *<sup>i</sup>* <sup>∈</sup> <sup>V</sup><sup>I</sup> 13: Λ <sup>⊤</sup> (*x*) ← ker(Γ ⊤ (*x*)) 14: write Λ <sup>⊤</sup> (*x*) as (Λ ⊤ *i* (*x*)) for all *<sup>i</sup>* <sup>∈</sup> <sup>V</sup><sup>I</sup> 15: compute D(*x*) according to (3.29) 16: bring D(*x*) to the form (3.27) 17: // Methods from Subsection 3.2.5 18: **if** Assumption 3.22 is violated **then** 19: **print** "Bond graph contains dependent sources. No PHS can be computed!" 20: **terminate** 21: **end if** 22: **if** Assumption 3.27 is violated **then** 23: **print** "Bond graph contains dependent storages or storages determined by sources. Algorithm terminates!" 24: **terminate** 25: **end if** 26: split *F* <sup>R</sup> (*x*) such that (3.39) is fulfilled 27: split *E*<sup>R</sup> (*x*), *f* <sup>R</sup>, *e*<sup>R</sup> in same parts as *F* <sup>R</sup> (*x*) 28: compute *Z* (*x*) according to (3.38) with *F* <sup>C</sup>,<sup>1</sup> (*x*) = *F* <sup>C</sup> (*x*), *E*C,<sup>1</sup> (*x*) = *E*<sup>C</sup> (*x*) 29: compute *<sup>u</sup>i*, *<sup>y</sup><sup>i</sup>* according to (3.63), *<sup>i</sup>* ∈ {C,P,R} 30: compute D(*x*) as in (3.62) 31: // Methods from Subsection 3.2.6 32: **if** Assumption 3.30 is violated **then** 33: **print** "No suitable input-output splitting of R-type elements exists. Algorithm terminates!" 34: **terminate** 35: **end if** 36: bring resistive relation to form (3.66) 37: compute PHS matrices with (3.67) 38: *x* ← (*xi*),∀*i* ∈ V<sup>C</sup> and *H* (*x*) ← *V* (*x*) 39: *u* ← *u*P, *y* ← *y*<sup>P</sup>

40: **return** explicit PHS (3.85)

#### 3.2.8 Systems with Dependent Storages

The aim of this subsection is to develop a method which derives an explicit PHS from bond graphs with dependent storages. The leading idea is to express variables according to dependent storages as functions of variables only according to independent storages. Based hereon, we formulate the port-Hamiltonian dynamics and output in terms of the system inputs and independent storages. Portions of this section have previously been published in Pfeifer et al. [2020b].

Consider a bond graph as from Definition 3.5. In the following, we distinguish between two types of storages elements, viz. independent storages C<sup>i</sup> and dependent storages Cd. <sup>14</sup> Correspondingly, let us decompose the set of storages V<sup>C</sup> into VC<sup>i</sup> and VC<sup>d</sup> . We then have *N*<sup>C</sup> = *N*C<sup>i</sup> + *N*C<sup>d</sup> , where *<sup>N</sup>*C<sup>i</sup> <sup>=</sup> <sup>|</sup>VC<sup>i</sup> | and *N*C<sup>d</sup> = |VC<sup>d</sup> <sup>|</sup>. Recall Lemma 3.23: provided there are no dependent sources, the junction structure of the bond graph can always be described as a Dirac structure in input-output representation (3.36). Using the composition <sup>V</sup><sup>C</sup> <sup>=</sup> <sup>V</sup>C<sup>i</sup> <sup>∪</sup> <sup>V</sup>C<sup>d</sup> , the Dirac structure (3.36) reads:

D = {( *f* C *f* R *f* Sf *f* Se , *e*<sup>C</sup> *e*<sup>R</sup> *e*Sf *e*Se ) ∈ R *KN*<sup>E</sup> <sup>×</sup><sup>R</sup> *KN*<sup>E</sup> <sup>|</sup> *y*Ci *y*C<sup>d</sup> *y*R *y*P = *Z*CiC<sup>i</sup> (*x*) −*Z*CiC<sup>d</sup> (*x*) −*Z*Ci<sup>R</sup> (*x*) −*Z*Ci<sup>P</sup> (*x*) *Z* ⊤ CiC<sup>d</sup> (*x*) *Z*CdC<sup>d</sup> (*x*) −*Z*Cd<sup>R</sup> (*x*) −*Z*Cd<sup>P</sup> (*x*) *Z* ⊤ CiR (*x*) *Z* ⊤ CdR (*x*) *Z*RR (*x*) −*Z*RP (*x*) *Z* ⊤ CiP (*x*) *Z* ⊤ CdP (*x*) *Z* ⊤ RP (*x*) *Z*PP (*x*) *u*C<sup>i</sup> *u*C<sup>d</sup> *u*<sup>R</sup> *u*P }, (3.86)

where

$$
\mathfrak{u}\_{\mathbb{C}\_{\mathrm{i}}} = \ \mathfrak{e}\_{\mathbb{C}\_{\mathrm{i}}}, \qquad \mathfrak{u}\_{\mathbb{C}\_{\mathrm{d}}} = -\mathfrak{f}\_{\mathbb{C}\_{\mathrm{d}}}, \tag{3.87a}
$$

$$\mathbf{y}\_{\mathbf{C}\_{\mathrm{i}}} = -\mathbf{f}\_{\mathrm{C}\_{\mathrm{i}}}, \qquad \mathbf{y}\_{\mathrm{C}\_{\mathrm{d}}} = \quad \mathbf{e}\_{\mathrm{C}\_{\mathrm{d}}},\tag{3.87b}$$

<sup>14</sup>The index i refers to *independent* and is not to be confused with the index I which stands for *interior*.

and the remaining vectors as in (3.37). It is well known that power variables of dependent storages are functions only of power variables of independent storages and inputs from sources [Wellstead, 1979, p. 199]. Thus, without loss of generality we may assume *Z*CdC<sup>d</sup> (*x*) = 0, *Z*Cd<sup>R</sup> (*x*) = 0 and write (3.86) as

D = {( *f* C *f* R *f* Sf *f* Se , *e*<sup>C</sup> *e*<sup>R</sup> *e*Sf *e*Se ) ∈ R *KN*<sup>E</sup> <sup>×</sup><sup>R</sup> *KN*<sup>E</sup> <sup>|</sup> *y*Ci *y*C<sup>d</sup> *y*R *y*P = *Z*CiC<sup>i</sup> (*x*) −*Z*CiC<sup>d</sup> (*x*) −*Z*Ci<sup>R</sup> (*x*) −*Z*Ci<sup>P</sup> (*x*) *Z* ⊤ CiC<sup>d</sup> (*x*) 0 0 <sup>−</sup>*Z*Cd<sup>P</sup> (*x*) *Z* ⊤ CiR (*x*) 0 *Z*RR (*x*) −*Z*RP (*x*) *Z* ⊤ CiP (*x*) *Z* ⊤ CdP (*x*) *Z* ⊤ RP (*x*) *Z*PP (*x*) *u*C<sup>i</sup> *u*C<sup>d</sup> *u*<sup>R</sup> *u*P }. (3.88)

As can be seen in (3.88), dependent storages can be (i) dependent on independent storages (i.e., *Z*CiC<sup>d</sup> (*x*) ̸<sup>=</sup> 0) and/or (ii) determined by sources (i.e., *<sup>Z</sup>*Cd<sup>P</sup> (*x*) ̸<sup>=</sup> 0). Wellstead [1979, p. 200] showed that case (ii) leads to mathematical models of the form *x*˙ = *f*(*x*,*u*,*u*˙,*t*). Due to the dependence on *u*˙, no explicit PHS of the form (2.12) can be obtained for such systems. Hence, we exclude case (ii) in the following considerations. Moreover, we assume *Z*CiC<sup>d</sup> (*x*) to be constant. The following assumption summarizes the preconditions on (3.88):

**Assumption 3.37 (Matrix blocks in** (3.88)**)** *In* (3.88)*, we have <sup>Z</sup>*Cd<sup>P</sup> (*x*) = <sup>0</sup> *for all <sup>x</sup>* <sup>∈</sup> <sup>X</sup> *and <sup>Z</sup>*CiC<sup>d</sup> (*x*) = *Z*CiC<sup>d</sup> = *const.*

Next, we elaborate the consequence of the decomposition <sup>V</sup><sup>C</sup> <sup>=</sup> <sup>V</sup>C<sup>i</sup> <sup>∪</sup>VC<sup>d</sup> to the constitutive relations of storages. With the inputs and outputs from (3.88), we can rewrite the constitutive relations (3.6) as

$$
\begin{pmatrix} \mathbf{f}\_{\mathbf{C}\_{\mathrm{i}}} \\ \mathbf{f}\_{\mathbf{C}\_{\mathrm{d}}} \end{pmatrix} \overset{\text{(3.87)}}{=} - \begin{pmatrix} \mathbf{y}\_{\mathbf{C}\_{\mathrm{i}}} \\ \mu\_{\mathbf{C}\_{\mathrm{d}}} \end{pmatrix} = \begin{pmatrix} \mathbf{x}\_{\mathrm{i}} \\ \dot{\mathbf{x}}\_{\mathrm{d}} \end{pmatrix},\tag{3.89a}
$$

$$
\begin{pmatrix} \mathbf{e}\_{\mathbf{C}\_{\mathrm{i}}} \\ \mathbf{e}\_{\mathbf{C}\_{\mathrm{d}}} \end{pmatrix} \stackrel{\text{(3.87)}}{=} \quad \begin{pmatrix} \mathbf{u}\_{\mathbf{C}\_{\mathrm{i}}} \\ \mathbf{y}\_{\mathbf{C}\_{\mathrm{d}}} \end{pmatrix} = \begin{pmatrix} \frac{\partial V\_{\mathrm{i}}}{\partial \mathbf{x}\_{\mathrm{i}}}(\mathbf{x}\_{\mathrm{i}}) \\ \frac{\partial V\_{\mathrm{d}}}{\partial \mathbf{x}\_{\mathrm{d}}}(\mathbf{x}\_{\mathrm{d}}) \end{pmatrix},\tag{3.89b}
$$

where *x*<sup>i</sup> ∈ R *KN*Ci , *<sup>x</sup>*<sup>d</sup> <sup>∈</sup> <sup>R</sup> *KN*Cd are the energy states and *V*<sup>i</sup> : R *KN*Ci <sup>→</sup> <sup>R</sup>, *V*<sup>d</sup> : R *KN*Cd <sup>→</sup> <sup>R</sup> are the storage functions of the independent and dependent storage elements, respectively. The overall energy in the system is then given by the composite storage function *V*(*x*i, *x*d) = *V*i(*x*i)+*V*d(*x*d). The storage functions *V*i(*x*i) and *V*d(*x*d) are bounded from below. Moreover, so far, they are allowed to be any differentiable linear or nonlinear function. In the latter case, however, it is (in general) impossible to solve (3.88) and (3.65) for an explicit expression which relates the states of the dependent storages as a function of the states of the independent storages. As a remedy, we restrict our attention to the special case of linear storages, i.e., the case of quadratic positive-definite storage functions.

\*\*Assumption 3.38\*\* (\*\*Quadratic storage functions)

The storage functions in (3.65) are of the form  $V\_{i}(\mathbf{x}\_{i}) = \frac{1}{2} \mathbf{x}\_{i}^{\top} \mathbf{Q}\_{i} \mathbf{x}\_{i}$  and  $V\_{\mathbf{d}}(\mathbf{x}\_{\mathbf{d}}) = \frac{1}{2} \mathbf{x}\_{\mathbf{d}}^{\top} \mathbf{Q}\_{i} \mathbf{x}\_{\mathbf{d}}$  and  $\mathbf{Q}\_{\mathbf{d}} = \mathbf{Q}\_{\mathbf{d}}^{\top} \succ 0$ .

Based on assumptions 3.37 and 3.38, we express the variables of dependent storages by means of variables of the independent storages in the following lemma. This is the key lemma of this subsection.

#### **Lemma 3.39 (Port-Hamiltonian formulation in case of dependent storages)**

*Given a Dirac structure in explicit representation* (3.88) *that fulfills Assumption 3.37. Moreover, suppose constitutive relations of storages* (3.65) *which satisfy Assumption 3.38. For the constitutive relations of resistors, let Assumption 3.30 hold, which enables us to write them as* (3.66)*. Then,* (3.88)*,* (3.65)*, and* (3.66) *can be written as explicit input-state-output PHS of the form* (2.12)*. The input, state, and output of the PHS are given as u* = *u*P*, x* = *x*<sup>i</sup> *, and y* = *y*<sup>P</sup> *, respectively. The Hamiltonian is H* (*x*) = *V*i(*x*i) = <sup>1</sup> 2 *x* ⊤ <sup>i</sup> *Q*i*x*<sup>i</sup>

*where Q*<sup>i</sup> = *Q* ⊤ <sup>i</sup> <sup>≻</sup> <sup>0</sup>*. The matrices of the PHS are calculated as <sup>J</sup>* (*x*) = <sup>1</sup> 2 *<sup>Z</sup>*Ci<sup>R</sup> (*x*)*R*˜ (*x*)*K*˜ <sup>⊤</sup> (*x*)*Z* ⊤ CiR (*x*)*L*˜ <sup>⊤</sup> − 1 2 *LZ*˜ <sup>C</sup>i<sup>R</sup> (*x*)*K*˜ (*x*)*R*˜ (*x*)*<sup>Z</sup>* ⊤ CiR (*x*) +*Z*CiC<sup>i</sup> (*x*)*L*˜ <sup>⊤</sup> <sup>+</sup>*LZ*˜ <sup>C</sup>iC<sup>i</sup> (*x*) , (3.90a) *<sup>R</sup>* (*x*) = <sup>1</sup> 2 *<sup>Z</sup>*Ci<sup>R</sup> (*x*)*R*˜ (*x*)*K*˜ <sup>⊤</sup> (*x*)*Z* ⊤ CiR (*x*)*L*˜ <sup>⊤</sup> + 1 2 *LZ*˜ <sup>C</sup>i<sup>R</sup> (*x*)*K*˜ (*x*)*R*˜ (*x*)*<sup>Z</sup>* ⊤ CiR (*x*)−*Z*CiC<sup>i</sup> (*x*)*L*˜ <sup>⊤</sup> <sup>+</sup>*LZ*˜ <sup>C</sup>iC<sup>i</sup> (*x*) , (3.90b) *<sup>G</sup>* (*x*) = <sup>1</sup> 2 *I* +*L*˜ *Z*Ci<sup>P</sup> (*x*) − 1 2 *<sup>Z</sup>*Ci<sup>R</sup> (*x*)*R*˜ (*x*)*K*˜ <sup>⊤</sup> (*x*)−*LZ*˜ <sup>C</sup>i<sup>R</sup> (*x*)*K*˜ (*x*)*R*˜ (*x*) *Z*RP (*x*), (3.90c) *<sup>P</sup>* (*x*) = <sup>1</sup> 2 *<sup>I</sup>* <sup>−</sup>*L*˜ *Z*Ci<sup>P</sup> (*x*) − 1 2 *<sup>Z</sup>*Ci<sup>R</sup> (*x*)*R*˜ (*x*)*K*˜ <sup>⊤</sup> (*x*) +*LZ*˜ <sup>C</sup>i<sup>R</sup> (*x*)*K*˜ (*x*)*R*˜ (*x*) *Z*RP (*x*), (3.90d) *<sup>M</sup>* (*x*) = <sup>1</sup> 2 *Z* ⊤ RP(*x*) *<sup>K</sup>*˜ (*x*)*R*˜ (*x*)−*R*˜ (*x*)*K*˜ <sup>⊤</sup> (*x*) *Z*RP (*x*) +*Z*PP (*x*), (3.90e) *<sup>S</sup>* (*x*) = <sup>1</sup> 2 *Z* ⊤ RP(*x*) *K*˜ (*x*)*R*˜ (*x*) +*R*˜ (*x*)*K*˜ <sup>⊤</sup> (*x*) *Z*RP (*x*), (3.90f) *where K*˜ (*x*) = *I* +*R*˜ (*x*)*Z*RR (*x*) −<sup>1</sup> *and L*˜ = *I* +*Z*CiCd*Q* −1 <sup>d</sup> *Z* ⊤ <sup>C</sup>iCd*Q*<sup>i</sup> −<sup>1</sup> *.*

*Remark* 3.40 (Existence of *K*˜ and *L*˜)*.* In Lemma 3.33, it has been shown that the matrix *<sup>K</sup>*˜ (*x*) always exists for all *<sup>x</sup>* <sup>∈</sup> <sup>X</sup>. The existence of the matrix *<sup>L</sup>*˜ will be discussed later in Lemma 3.44.

#### Proof:

The basic approach of the proof is similar as in the proof of Lemma 3.31, i.e., in the case without dependent storages. In the proof of Lemma 3.31, the first step was to eliminate variables that belong to resistive elements. In the proof at hand, however, we will eliminate both, variables that belong to resistive elements and variables that belong to dependent storages. In this context, a cornerstone is to derive an expression which relates the variables of interest without using variables that belong to dependent storages—which is step (i) of this proof. In step (ii), we decompose the equation system obtained from (i) into a symmetric and a skewsymmetric part and insert the constitutive relations of the independent storages from (3.65). In the third step (iii), we prove the definiteness condition (2.13). Compared to the proof of Lemma 3.31, step (iii) is more delicate as we have to consider the dependent storages in the power balance of the system. For the sake of releasing notational burden, we will suppress the argument *x* to the matrices during the proof.

(i) Let assumption 3.37 hold. Substituting the third line from the equation system of (3.88) into (3.66) gives

$$\begin{split} \boldsymbol{\mu\_{\rm R}} &= -\boldsymbol{\tilde{\mathcal{R}}} \left( \mathbf{Z}\_{\rm C\_{i}\rm R}^{\top} \boldsymbol{\mu\_{\rm C\_{i}}} + \mathbf{Z}\_{\rm RR} \boldsymbol{\mu\_{\rm R}} - \mathbf{Z}\_{\rm RP} \boldsymbol{\mu\_{\rm P}} \right) \\ \Leftrightarrow & \boldsymbol{\mu\_{\rm R}} = -\boldsymbol{\tilde{\mathcal{K}}} \, \boldsymbol{\tilde{\mathcal{R}}} \, \mathbf{Z}\_{\rm C\_{i}\rm R}^{\top} \boldsymbol{\mu\_{\rm C\_{i}}} + \boldsymbol{\tilde{\mathcal{K}}} \, \boldsymbol{\tilde{\mathcal{R}}} \, \mathbf{Z}\_{\rm RP} \boldsymbol{\mu\_{\rm P}}, \end{split} \tag{3.91}$$

with *K*˜ = *<sup>I</sup>* <sup>+</sup>*RZ*˜ RR−<sup>1</sup> . According to Lemma 3.33, *K*˜ always exists. Now we use an idea of Wellstead [1979, pp. 199-200] to eliminate the variables that belong to dependent storages. In addition to Assumption 3.37, let Assumption 3.38 hold. With (3.89b), the second line of the equation system of (3.88) reads:

$$\mathbf{y}\_{\mathbf{C\_d}} = \mathbf{Z}\_{\mathbf{C\_i C\_d}}^\top \mathbf{u}\_{\mathbf{C\_i}}$$

$$\Leftrightarrow \frac{\partial V\_{\mathbf{d}}}{\partial \mathbf{x\_d}} \left( \mathbf{x\_d} \right) = \mathbf{Z}\_{\mathbf{C\_i C\_d}}^\top \left( \frac{\partial V\_{\mathbf{i}}}{\partial \mathbf{x\_i}} \left( \mathbf{x\_i} \right) \right)$$

$$\Leftrightarrow \mathbf{Q\_d} \mathbf{x\_d} = \mathbf{Z}\_{\mathbf{C\_i C\_d}}^\top \mathbf{Q\_i} \mathbf{x\_i}$$

$$\Leftrightarrow \mathbf{x\_d} = \mathbf{Q\_d}^{-1} \mathbf{Z}\_{\mathbf{C\_i C\_d}}^\top \mathbf{Q\_i} \mathbf{x\_i}. \tag{3.92}$$

By differentiating (3.92) with respect to time and using (3.89a), we obtain

$$
\begin{split}
\dot{\mathbf{x}}\_{\mathrm{d}} &= \mathbf{Q}\_{\mathrm{d}}^{-1} \mathbf{Z}\_{\mathrm{C}\_{\mathrm{i}}\mathrm{C}\_{\mathrm{d}}}^{\top} \mathbf{Q}\_{\mathrm{i}} \dot{\mathbf{x}}\_{\mathrm{i}} \\
\Leftrightarrow & \mathbf{0} = -\boldsymbol{\mu}\_{\mathrm{C}\_{\mathrm{d}}} + \mathbf{Q}\_{\mathrm{d}}^{-1} \mathbf{Z}\_{\mathrm{C}\_{\mathrm{i}}\mathrm{C}\_{\mathrm{d}}}^{\top} \mathbf{Q}\_{\mathrm{i}} \mathbf{y}\_{\mathrm{C}\_{\mathrm{i}}}.\end{split}
\tag{3.93}
$$

Insertion of (3.91) into the first line of the equation system in (3.88) gives

$$\mathbf{y}\_{\text{C}\_{\text{i}}} = \left(\mathbf{Z}\_{\text{C}\_{\text{i}}\text{C}\_{\text{i}}} + \mathbf{Z}\_{\text{C}\_{\text{i}}\text{R}}\mathbf{K}\mathbf{R}\mathbf{Z}\_{\text{C}\_{\text{i}}\text{R}}^{\top}\right)\mathbf{u}\_{\text{C}\_{\text{i}}} - \mathbf{Z}\_{\text{C}\_{\text{i}}\text{C}\_{\text{d}}}\mathbf{u}\_{\text{C}\_{\text{d}}} + \left(-\mathbf{Z}\_{\text{C}\_{\text{i}}\text{P}} - \mathbf{Z}\_{\text{C}\_{\text{i}}\text{R}}\mathbf{K}\mathbf{R}\mathbf{Z}\_{\text{R}\text{P}}\right)\mathbf{u}\_{\text{P}}.\tag{3.94}$$

Equations (3.93) and (3.94) can be written in matrix-vector form:

$$
\begin{pmatrix}
\mathbf{I} & \mathbf{Z\_{C\_{l}C\_{d}}} \\
\mathbf{0} & \mathbf{I}
\end{pmatrix}
\begin{pmatrix}
\mathbf{y\_{C\_{i}}} \\
\mathbf{u\_{C\_{d}}}
\end{pmatrix} = \\
\begin{pmatrix}
\mathbf{Z\_{C\_{l}C\_{i}} + \mathbf{Z\_{C\_{l}R}}\tilde{\mathbf{K}}\tilde{\mathbf{R}}\mathbf{Z\_{C\_{l}R}^{\top}} & -\mathbf{Z\_{C\_{l}P} - \mathbf{Z\_{C\_{l}R}}\tilde{\mathbf{K}}\tilde{\mathbf{R}}\mathbf{Z\_{RP}} \\
\mathbf{0} & \mathbf{0}
\end{pmatrix}
\begin{pmatrix}
\mathbf{u\_{C\_{i}}} \\
\mathbf{u\_{P}}
\end{pmatrix}.
\end{pmatrix}.
\tag{3.95}
$$

Next, we use the inversion rules for <sup>2</sup> <sup>×</sup> <sup>2</sup> block matrices from Lu and Shiou [2002] to invert the matrix on the left-hand side of equation (3.95). The Schur complement of this matrix is given by:

$$\mathbf{L} \coloneqq \mathbf{I} + \mathbf{Z}\_{\mathrm{C}\_{\mathrm{i}}\mathrm{C}\_{\mathrm{d}}} \mathbf{Q}\_{\mathrm{d}}^{-1} \mathbf{Z}\_{\mathrm{C}\_{\mathrm{i}}\mathrm{C}\_{\mathrm{d}}} \mathbf{Q}\_{\mathrm{i}}.\tag{3.96}$$

The regularity of the matrix *L* will be discussed in Lemma 3.44. Provisionally, let us suppose that the inverse of *L* exists and is given by *L*˜ := *L* −1 . By applying the inversion rules from Lu and Shiou [2002], we can write (3.95) equivalently as

$$
\begin{pmatrix} \mathbf{y}\_{\text{C}\_{\text{i}}} \\ \mathbf{u}\_{\text{C}\_{\text{d}}} \end{pmatrix} = \begin{pmatrix} \mathbf{Z}\_{\text{l}} & \mathbf{Z}\_{\text{2}} \\ \mathbf{Z}\_{\text{3}} & \mathbf{Z}\_{\text{4}} \end{pmatrix} \begin{pmatrix} \mathbf{u}\_{\text{C}\_{\text{i}}} \\ \mathbf{u}\_{\text{P}} \end{pmatrix},\tag{3.97}
$$

with

$$\mathbf{Z}\_{\mathrm{l}} = \tilde{\mathbf{L}} \left( \mathbf{Z}\_{\mathrm{C}\_{\mathrm{l}} \mathrm{C}\_{\mathrm{l}}} + \mathbf{Z}\_{\mathrm{C}\_{\mathrm{l}} \mathrm{R}} \tilde{\mathbf{K}} \, \tilde{\mathbf{R}} \, \mathbf{Z}\_{\mathrm{C}\_{\mathrm{l}} \mathrm{R}}^{\top} \right), \tag{3.98a}$$

$$\mathbf{Z}\_2 = \mathbf{L}\left(-\mathbf{Z}\_{\mathrm{C}\mathrm{P}} - \mathbf{Z}\_{\mathrm{C}\mathrm{R}} \,\mathrm{K}\,\mathrm{R}\mathbf{Z}\_{\mathrm{RP}}\right),\tag{3.98b}$$

*Z*<sup>3</sup> = *Q* −1 <sup>d</sup> *Z* ⊤ <sup>C</sup>iC<sup>d</sup> *<sup>Q</sup>*<sup>i</sup> *<sup>L</sup>*˜ *<sup>Z</sup>*CiC<sup>i</sup> <sup>−</sup>*Z*Ci<sup>R</sup> *<sup>K</sup>*˜ *RZ*˜ <sup>⊤</sup> CiR , (3.98c)

$$\mathbf{Z}\_4 = \mathbf{Q}\_\mathrm{d}^{-1} \mathbf{Z}\_{\mathrm{C}\_\mathrm{i}\mathrm{C}\_\mathrm{d}}^\top \mathbf{Q}\_\mathrm{i} \tilde{\mathbf{L}} \left( -\mathbf{Z}\_{\mathrm{C}\_\mathrm{i}\mathrm{P}} - \mathbf{Z}\_{\mathrm{C}\_\mathrm{i}\mathrm{R}} \tilde{\mathbf{K}} \, \tilde{\mathbf{R}} \, \mathbf{Z}\_{\mathrm{RP}} \right). \tag{3.98d}$$

The first line of (3.97) will pave the way to the state differential equation (2.12a) of the PHS. To obtain an expression for the output equation (2.12b), we insert (3.91) into the fourth line of the equation system of (3.88) and obtain

$$\mathbf{y}\_{\text{P}} = \left(\mathbf{Z}\_{\text{C}\_{\text{l}}\text{P}}^{\top} - \mathbf{Z}\_{\text{RP}}^{\top}\tilde{\mathbf{K}}\tilde{\mathbf{R}}\mathbf{Z}\_{\text{C}\_{\text{l}}\text{R}}^{\top}\right)\boldsymbol{\upmu}\_{\text{C}\_{\text{l}}} + \left(\mathbf{Z}\_{\text{PP}} + \mathbf{Z}\_{\text{RP}}^{\top}\tilde{\mathbf{K}}\tilde{\mathbf{R}}\mathbf{Z}\_{\text{RP}}\right)\boldsymbol{\upmu}\_{\text{P}}.\tag{3.99}$$

The first line of the equation system in (3.97) and equation (3.99) can be written together in matrix-vector form as

$$
\begin{pmatrix} \mathbf{y}\_{\text{C}\_{i}} \\ \mathbf{y}\_{\text{P}} \end{pmatrix} = \begin{pmatrix} \tilde{\mathbf{L}} \left( \mathbf{Z}\_{\text{C}\_{i}\text{C}\_{i}} + \mathbf{Z}\_{\text{C}\_{i}\text{R}} \tilde{\mathbf{K}} \, \tilde{\mathbf{R}} \, \tilde{\mathbf{Z}}\_{\text{C}\_{i}\text{R}}^{\top} \right) & -\tilde{\mathbf{L}} \left( \mathbf{Z}\_{\text{C}\_{i}\text{P}} + \mathbf{Z}\_{\text{C}\_{i}\text{R}} \tilde{\mathbf{K}} \, \tilde{\mathbf{R}} \, \mathbf{Z}\_{\text{RP}} \right) \\\ \mathbf{Z}\_{\text{C}\_{i}\text{P}}^{\top} - \mathbf{Z}\_{\text{RP}}^{\top} \tilde{\mathbf{K}} \, \tilde{\mathbf{R}} \, \mathbf{Z}\_{\text{C}\_{i}\text{R}}^{\top} & \mathbf{Z}\_{\text{PP}} + \mathbf{Z}\_{\text{RP}}^{\top} \tilde{\mathbf{K}} \, \tilde{\mathbf{R}} \, \tilde{\mathbf{Z}}\_{\text{RP}} \end{pmatrix} \begin{pmatrix} \boldsymbol{\mu}\_{\text{C}\_{i}} \\ \boldsymbol{\mu}\_{\text{P}} \end{pmatrix}. \tag{3.100}$$

Note that (3.100) is independent of variables that belong to resistive elements and dependent storages.

(ii) The matrix in (3.100) can be decomposed into a skew-symmetric and a symmetric part. Using this decomposition, (3.100) can be equivalently written as

$$
\begin{pmatrix} \mathbf{y}\_{\mathbf{C}\_{i}} \\ \mathbf{y}\_{\mathbf{P}} \end{pmatrix} = \underbrace{\begin{bmatrix} \begin{pmatrix} -\mathbf{J} & -\mathbf{G} \\ \mathbf{G}^{\top} & \mathbf{M} \end{pmatrix} + \begin{pmatrix} \mathbf{R} & \mathbf{P} \\ \mathbf{P}^{\top} & \mathbf{S} \end{pmatrix} \end{pmatrix}}\_{=\mathbf{V}} \begin{pmatrix} \mu\_{\mathbf{C}\_{i}} \\ \mu\_{\mathbf{P}} \end{pmatrix} , \tag{3.101}
$$

with *<sup>J</sup>* , *<sup>R</sup>* , *<sup>G</sup>* , *<sup>P</sup>* , *<sup>M</sup>*, *<sup>S</sup>* as in (3.90) and <sup>Ψ</sup> <sup>=</sup> <sup>−</sup><sup>Ψ</sup> <sup>⊤</sup>, Θ = Θ <sup>⊤</sup>. By inserting the identities of the independent variables from (3.65) into (3.101), we finally obtain an explicit PHS (2.12) with *u* = *u*P, *x* = *x*<sup>i</sup> , *y* = *y*<sup>P</sup> and Hamiltonian *H* (*x*) = *V*i(*x*i).

(iii) In the last step, we show that the definiteness condition (2.13) holds. Let us merge (3.101) with the second line of the equation system in (3.88):

$$
\begin{pmatrix} \mathfrak{y}\_{\mathbb{C}\_{i}} \\ \mathfrak{y}\_{\mathbb{P}} \\ \mathfrak{y}\_{\mathbb{C}\_{d}} \end{pmatrix} = \underbrace{\begin{bmatrix} -\mathbf{J} & -\mathbf{G} & \mathbf{0} \\ \mathbf{G}^{\top} & \mathbf{M} & \mathbf{0} \\ \mathbf{0} & \mathbf{0} & \mathbf{0} \end{bmatrix}}\_{=:\boldsymbol{\Psi}} + \underbrace{\begin{pmatrix} \mathbf{R} & \mathbf{P} & \mathbf{0} \\ \mathbf{P}^{\top} & \mathbf{S} & \mathbf{0} \\ \mathbf{Z}\_{\mathbb{C}\_{i}\mathbb{C}\_{d}}^{\top} & \mathbf{0} & \mathbf{0} \end{pmatrix}}\_{=:\boldsymbol{\Theta}} \begin{pmatrix} \mathfrak{u}\_{\mathbb{C}\_{i}} \\ \mathfrak{u}\_{\mathbb{P}} \\ \mathfrak{u}\_{\mathbb{C}\_{d}} \end{pmatrix}. \tag{3.102}
$$

Note that Ψ˜ is skew-symmetric but Θ˜ is not symmetric. Nevertheless, <sup>Θ</sup>˜ <sup>⪰</sup> <sup>0</sup> implies <sup>Θ</sup> <sup>⪰</sup> 0. In the following, we show that <sup>Θ</sup>˜ <sup>⪰</sup> 0:

$$
\begin{pmatrix} \boldsymbol{\mu}\_{\text{C}\_{\text{i}}}^{\top} & \boldsymbol{\mu}\_{\text{P}}^{\top} & \boldsymbol{\mu}\_{\text{C}\_{\text{d}}}^{\top} \end{pmatrix} \tilde{\boldsymbol{\Theta}} \begin{pmatrix} \boldsymbol{\mu}\_{\text{C}\_{\text{i}}} \\ \boldsymbol{\mu}\_{\text{P}} \\ \boldsymbol{\mu}\_{\text{C}\_{\text{d}}} \end{pmatrix} = \quad \begin{pmatrix} \boldsymbol{\mu}\_{\text{C}\_{\text{i}}}^{\top} & \boldsymbol{\mu}\_{\text{P}}^{\top} & \boldsymbol{\mu}\_{\text{C}\_{\text{d}}}^{\top} \end{pmatrix} \left( \tilde{\boldsymbol{\Psi}} + \tilde{\boldsymbol{\Theta}} \right) \begin{pmatrix} \boldsymbol{\mu}\_{\text{C}\_{\text{i}}} \\ \boldsymbol{\mu}\_{\text{P}} \\ \boldsymbol{\mu}\_{\text{C}\_{\text{d}}} \end{pmatrix} \\
$$

$$
\stackrel{\{3.102\}}{=} \begin{pmatrix} \boldsymbol{\mu}\_{\text{C}\_{\text{i}}}^{\top} & \boldsymbol{\mu}\_{\text{P}}^{\top} & \boldsymbol{\mu}\_{\text{C}\_{\text{d}}}^{\top} \end{pmatrix} \begin{pmatrix} \mathbf{y}\_{\text{C}\_{\text{i}}} \\ \mathbf{y}\_{\text{P}} \\ \mathbf{y}\_{\text{C}\_{\text{d}}} \end{pmatrix} \\
$$

$$
\stackrel{\{2.9}}{=} \quad -\mathbf{y}\_{\text{R}}^{\top} \boldsymbol{\mu}\_{\text{R}} \stackrel{\{3.66\}}{=} \mathbf{y}\_{\text{R}}^{\top} \tilde{\mathbf{R}} \mathbf{y}\_{\text{R}} \ge 0. \tag{3.103}
$$

Hence, we have <sup>Θ</sup>˜ <sup>⪰</sup> 0, which implies <sup>Θ</sup> <sup>⪰</sup> 0. This concludes the proof.

*Remark* 3.41 (Dependent states as a function of independent states)*.* The following expression (i.e., (3.92)) relates the dependent states as functions of the independent states:

$$\mathbf{x}\_{\mathrm{d}} = \mathbf{Q}\_{\mathrm{d}}^{-1} \mathbf{Z}\_{\mathrm{C}\_{\mathrm{i}}\mathrm{C}\_{\mathrm{d}}}^{\top} \mathbf{Q}\_{\mathrm{i}} \mathbf{x}\_{\mathrm{i}}.\tag{3.104}$$

Equation (3.104) can be used, for example, to express the total energy in the system as a function only of *x*<sup>i</sup> :

$$\begin{array}{rcl} V(\mathbf{x}\_{i}, \mathbf{x}\_{d}) & = & V\_{\mathbf{i}}(\mathbf{x}\_{i}) + V\_{\mathbf{d}}(\mathbf{x}\_{d}) \\ & = & \frac{1}{2} \mathbf{x}\_{\mathrm{i}}^{\top} \mathbf{Q}\_{i} \mathbf{x}\_{\mathrm{i}} + \frac{1}{2} \mathbf{x}\_{\mathrm{d}}^{\top} \mathbf{Q}\_{\mathrm{d}} \mathbf{x}\_{\mathrm{d}} \\ \stackrel{\{3,104\}}{=} \frac{1}{2} \mathbf{x}\_{\mathrm{i}}^{\top} \mathbf{Q}\_{\mathrm{i}} \left( \mathbf{I} + \mathbf{Z}\_{\mathrm{C}\_{\mathrm{i}} \mathrm{C}\_{\mathrm{d}}} \mathbf{Q}\_{\mathrm{d}}^{-1} \mathbf{Z}\_{\mathrm{C}\_{\mathrm{i}} \mathrm{C}\_{\mathrm{d}}}^{\top} \mathbf{Q}\_{\mathrm{i}} \right) \mathbf{x}\_{\mathrm{i}} \\ \stackrel{\{3,96\}}{=} \frac{1}{2} \mathbf{x}\_{\mathrm{i}}^{\top} \mathbf{Q}\_{\mathrm{i}} \mathbf{L} \mathbf{x}\_{\mathrm{i}} = V(\mathbf{x}\_{\mathrm{i}}). \end{array} \tag{3.105}$$

*Remark* 3.42 (Dynamics of the dependent states)*.* By inserting (3.65) into the second line of (3.97), we yield an explicit expression for the dynamics

of the dependent states:

$$\begin{split} \dot{\mathbf{x}}\_{\mathrm{d}} &= \mathbf{Q}\_{\mathrm{d}}^{-1} \mathbf{Z}\_{\mathrm{C}\_{\mathrm{i}} \mathrm{C}\_{\mathrm{d}}} \mathbf{Q}\_{\mathrm{i}} \tilde{\mathbf{L}} \left( \mathbf{Z}\_{\mathrm{C}\_{\mathrm{i}} \mathrm{C}\_{\mathrm{i}}} - \mathbf{Z}\_{\mathrm{C}\_{\mathrm{i}} \mathrm{R}} \tilde{\mathbf{K}} \, \mathbf{R} \mathbf{Z}\_{\mathrm{C}\_{\mathrm{i}} \mathrm{R}}^{\top} \right) \mathbf{Q}\_{\mathrm{i}} \mathbf{x}\_{\mathrm{i}} \\ &- \mathbf{Q}\_{\mathrm{d}}^{-1} \mathbf{Z}\_{\mathrm{C}\_{\mathrm{i}} \mathrm{C}\_{\mathrm{d}}}^{\top} \mathbf{Q}\_{\mathrm{i}} \tilde{\mathbf{L}} \left( \mathbf{Z}\_{\mathrm{C}\_{\mathrm{i}} \mathrm{P}} + \mathbf{Z}\_{\mathrm{C}\_{\mathrm{i}} \mathrm{R}} \tilde{\mathbf{K}} \tilde{\mathbf{R}} \mathbf{Z}\_{\mathrm{R} \mathrm{P}} \right) \mathbf{u}\_{\mathrm{P}}. \end{split} \tag{3.106}$$

A central prerequisite for the proof of Lemma 3.39 is the existence of the matrix *L*˜ = *L* −1 , where *L* = *I* +*Z*CiCd*Q* −1 <sup>d</sup> *Z* ⊤ <sup>C</sup>iCd*Q*<sup>i</sup> with *Q*<sup>i</sup> , *Q*<sup>d</sup> symmetric, positive-definite and *Z*CiC<sup>d</sup> a matrix of proper size. In the sequel, we prove that this prerequisite is indeed fulfilled, i.e., that *L* is always regular. To this end, we will make use of the following mathematical concepts (see Deuflhard and Hohmann [1995, p. 273]):

**Definition 3.43 (Rayleigh quotient and numerical range)** *Given a quadratic matrix <sup>A</sup>* <sup>∈</sup> <sup>R</sup> *<sup>n</sup>*×*<sup>n</sup> and a non-zero vector <sup>x</sup>* <sup>∈</sup> <sup>R</sup> *n . The Rayleigh quotient* ρ(*A*, *x*) *is defined as*

$$\rho(\mathbf{A}, \mathbf{x}) := \frac{\mathbf{x}^{\top} \mathbf{A} \mathbf{x}}{\mathbf{x}^{\top} \mathbf{x}}. \tag{3.107}$$

*The set of all Rayleigh quotients over non-zero vectors*

$$W(\mathbf{A}) := \{ \rho(\mathbf{A}, \mathbf{x}) \, | \, \mathbf{x} \in \mathbb{R}^n \, | \, \{\mathbf{0}\} \}\tag{3.108}$$

*is called numerical range of A.*

We have Spec (*A*) <sup>⊆</sup> *<sup>W</sup>*(*A*) and for a symmetric matrix *<sup>A</sup>* we have *<sup>W</sup>*(*A*) = [λmin,λmax] by the min-max Theorem (also known as Courant-Fischer Theorem), where λmin and λmax are the smallest and the largest eigenvalues of *A* [Deuflhard and Hohmann, 1995, Lemma 8.29, p. 273].

The following lemma is the key step to show that *L*˜ always exists:

**Lemma 3.44 (Regularity of a matrix)**

*Let X* ∈ R *<sup>p</sup>*×*<sup>p</sup> be a symmetric positive-definite matrix and <sup>Y</sup>* <sup>∈</sup> <sup>R</sup> *<sup>p</sup>*×*<sup>p</sup> be any matrix whose numerical range W*(*Y* ) *is contained in* [0,∞)*, i.e., Y has only non-negative eigenvalues. Then the matrix I* +*Y X is regular.*

Proof:

Without loss of generality we may assume *X* to be diagonal.<sup>15</sup> The regularity of *I* +*Y X* will be proven by showing that *Y X* has only eigenvalues in [0,∞), i.e., that <sup>−</sup><sup>1</sup> is not an eigenvalue of *Y X*. Let <sup>√</sup> *X* be the diagonal matrix which is a square root of *<sup>X</sup>*, i.e., <sup>√</sup> *X* √ *X* = √ *X* √ *X* <sup>⊤</sup> = *X*. Such a matrix exists and is invertible since *X* is diagonal and positive-definite. Because the spectrum of a matrix is invariant under conjugation, we have

$$\begin{split} \operatorname{Spec} \left( \mathbf{Y} \mathbf{X} \right) &= \operatorname{Spec} \left( \sqrt{\mathbf{X}} \mathbf{Y} \mathbf{X} \sqrt{\mathbf{X}}^{-1} \right) \\ &= \operatorname{Spec} \left( \sqrt{\mathbf{X}} \mathbf{Y} \sqrt{\mathbf{X}} \right) = \operatorname{Spec} \left( \sqrt{\mathbf{X}} \mathbf{Y} \sqrt{\mathbf{X}}^{\top} \right) \\ &\subseteq W \left( \sqrt{\mathbf{X}} \mathbf{Y} \sqrt{\mathbf{X}}^{\top} \right) \subseteq W \left( \mathbf{Y} \right) \cdot \left( 0, \infty \right) \subseteq \left[ 0, \infty \right). \end{split} \tag{3.109}$$

In (3.109), the second to last inclusion holds since

$$\frac{\mathbf{x}^{\top}\sqrt{\mathbf{X}}\mathbf{Y}\sqrt{\mathbf{X}}^{\top}\mathbf{x}}{\mathbf{x}^{\top}\mathbf{x}} = \underbrace{\frac{\mathbf{x}^{\top}\sqrt{\mathbf{X}}\mathbf{Y}\sqrt{\mathbf{X}}^{\top}\mathbf{x}}{\mathbf{x}^{\top}\sqrt{\mathbf{X}}\sqrt{\mathbf{X}}^{\top}\mathbf{x}}}\_{\in W(\mathbf{Y})} \cdot \underbrace{\frac{\mathbf{x}^{\top}\sqrt{\mathbf{X}}\sqrt{\mathbf{X}}^{\top}\mathbf{x}}{\mathbf{x}^{\top}\mathbf{x}}}\_{\in W(\mathbf{X})}\tag{3.110}$$

and *<sup>W</sup>*(*X*) <sup>⊆</sup> (0,∞) by the min-max Theorem. Thus, <sup>−</sup><sup>1</sup> is not an eigenvalue of *Y X* and *I* +*Y X* is invertible.

<sup>15</sup>cf. the proof of Lemma 3.33 and note that for *<sup>T</sup>* <sup>∈</sup> <sup>O</sup>(*p*) we have *<sup>W</sup>*(*TY T* <sup>⊤</sup>) <sup>∈</sup> [0,∞).

#### **Corollary 3.45**

*The matrix L*˜ (*x*) *from Lemma 3.39 always exists.*

#### Proof:

Recall that *<sup>Q</sup>*<sup>d</sup> <sup>≻</sup> <sup>0</sup> and thus *<sup>Q</sup>* −1 <sup>d</sup> <sup>≻</sup> 0, which also implies *<sup>Q</sup>* −1 <sup>d</sup> <sup>⪰</sup> 0. Hence, *Z*CiCd*Q* −1 <sup>d</sup> *Z* ⊤ CiC<sup>d</sup> is positive semi-definite. The Rayleight quotient of a positive semi-definite matrix is always <sup>≥</sup> 0, i.e., *<sup>W</sup>*(*Z*CiCd*<sup>Q</sup>* −1 <sup>d</sup> *Z* ⊤ CiC<sup>d</sup> ) <sup>⊆</sup> [0,∞). As *<sup>Q</sup>*<sup>i</sup> is symmetric and positive-definite, the claim follows from Lemma 3.44.

*Remark* 3.46 (Alternative proof of Lemma 3.33)*.* By interchanging *Y* and *X*, the proof of Lemma 3.44 can be easily extended to also show regularity of *I* +*XY* . By this, we obtain an alternative proof of Lemma 3.33 for the existence of matrix *K*˜ (*x*) (cf. Remark 3.40).

Now we have everything prepared to collect the insights from the previous lemmas in a summarizing theorem about the existence of an explicit port-Hamiltonian formulation—similar to Theorem 3.35. In contrast to Theorem 3.35, however, the following theorem focuses on bond graphs that contain dependent storages.

#### **Theorem 3.47 (PHSs from Bond Graphs with Dependent Storages)**

*Given a K-dimensional bond graph as in Definition 3.5 with linear storages (i.e., Assumption 3.38). The junction structure of the bond graph can be described by a Dirac structure in implicit form* (3.82)*. Let*rank(*E*Sf(*x*) *F*Se (*x*)) = *<sup>K</sup>*(*N*Sf <sup>+</sup>*N*Se) *hold for all <sup>x</sup>* <sup>∈</sup> <sup>X</sup> *(i.e., Assumption 3.22). Then,* (3.82) *can be formulated in an explicit form*

D = {( *f* C *f* R *f* Sf *f* Se , *e*<sup>C</sup> *e*<sup>R</sup> *e*Sf *e*Se ) ∈ R *KN*<sup>E</sup> <sup>×</sup><sup>R</sup> *KN*<sup>E</sup> <sup>|</sup> *y*Ci *y*C<sup>d</sup> *y*R *y*P = *Z*CiC<sup>i</sup> (*x*) −*Z*CiC<sup>d</sup> (*x*) −*Z*Ci<sup>R</sup> (*x*) −*Z*Ci<sup>P</sup> (*x*) *Z* ⊤ CiC<sup>d</sup> (*x*) 0 0 <sup>−</sup>*Z*Cd<sup>P</sup> (*x*) *Z* ⊤ CiR (*x*) 0 *Z*RR (*x*) −*Z*RP (*x*) *Z* ⊤ CiP (*x*) *Z* ⊤ CdP (*x*) *Z* ⊤ RP (*x*) *Z*PP (*x*) | {z } *Z*(*x*) *u*C<sup>i</sup> *u*C<sup>d</sup> *u*<sup>R</sup> *u*P }, (3.111)

*where <sup>Z</sup>* (*x*) = <sup>−</sup>*<sup>Z</sup>* <sup>⊤</sup> (*x*) *for all <sup>x</sup>* <sup>∈</sup> <sup>X</sup> *and <sup>u</sup>*C<sup>i</sup> <sup>=</sup> *<sup>e</sup>*C<sup>i</sup> *, u*C<sup>d</sup> = −*f* <sup>C</sup><sup>d</sup> *, u*<sup>R</sup> = (*e* ⊤ R,1 − *f* ⊤ R,2 ) <sup>⊤</sup>*, u*<sup>P</sup> = (*f* ⊤ Sf *e*Se) <sup>⊤</sup>*, y*C<sup>i</sup> = −*f* <sup>C</sup><sup>i</sup> *, y*C<sup>d</sup> = *e*C<sup>d</sup> *, <sup>y</sup>*<sup>R</sup> = (−*<sup>f</sup>* ⊤ <sup>R</sup>,<sup>1</sup> *e* ⊤ R,2 ) <sup>⊤</sup>*, y*<sup>P</sup> = (*e* ⊤ Sf *f* ⊤ Se) <sup>⊤</sup>*. Suppose the resistive relations can be written as u*<sup>R</sup> = *R*˜ (*x*) *y*<sup>R</sup> *with R*˜ (*x*) = *R*˜ (*x*) <sup>⊤</sup> <sup>⪰</sup> <sup>0</sup> *(i.e., Assumption 3.30). Moreover, let <sup>Z</sup>*Cd<sup>P</sup> (*x*) = <sup>0</sup> *for all <sup>x</sup>* <sup>∈</sup> <sup>X</sup> *and <sup>Z</sup>*CiC<sup>d</sup> (*x*) = *<sup>Z</sup>*CiC<sup>d</sup> <sup>=</sup> *const. (i.e., Assumption 3.37). The bond graph can then be formulated as an explicit PHS as from Definition 2.23:*

$$\dot{\mathbf{x}} = \left( \mathbf{J}\left(\mathbf{x}\right) - \mathbf{R}\left(\mathbf{x}\right) \right) \frac{\partial H}{\partial \mathbf{x}}\left(\mathbf{x}\right) + \left( \mathbf{G}\left(\mathbf{x}\right) - \mathbf{P}\left(\mathbf{x}\right) \right) \mathbf{u},\tag{3.112a}$$

$$\mathbf{y} = \left(\mathbf{G}(\mathbf{x}) + \mathbf{P}(\mathbf{x})\right)^{\top} \frac{\partial H}{\partial \mathbf{x}}\left(\mathbf{x}\right) + \left(\mathbf{M}(\mathbf{x}) + \mathbf{S}(\mathbf{x})\right)\mathbf{u},\tag{3.112b}$$

*that has Property 3.8. The input, state, and output of the PHS are given as u* = *u*P*, x* = *x*<sup>i</sup> *, and y* = *y*<sup>P</sup> *, respectively, with the Hamiltonian H* (*x*) = *V*i(*x*i)*.*

#### Proof:

Consider a *K*-dimensional bond graph as in Definition 3.5 which fulfills Assumption 3.38. From Theorem 3.35 it is known that the junction structure of the bond graph can be described by a Dirac structure of the form (3.82). Let Assumption 3.22 hold. From Lemma 3.23 it follows that (3.82) can be written as (3.111) where the zero blocks are due to the fact that variables of dependent storages are functions only of power variables of independent storages and inputs from sources [Wellstead, 1979, p. 199]. Let assumptions 3.30 and 3.37 hold. It follows from Lemma 3.39 that the bond graph can then be formulated as an explicit PHS (3.112) with inputs, states, outputs, and Hamiltonian as stated. By *u* = *u*<sup>P</sup> and *y* = *y*<sup>P</sup> , the PHS has Property 3.8.

Theorem 3.47 provides a sufficient condition for the existence of an explicit port-Hamiltonian formulation of bond graphs with dependent storages. The condition is composed of four subconditions, viz. (i) that the system contains no dependent sources (i.e., Assumption 3.22); (ii) that the constitutive relation of energy-dissipating elements can be formulated in a suitable input-output representation (i.e., Assumption 3.30); (iii) that the variables from dependent storages are static functions of only variables from independent storages (i.e., Assumption 3.37); and (iv) that the storage elements are linear (i.e., Assumption 3.38). By these conditions, Theorem 3.47 generalizes Theorem 3.35 with respect to the occurence of dependent storages but is less general concerning the permitted storage functions.

Algorithm 3.48 collects the methods associated to Theorem 3.47 in a pseudo code listing to calculate an explicit PHS from a given bond graph. It is straightforward to implement the algorithm in a computer algebra system. Such an implementation enables the automated generation of an explicit PHS based on a bond graph system with dependent storages.

**Algorithm 3.48** Port-Hamiltonian formulation of a bond graph with dependent storages


To illustrate the automated model generation based on Algorithm 3.48, let us consider a new example.

#### **Example 3.49:**

*Consider the single-bond graph (K* = 1*) in Figure 3.4.*

R: *D* 0 TF: *U* 0 GY: *W*(*x*i, *x*d) Se C: *V*i(*x*i) C: *V*d(*x*d) *e*R *f*R *f*Ci *e*Ci *f*Cd *e*C<sup>d</sup> *e*Se *f*Se

**Figure 3.4:** Exemplary bond graph with dependent storages

*The* C*-type element with storage function V*i(*x*i) *is considered as independent storage element; the* C*-type element with storage function V*d(*x*d) *is a dependent storage element. The respective storage functions are given by V*i(*x*i) = *x* 2 <sup>i</sup> /(2*c*i) *and V*d(*x*d) = *x* 2 <sup>d</sup>/(2*c*d) *where <sup>c</sup>*i, *<sup>c</sup>*<sup>d</sup> <sup>&</sup>gt; <sup>0</sup>*. The constitutive relation of the* R*-type element is specified by f*<sup>R</sup> = *De*<sup>R</sup> *where D* > 0*. The*

*transformer* TF *has a constant transformation ratio U* > 0 *and the gyrator* GY *is state-modulated with an arbitrary gyration ratio W*(*x*i, *x*d) > 0 *for all x*i, *x*<sup>d</sup> ∈ R*.*

*By executing the first two lines of Algorithm 3.48, we obtain a Dirac structure of the form* (3.111)*:*

$$\mathbb{D} = \{ ( \begin{pmatrix} f\_{\mathbf{C}\_{i}} \\ f\_{\mathbf{C}\_{d}} \\ f\_{\mathbf{R}} \\ f\_{\mathbf{Se}} \end{pmatrix}, \begin{pmatrix} e\_{\mathbf{C}\_{i}} \\ e\_{\mathbf{C}\_{d}} \\ e\_{\mathbf{R}} \\ e\_{\mathbf{Se}} \end{pmatrix} \} \in \mathbb{R}^{4} \times \mathbb{R}^{4} \mid$$

$$\begin{pmatrix} -f\_{\mathbf{C}\_{i}} \\ e\_{\mathbf{C}\_{d}} \\ e\_{\mathbf{R}} \\ f\_{\mathbf{Se}} \end{pmatrix} = \begin{pmatrix} 0 & -U & -1 & -\frac{U}{W(\mathbf{x}\_{i},\mathbf{x}\_{d})} \\ U & 0 & 0 & 0 \\ 1 & 0 & 0 & 0 \\ \frac{U}{W(\mathbf{x}\_{i},\mathbf{x}\_{d})} & 0 & 0 & 0 \end{pmatrix} \begin{pmatrix} e\_{\mathbf{C}\_{i}} \\ -f\_{\mathbf{C}\_{d}} \\ -f\_{\mathbf{R}} \\ e\_{\mathbf{Se}} \end{pmatrix} \}. \tag{3.113}$$

*Assumptions 3.30 and 3.37 are satisfied for* (3.113)*. Hence, from Theorem 3.47 we know that the bond graph from Figure 3.4 permits an explicit port-Hamiltonian formulation of the form* (3.112)*. By executing the remainder of Algorithm 3.48, we obtain the following explicit PHS:*

$$\dot{\boldsymbol{\omega}} = -\underbrace{\left(\frac{D\boldsymbol{c\_i}}{\boldsymbol{c\_i} + U^2 \boldsymbol{c\_d}}\right)}\_{=\mathbf{R}(\boldsymbol{x}) = \mathbf{R}} \frac{\partial H}{\partial \boldsymbol{\chi}}(\boldsymbol{x}) + \underbrace{\left(\frac{U\boldsymbol{c\_i}}{\mathbf{W}(\boldsymbol{x})(\boldsymbol{c\_i} + U^2 \boldsymbol{c\_d})}\right)}\_{=\mathbf{G}(\boldsymbol{x}) - \mathbf{P}(\boldsymbol{x})} \boldsymbol{\mu},\tag{3.114a}$$

$$\mathbf{y} = \underbrace{\begin{pmatrix} \frac{U}{W(\mathbf{x})} \end{pmatrix}}\_{=\left(\mathbf{G}(\mathbf{x}) + \mathbf{P}(\mathbf{x})\right)^{\top}} \frac{\partial H}{\partial \mathbf{x}}(\mathbf{x}),\tag{3.114b}$$

*with u* = *e*Se*, x* = *x*<sup>i</sup> *, y* = *f*Se*, and H*(*x*) =*V*i(*x*i)*.* <sup>16</sup> *In this example, the expressions for J, M, and S are calculated as zero. Note that R* > 0*. Moreover, the inputs and outputs are such that the PHS has Property 3.8.*

Example 3.49 illustrates that one can obtain an explicit PHS also for systems with linear dependent storages. In the next section, we discuss the main results

<sup>16</sup>The function *W*(*x*) = *W*(*x*i) in (3.114) can be obtained from the gyration ratio *W*(*x*i, *x*d) by using the substitution rule for *x*<sup>d</sup> from (3.104) (cf. Remark 3.41).

presented in subsections 3.2.7 and 3.2.8 with respect to the overall objectives of this thesis and previous results from the related literature.

## 3.3 Discussion

Theorems 3.35 and 3.47 are the main theoretical results of this chapter. The two theorems are the first to give rigorous existence conditions for the complete transfer from a bond graph to an explicit PHS. In the literature, there exist some existence conditions for intermediate steps of this transfer. Golo et al. [2000] and Golo et al. [2003] show that the junction structure of a bond graph can always be related to a Dirac structure in implicit form which is in line with the findings from Theorem 3.35. Donaire and Junco [2009] provide sufficient conditions for the transfer from a Dirac structure in explicit form to a non-feedthrough PHS. Verbally formulated sufficient conditions for the existence of an explicit PHS have been given by van der Schaft [2009, p. 70] and van der Schaft and Jeltsema [2014, p. 53]. Theorems 3.35 and 3.47 put the conditions of Golo et al. [2000], Golo et al. [2003], Donaire and Junco [2009], van der Schaft [2009], and van der Schaft and Jeltsema [2014] into the perspective of an explicit port-Hamiltonian formulation of bond graphs.<sup>17</sup> Therewith, the conditions from the two theorems relate to, link, and generalize existing conditions and knowledge and streamline the present body of literature towards a fully automated model generation for interconnected systems.

From theorems 3.35 and 3.47 it follows that two important classes of bond graphs permit an explicit port-Hamiltonian formulation, viz. (i) bond graphs with nonlinear independent storages and (ii) bond graphs with linear dependent storages. Both cases, (i) and (ii), allow for nonlinearities in the interconnection structure arising from a state-modulation of energy-routing or energy-dissipating elements.

The independence of sources (i.e., Assumption 3.22) is shown to be a necessary condition for the existence of an explicit PHS. This condition is not strict as, in real physical systems, dependent sources are impossible to occur. It is noteworthy that Assumption 3.22 is also necessary for a bond graph to be well-posed in the sense of Golo et al. [2003, Def. 2].

Another condition from theorems 3.35 and 3.47 for the existence of a PHS is that the resistive relations can be rewritten in an input-output form (i.e., As-

<sup>17</sup>A more detailed discussion of theorems 3.35 and 3.47 in the light of previous work is out of the scope of this section but can be found in the literature notes provided in Appendix B.5.

sumption 3.30). This assumption is well-known from the literature (see, e.g., van der Schaft and Jeltsema [2014, p. 53] or van der Schaft [2009, p. 69] and is also mild. In Appendix B.3, it is shown that Assumption 3.30 is always fulfilled if the resistive elements are truly dissipative. This is satisfied by most multi-bond graphs and, in particular, for all single-bond graphs.

A limitation of theorems 3.35 and 3.47 is given for systems with nonlinear dependent storages. For such systems, however, there exist different strategies to eliminate dependent storages by adding or removing certain bond graph elements. The interested reader is referred to Borutzky [2010] and Karnopp et al. [2012].

As an interim conclusion, explicit PHSs are capable of describing a large class of bond graphs according to Definition 3.5. So it is left to discuss the capabilities and restrictions of Definition 3.5.

Definition 3.5 encompasses a comprehensive class of bond graphs as it allows for multi-port systems with nonlinearities in the energy-storing elements and state-modulations in the energy-routing and energy-dissipating elements. On the other hand, Definition 3.5 is limited to resistive relations that are linear in the power variables (i.e., Assumption 3.4). This represents the most relevant case of resistive relations (cf. van der Schaft and Jeltsema [2014, pp. 53–54] and Borutzky [2010, p. 364]), but excludes some phenomena that are of practical interest as, e.g., the dissipative relation describing the pressure drop in gas networks (cf. Strehle et al. [2018]) or the dissipative relation of nonlinear loads in AC power systems (cf. Strehle et al. [2020]). Hence, Appendix B.4 relaxes Assumption 3.4 which allows to consider bond graphs containing nonlinear resistive relations. Based hereon, Theorem 3.35 is generalized to systems with nonlinear dissipation. This leads to a novel class of explicit PHSs with nonlinear dissipation and feedthrough, which has, to the best of our knowledge, not been presented in the literature so far.<sup>18</sup> This generalization is straightforward which is why Assumption 3.4 is uncritical.<sup>19</sup>

Provided the existence conditions from theorems 3.35 and 3.47 are fulfilled, algorithms 3.36 and 3.48, respectively, enable the fully automated calculation of an explicit PHS from a given bond graph. The two algorithms are the first to

<sup>18</sup>For the case of no feedthrough, this class of PHSs particularizes to the class of PHSs with nonlinear resistive structure introduced by van der Schaft [2017, Def. 6.1.4].

<sup>19</sup>On the other hand, the PHS obtained in Section B.4 does not have the favorable symmetry and definiteness properties of (2.12) which is why we do not consider the PHS from Section B.4 any further.

enable such a fully automated calculation and the main practical result of this chapter.

A PHS obtained from algorithms 3.36 and 3.48 has Property 3.8 and thus correctly reflects the source elements of the underlying bond graph. The state vector of the PHS consists of the states of the independent energy storages. This is in line with the literature, where the order of an ODE model of a bond graph is known to be equal to the number of independent storages [Borutzky, 2010, p. 119]. The Hamiltonian of the PHS is the sum of the storage functions of the independent storages. Hence, the properties of the energy storages directly translate from the bond graph into the explicit PHS.

The calculation laws in algorithms 3.36 and 3.48 reveal state-modulated resistors, transformers, or gyrators to result in an explicit PHS with state-dependent matrices. On the other hand, if all bond graph elements of the types R, TF, and GY are non-modulated, the matrices of the explicit PHS are constant. If, in addition, the storages obey quadratic storage functions (i.e., Assumption 3.38 holds), the resulting PHS is linear. For the feedthrough-case, algorithms 3.36 and 3.48 reveal the parameters of R-type elements to possibly appear in each of the matrices of the PHS—and not only in the dissipation matrix *R* (*x*). This is in line with previous findings in the literature from Donaire and Junco [2009][p. 145, Remark] and van der Schaft and Jeltsema [2014, Example 4.1].

As can be seen, algorithms 3.36 and 3.48 ensure important properties of the system to translate into the explicit PHS. On the other hand, the results show that the physical interpretability of explicit models has natural limits. Introducing a causality from inputs over states to outputs leads to inter-subsystem dependencies that go beyond the physical interconnection structure. Therefore, the matrices of an explicit model usually do not have a subsystem-wise block structure.

A practical limitation of algorithms 3.36 and 3.48 is given for the development of fully symbolic models. The algorithms require matrix inversions, see (3.38), (3.67g), and (3.90). The inversion of large symbolic matrices, however, may lead to large expressions. Thereby, one cannot state an absolute limit for the allowed matrix sizes. The practical invertibility of a symbolic matrix strongly depends on the specific structure of the matrix. If the inversion of a symbolic matrix is intractable, one can still approach with local models.

The development of numeric models is free of such limitations. In the numeric case, the maximal size of the involved matrices is determined by the memory of the applied computer. Thereby, the sizes of the matrices grow with *O*(*K* 2 ) where *K* is the dimension of the bond graph. The practical limit, however, is given by the computation time for the matrix inversions. In the worst case, the

computation time for a matrix inverse grows polynomially with *O*(*s* 3 ) where *s* is the matrix order [Lyche, 2020, p. 65]. In both algorithms, the largest matrix to be inverted is given in (3.38). This matrix is of order *KN*. Hence, the upper bound for the computation time for algorithms 3.36 and 3.48 grows with *O*(*K* <sup>3</sup>*N* 3 ), i.e., cubically with the product of the dimension and the sum of elements in the bond graph. It is noteworthy, that in practice this worst case rarely occurs as the matrix in (3.38) is typically a sparse matrix.

In conclusion, for a large class of interconnected systems the methods from this chapter enable an efficient automated generation of explicit port-Hamiltonian models. The obtained models transparently reflect important properties of the underlying physical systems.

## 3.4 Summary and Contributions

Modeling an interconnected system as an explicit state-space system is a cumbersome task. The methods and algorithms from this chapter provide remedy as they enable an automated generation of explicit port-Hamiltonian models on the basis of a bond graph representation of the system. The main contributions of this chapter are:


The methods and algorithms from this chapter are the first to allow for an automated generation of physical-based explicit state-space models for a large class of interconnected systems. Therewith, these contributions meet the research objective O1 from Section 1.3. Successive examples verified the theoretical findings and illustrated the algorithmic nature of the automated model generation.

# Chapter 4

## Automated Observer Design

The previous chapter presented methods for an automated generation of port-Hamiltonian models for interconnected systems. The obtained models may serve as the starting point for numerical simulations as well as for the design of controllers and observers. This chapter focuses on the latter, i.e., the PHS-based design of observers. Thereby, we aim for an automatable observer design which exploits the port-Hamiltonian structure of the model.

First, the state of the art in observer design methods for PHSs is reviewed in Section 4.1. We will identify two research gaps hampering an automated observer design for a large class of PHSs. From the research gaps we deduce the objectives of the chapter. To reach these objectives, new PHS-based observers which allow for an automated design are derived in Section 4.2. Finally, in Section 4.3 and Section 4.4 we discuss the new developed methods in the light of the existing literature and summarize the contributions from this chapter, respectively.

## 4.1 Literature Review

The first notable work on the observer design for PHSs was conducted by Sira-Ramírez and Cruz-Hernández [2001]. The authors propose a passivity-based observer design for so-called *generalized Hamiltonian systems*, i.e., autonomous PHSs. Since then, several methods addressing the observer design for PHSs have been reported in the literature. These methods will be reviewed in the sequel. For the review, the approaches are classified into observer designs for linear PHSs and observer designs for nonlinear PHSs.

Linear PHSs are a special class of linear state-space systems. Hence, for the state reconstruction of such systems it is natural to approach with a standard Luenberger observer or Kalman filter, see, e.g., Khalil et al. [2012]. As argued

in Section 1.2, the design of such an observer can be automated by applying well-known methods. Cardoso Ribeiro [2016] show that the Luenberger observer is also a viable option if the linear model arises from the structure-preserving discretization of an infinite-dimensional PHS.<sup>1</sup> Kotyczka and Wang [2015] design a compensator for linear PHSs based on a dual observer. However, the dual observer does not provide an explicit reconstruction of the system state (cf. Luenberger [1971]). Atitallah et al. [2015] address the combined input and state reconstruction for linear PHSs. The authors propose two observers: the first observer determines a reconstruction of the state; the second observer reconstructs the unknown input. As argued in Section 2.2, besides the state and input, the output of a PHS is in general also not fully available for measurement. This leads to an input-state-output reconstruction problem as was first tackled in a preliminary work of this thesis authored by Pfeifer et al. [2019a]. The authors propose an interval input-state-output estimator for linear PHSs. The approach from Pfeifer et al. [2019a] can be automated but involves an observer existence condition that is rather restrictive.

In the above, we considered linear observer methods. For nonlinear PHSs, there exist also several observer methods. For the nonlinear observer methods, one can distinguish between two kinds of nonlinearities, viz. (a) nonlinearities in the interconnection structure and (b) nonlinearities in the storages. The former are characterized by state-dependent matrices of the PHSs; the latter are characterized by possibly non-quadratic Hamiltonians.

Wang et al. [2005] were the first to address the design of observers for nonlinear PHSs. The authors develop adaptive and non-adaptive state observers for systems with nonlinear interconnection structures and nonlinear storages. However, the observers are only asymptotic when the system reaches a steady state. Venkatraman and van der Schaft [2010] present a passivity-based, globally exponentially stable observer for PHSs with nonlinear interconnection structure and nonlinear storages. The proposed observer design is delicate as it requires the solution of a set of algebraic equations and partial differential equations (PDEs). A closed-form solution for such a system of equations exists only in special cases and is difficult to determine. Hence, the observer design from Venkatraman and van der Schaft [2010] cannot be automated. Vincent et al. [2016] present two nonlinear, passivity-based observers for PHSs with nonlinear interconnection structure: a proportional observer and a proportional observer with integral action. An interconnection and damping assignment (IDA) passivity-

<sup>1</sup>Kotyczka et al. [2019] follow an approach similar to Cardoso Ribeiro [2016].

based control (PBC)-like observer design for PHSs with nonlinear storages has been proposed by Yaghmaei and Yazdanpanah [2019b].<sup>2</sup> As with the approach from Venkatraman and van der Schaft [2010], the observer design of Yaghmaei and Yazdanpanah [2019b] requires the solution of a set of PDEs which hinders its automation.

Another two notable publications in this field stem from Biedermann et al. [2018] and Biedermann and Meurer [2021]: the former present a passivitybased observer design for a class of state-affine systems; the latter propose a dissipativity- and IDA-PBC-based observer design for nonlinear systems that can be decomposed into a time varying state affine part, a nonlinear feedback part, and a perturbation term. Thereby, the observer designs from Biedermann et al. [2018] and Biedermann and Meurer [2021] can be also applied to a class of PHSs with nonlinear interconnection structure and linear storages.

Table 4.1 provides an overview of the existing observers for linear and nonlinear PHSs. In the first column, the publications are listed in the order they are mention above. The second column of Table 4.1 differentiates between linear and nonlinear interconnection structures in the underlying port-Hamiltonian model. Similar, the third column distinguishes between linear and nonlinear storages. The fourth column shows the variables to be reconstructed by the respective observer.

From Table 4.1 it can be seen that the method from Pfeifer et al. [2019a] is the only approach which enables a reconstruction of inputs, states, and outputs. However, as mentioned above, this approach involves an existence condition which is rather strict. Hence, the method from Pfeifer et al. [2019a] is applicable to only a small class of linear PHSs.

The second and third columns in Table 4.1 show that the observers from Wang et al. [2005] and Venkatraman and van der Schaft [2010] are the only two approaches which are applicable to PHSs with nonlinearities in both, the interconnection structure and storages. However, the observer of Wang et al. [2005] is in general not asymptotic and the observer design from Venkatraman and van der Schaft [2010] cannot be automated.

To summarize, there exist powerful observer methods for linear and nonlinear PHSs in the literature However, there are two research gaps which hamper the automated design of observers for interconnected systems. First, the only existing

<sup>2</sup>The observer from Yaghmaei and Yazdanpanah [2019b] allows for a separation principle as known from linear systems theory, see Yaghmaei and Yazdanpanah [2019a].


**Table 4.1:** Classification of existing observers for PHSs with respect to the interconnection structure, storages, and reconstructed variables

observer for the reconstruction of inputs, states, and outputs of a linear PHS is the estimator from Pfeifer et al. [2019a]. Unfortunately, this approach is applicable to only a small class of systems. Second, as argued above, the available observer design schemes for PHSs with nonlinearities in both, the interconnection structure and storages, cannot be automated.

This chapter addresses these research gaps by developing automated observer design methods for linear and nonlinear PHSs. Specifically, the objectives of this chapter are


The objectives (i) and (ii) focus on the design of centralized observers based on global model knowledge. For interconnected systems, however, the design of distributed observers based on local model information is also of high interest (cf. Chapter 2). Hence, a secondary objective of this chapter is

(iii) to investigate how the methods from (i) and (ii) can be applied for an automated design of distributed observers based on local models.

## 4.2 Main Results

The previous section stated the aims of this chapter. To reach these aims we will now derive observers and corresponding design schemes for different classes of PHSs. First, in Subsection 4.2.1 we consider an automatable design scheme for an observer that reconstructs the inputs, states, and outputs of a linear PHS. Next, Subsection 4.2.2 outlines the design of a globally exponentially convergent stateoutput observer for a class of nonlinear PHSs. The methods from subsections 4.2.1 and 4.2.2 are presented in the light of an automated design of centralized observers based on global model knowledge. Subsection 4.2.3 shows that these methods can also be used for an automated design of distributed observers based on local model knowledge. To this end, we first reconsider the methods from Subsections 4.2.1 for the design of a distributed observer for linear interconnected systems with unknown subsystem interactions. Afterwards, we particularize the methods from Subsection 4.2.2 for the design of a distributed state observer for nonlinear interconnected systems with known subsystem interactions. Figure 4.1 depicts an overview of the observers from this section and illustrates their relations.

**Figure 4.1:** Overview of the observers developed in Section 4.2

#### 4.2.1 Automated Design of an Input-State-Output Observer for Linear PHSs

Consider an interconnected system with linear interconnection structure, linear dissipation, and linear storages. In Chapter 3, it was shown that a large class of such systems can be described by linear input-state-output port-Hamiltonian models. For such models, we have seen that the entries of the inputs *u* and outputs *y* are determined by physical constraints at the system boundary. The corresponding variables may or may not be available for measurement. Thus, the individual entries of *u* and *y* may or may not be known during runtime. This is in contrast to classical observer theory, where the complete system input and output are assumed to be known or measured (cf. Luenberger [1971]). As a remedy, let us introduce a measurement vector *m* which contains the variables that are available for measurement. The aim is then to determine an asymptotic observer which provides reconstructions of *u*, *x*, and *y* based on knowledge of *m*. Following the notion of a *state observer*, we denote such an observer as *inputstate-output observer*. In the following, we formalize the problem of designing such an input-state-output observer in an automated manner.

**Problem 4.1 (Automated input-state-output observer design)** *Given a linear explicit PHS*

$$
\dot{\mathbf{x}} = (\mathbf{J} - \mathbf{R}) \cdot \mathbf{Q} \mathbf{x} + (\mathbf{G} - \mathbf{P}) \mathbf{u}, \quad \mathbf{x}|\_{t=0} = \mathbf{x}\_0,\tag{4.1a}
$$

$$\mathbf{y} = (\mathbf{G} + \mathbf{P})^\top \mathbf{Q} \mathbf{x} + (\mathbf{M} + \mathbf{S})\boldsymbol{\mu},\tag{4.11b}$$

*with u*, *y* ∈ R *<sup>p</sup> and <sup>x</sup>* <sup>∈</sup> <sup>R</sup> *n . For the storage matrix <sup>Q</sup>* <sup>∈</sup> <sup>R</sup> *<sup>n</sup>*×*<sup>n</sup> we have Q* = *Q* <sup>⊤</sup> <sup>≻</sup> <sup>0</sup>*. The remaining matrices are constant matrices of appropriate sizes which satisfy the usual symmetry and definiteness properties of an explicit PHS (cf. Definition 2.23).*

*We assume that u, x, and y are (in general) non-measurable. Instead, let us consider measurements <sup>m</sup>* <sup>∈</sup> <sup>R</sup> *<sup>q</sup> of the form*

$$
\mathfrak{m} = \mathbf{C}\_{\mathfrak{u}} \mathfrak{u} + \mathbf{C}\_{\mathfrak{x}} \mathfrak{x} + \mathbf{C}\_{\mathfrak{Y}} \mathfrak{y}, \tag{4.2}
$$

*where Cu, Cx, and C<sup>y</sup> are constant matrices of proper sizes. The aim of this subsection is to give an answer to the following problem: How can we—in an automated manner—design an asymptotic observer that produces reconstructions of u, x, and y based on the model* (4.1) *and the measurements* (4.2)*?*

Problem 4.1 requires to develop an observer that is able to reconstruct the inputs, states, and outputs of the system (4.1). The leading idea is to rewrite the system step by step until we obtain a representation which allows to apply existing methods from linear observer theory.

We now consider the first step of this procedure. The input-state-output reconstruction from Problem 4.1 involves three equations, viz. a dynamics equation (4.1a), an output equation (4.1b), and a measurement equation (4.2). The following lemma shows that Problem 4.1 can be reduced to a reconstruction problem which involves only two equations:

#### **Lemma 4.2 (Output reconstruction based on** *u*ˆ **and** *x*ˆ**)**

*Consider the situation in Problem 4.1. Let u*ˆ *and x*ˆ *be reconstructions of u and <sup>x</sup>, respectively, with <sup>u</sup>*<sup>ˆ</sup> <sup>→</sup> *<sup>u</sup> and <sup>x</sup>*<sup>ˆ</sup> <sup>→</sup> *<sup>x</sup> for <sup>t</sup>* <sup>→</sup> <sup>∞</sup>*. Then, we can calculate an output reconstruction*

$$
\hat{\mathbf{y}} = \left(\mathbf{G} + \mathbf{P}\right)^{\top} \mathbf{Q} \hat{\mathbf{x}} + \left(\mathbf{M} + \mathbf{S}\right) \hat{\mathbf{u}},\tag{4.3}
$$

*with y*ˆ → *y for t* → ∞*.*

#### Proof:

Let *<sup>u</sup>*<sup>ˆ</sup> and *<sup>x</sup>*<sup>ˆ</sup> be reconstructions of *<sup>u</sup>* and *<sup>x</sup>* with *<sup>u</sup>*<sup>ˆ</sup> <sup>→</sup> *<sup>u</sup>* and *<sup>x</sup>*<sup>ˆ</sup> <sup>→</sup> *<sup>x</sup>* for *<sup>t</sup>* <sup>→</sup> <sup>∞</sup>, respectively. By substituting *u*, *x*, and *y* in (4.1b) with their respective reconstructions, we obtain (4.3). In particular, we have *<sup>y</sup>*<sup>ˆ</sup> <sup>→</sup> *<sup>y</sup>* for *<sup>t</sup>* <sup>→</sup> <sup>∞</sup>.

From Lemma 4.2 it follows that the input-state-output reconstruction problem can be reduced to an input-state reconstruction problem. To solve the input-state reconstruction problem, it is desirable to formulate the system only in terms of inputs and states, i.e., without outputs. In the next step, we again use the output equation (4.1b) to eliminate the outputs from the measurement equation (4.2).

#### **Lemma 4.3 (State-space system in standard form)**

*Equations* (4.1a) *and* (4.2) *can be written as a state-space system in standard form*

$$
\dot{\mathbf{x}} = \mathbf{A}\mathbf{x} + \mathbf{B}\boldsymbol{\mu}, \quad \left.\mathbf{x}\right|\_{\mathbf{r}=0} = \mathbf{x}\_0,\tag{4.48}
$$

$$
\mathbf{m} = \mathbf{C}\mathbf{x} + \mathbf{D}\mathbf{u},\tag{4.4b}
$$

*where <sup>A</sup>* = (*<sup>J</sup>* <sup>−</sup>*R*)*Q, <sup>B</sup>* = (*<sup>G</sup>* <sup>−</sup>*P*)*, <sup>C</sup>* <sup>=</sup> *<sup>C</sup><sup>x</sup>* <sup>+</sup>*C<sup>y</sup>* (*<sup>G</sup>* <sup>+</sup>*P*) <sup>⊤</sup> *Q, and D* = *C<sup>u</sup>* + *C<sup>y</sup>* (*M* +*S*)*.*

#### Proof:

From (4.1a), we directly obtain the calculation rules for the matrices *A* and *B*. Inserting (4.1b) into (4.2) yields the expressions for *C* and *D*.

Lemma 4.3 shows that a system with dynamics (4.1a) and measurements (4.2) can be formulated by means of a state-space system in standard form. Note that in (4.4) we have a clear differentiation in the description of the system's physics (i.e., (4.4a)) and the system's measurements (i.e., (4.4b)). Thereby, the input *u* of the system (4.4) is in general unknown. Instead, all measurements are specified by *m* in (4.4b). Nevertheless, *m* may contain measurements of an input, that is, a row of (4.4b) in which *D* contains exactly one "1" while the corresponding row of *C* contains exclusively zeros. For the upcoming considerations, it will be helpful (i) to split the input vector *u* into known inputs *u*<sup>k</sup> and unknown inputs *u*<sup>u</sup> and (ii) to split the vector *m* accordingly into the measured inputs *u*<sup>k</sup> and the remaining measurements *m*˜ . By doing so, the system (4.4) reads

$$\mathbf{x} = \mathbf{A}\mathbf{x} + \mathbf{B}\_{\mathbf{k}}\mathbf{u}\_{\mathbf{k}} + \mathbf{B}\_{\mathbf{u}}\mathbf{u}\_{\mathbf{u}}, \quad \left.\mathbf{x}\right|\_{\mathbf{r}=0} = \mathbf{x}\_{0},\tag{4.5a}$$

$$
\mathfrak{M} = \tilde{\mathbf{C}} \mathbf{x} + \mathbf{D}\_{\mathbf{k}} \boldsymbol{\mu}\_{\mathbf{k}} + \mathbf{D}\_{\mathbf{u}} \boldsymbol{\mu}\_{\mathbf{u}}, \tag{4.5b}
$$

where *u*<sup>k</sup> ∈ R *<sup>p</sup>*<sup>k</sup> , *<sup>u</sup>*<sup>u</sup> <sup>∈</sup> <sup>R</sup> *p*u , *x* ∈ R *n* , *m*˜ ∈ R *<sup>q</sup>*˜ with *<sup>p</sup>*<sup>k</sup> <sup>+</sup> *<sup>p</sup>*<sup>u</sup> <sup>=</sup> *<sup>p</sup>* and *<sup>q</sup>*˜ <sup>=</sup> *<sup>q</sup>*<sup>−</sup> *<sup>p</sup>*k. The matrices *<sup>C</sup>*˜ <sup>∈</sup> <sup>R</sup> *<sup>q</sup>*˜×*<sup>n</sup>* and *D*˜ <sup>k</sup> *D*˜ u ∈ R *<sup>q</sup>*˜×*<sup>p</sup>* can be obtained by removing those rows from the matrices *C* and *D*, respectively, that correspond to *u*<sup>k</sup> in *m*.

Equation (4.5) represents a linear system with known and unknown inputs. For such a system, it would be natural to apply an unknown-input observer. However, such an approach is significantly hampered by the fact that the measurement vector *m*˜ directly depends on the unknown inputs *u*u. Hence, it is desirable to find a formulation of (4.5) without a feedthrough of *u*u. The next step of our procedure presents such a formulation.

Without loss of generality we may assume that rank(*B*u) = *<sup>p</sup>*<sup>u</sup> (<sup>≤</sup> *<sup>n</sup>*) and rank(*C*˜) = *<sup>q</sup>*˜(<sup>≤</sup> *<sup>n</sup>*). If either the first or the second statement is violated, we introduce new inputs or outputs, respectively, for which these conditions are fulfilled [Singer, 2019, p. 19]. In order to eliminate the feedthrough from the system, we make the assumption that in the system (4.5) the number of measurements is greater than the number of unknown inputs:

#### **Assumption 4.4 (Number of measurements and unknown inputs)** *We have q*˜ > *pu.*

In most practical systems, Assumption 4.4 can be satisfied by providing a sufficient number of measurements. Based on Assumption 4.4, we can now eliminate the feedthrough from the system.

#### **Lemma 4.5 (Feedthrough elimination)**

*Consider the system with feedthrough* (4.5)*. Let Assumption 4.4 hold. Then, a formulation of* (4.5) *without feedthrough is given by*

$$\dot{\mathbf{x}} = \mathbf{A}\mathbf{x} + \mathbf{B}\_k \mathbf{u}\_k + \mathbf{B}\_\mathsf{U} \mathbf{u}\_\mathsf{U}, \quad \left. \mathbf{x} \right|\_{\mathfrak{t}=0} = \mathbf{x}\_0,\tag{4.68}$$

*m*¯ = *Cx*¯ . (4.6b)

*The reduced measurement output <sup>m</sup>*¯ <sup>∈</sup> <sup>R</sup> *q*˜−*r is given by m*¯ = *U* ⊤ 2 *<sup>m</sup>*˜ <sup>−</sup>*D*˜ *<sup>k</sup>u<sup>k</sup> where r* = rank(*D*˜ *<sup>u</sup>*)*. The matrix <sup>C</sup>*¯ <sup>∈</sup> <sup>R</sup> *<sup>q</sup>*˜−*r*×*<sup>n</sup> has full column rank and can be calculated as C*¯ = *U* ⊤ 2 *C*˜ *. The matrix U*<sup>2</sup> *is obtained from a singular value decomposition of Du, i.e.,*

$$\mathbf{D}\_{\mathsf{U}} = \begin{pmatrix} \mathbf{U}\_{1} & \mathbf{U}\_{2} \end{pmatrix} \boldsymbol{\Sigma} \mathbf{V}^{\top},\tag{4.7}$$

*with U*<sup>1</sup> ∈ R *q*˜×*r , U*<sup>2</sup> ∈ R *q*˜×*q*˜−*r ,* Σ ∈ R *q*˜×*p<sup>u</sup> , and <sup>V</sup>* <sup>∈</sup> <sup>R</sup> *pu*×*p<sup>u</sup> . The matrix* Σ *contains the singular values of D<sup>u</sup> on its diagonal.*

#### Proof:

We first show that the construction law of the vector *m*¯ indeed leads to an elimination of the feedthrough. Afterwards, we proof that the matrix *C*¯ has full column rank.

Let us first introduce a new measurement output without feedthrough of the known inputs:

$$\mathfrak{m}^\* := \tilde{\mathfrak{m}} - \tilde{\mathcal{D}}\_{\mathbf{k}} \mathfrak{u}\_{\mathbf{k}} = \tilde{\mathcal{C}} \mathfrak{x} + \tilde{\mathcal{D}}\_{\mathbf{u}} \mathfrak{u}\_{\mathbf{u}}.\tag{4.8}$$

Note that the vector *m* <sup>∗</sup> can be easily computed online during runtime.

Now we eliminate the unknown inputs by applying the idea from Irle [2016, p. 106]. Let Assumption 4.4 hold. Consider the singular value decomposition (4.7). For the case *<sup>q</sup>*˜ ̸<sup>=</sup> <sup>0</sup> and *<sup>p</sup>*<sup>u</sup> ̸<sup>=</sup> 0, Assumption 4.4 implies *<sup>U</sup>*<sup>2</sup> to exist. By multiplying *m* ∗ from the left with *U* ⊤ <sup>2</sup> and by the properties of orthogonal matrices we obtain

$$\underbrace{\mathbf{U}\_{2}^{\top}\mathbf{m}^{\*}}\_{=:\mathfrak{M}} = \underbrace{\mathbf{U}\_{2}^{\top}\tilde{\mathbf{C}}\mathbf{x}}\_{=:\mathbf{C}} + \underbrace{\left(\mathbf{0}\quad\mathbf{U}\_{2}^{\top}\mathbf{U}\_{2}\right)\begin{pmatrix}\text{diag}\left(\sigma\_{l}\right)&\mathbf{0}\\\mathbf{0}&\mathbf{0}\end{pmatrix}\mathbf{V}^{\top}\boldsymbol{\upmu}\_{\mathbf{u}}}\_{=\mathbf{0}},\tag{4.9}$$

where σ*<sup>i</sup>* are the singular values of *D*˜ <sup>u</sup> for *i* = 1,...,*r*. Now for the rank of *C*¯ . From the Sylvester rank inequality we obtain

$$\operatorname{rank}\left(\boldsymbol{\mathcal{U}}\_{2}^{\top}\boldsymbol{\tilde{\mathbf{C}}}\right) \ge \underbrace{\operatorname{rank}\left(\boldsymbol{\mathcal{U}}\_{2}^{\top}\right)}\_{\tilde{q}-r} + \underbrace{\operatorname{rank}\left(\boldsymbol{\tilde{\mathbf{C}}}\right)}\_{\tilde{q}} - \tilde{q} = \boldsymbol{\tilde{q}} - r. \tag{4.10}$$

On the other hand, we have

$$\text{rank}\left(\mathbf{U}\_2^\top \tilde{\mathbf{C}}\right) \le \min\{\text{rank}\left(\mathbf{U}\_2^\top\right), \text{rank}\left(\tilde{\mathbf{C}}\right)\} = \tilde{q} - r. \tag{4.111}$$

Combining (4.10) and (4.11) then yields rank *C*¯ = *q*˜−*r*.

*Remark* 4.6 (Case *D*˜ <sup>u</sup> = 0)*.* In (4.5), suppose *D*˜ <sup>u</sup> = 0, i.e., there is no feedthrough of the unknown-input to eliminate. This case obviates the singular value decomposition and therewith the need for Assumption 4.4.

The previous lemmas constitute a stepwise procedure to formulate a PHS (4.1) with measurements(4.2) as linear unknown-input system without feedthrough (4.6). In the literature, there exists a number of state observers for such an unknowninput system. The thesis of Singer [2019] provides a systematic comparison of these observers with respect to the automatability of their designs. An approach that is particularly easy to automate is the unknown-input observer design from Darouach et al. [1994]. The following assumption represents a necessary and sufficient condition for the existence of this observer (cf. Darouach et al. [1994, Theorem 1] and Singer [2019, Remark 3.2]):

#### **Assumption 4.7 (Strong**<sup>∗</sup> **detectability)** *The system* (4.6) *is strong*<sup>∗</sup> *detectable, i.e.,* lim *t*→∞ *m*¯ → 0 *implies* lim *t*→∞ *x* → 0*.*

For a brief introduction to the concept of strong<sup>∗</sup> detectability, the reader is referred to Appendix C.1. The existence condition from Assumption 4.7 now allows to state the main theorem of this subsection. In this theorem, the state observer from Darouach et al. [1994] is extended by an input and an output reconstruction.

#### **Theorem 4.8 (Input-state-output observer)**

*Consider a PHS* (4.1) *with measurements* (4.2)*. Let Assumption 4.4 hold which permits to formulate an unknown-input system* (4.6)*. For the system* (4.6)*, let Assumption 4.7 hold. Then, there exist matrices <sup>N</sup>* <sup>∈</sup> <sup>R</sup> *n*×*n , L* ∈ R *n*×(*q*˜−*r*) *, F* ∈ R *<sup>n</sup>*×*p<sup>k</sup> , and <sup>E</sup>* <sup>∈</sup> <sup>R</sup> *<sup>n</sup>*×(*q*˜−*r*) *such that the system*

$$
\dot{\mathbf{z}}\_{-} = \mathbf{N}\mathbf{z} + \mathbf{L}\ddot{\mathbf{n}} + \mathbf{F}\mathbf{u}\_{k}, \quad \mathbf{z}|\_{t=0} = \mathbf{z}\_{0}, \tag{4.12a}
$$

$$
\hat{\mathbf{x}}^{\;} = \mathbf{z} - E\bar{\mathbf{m}},\tag{4.12b}
$$

$$
\hat{\boldsymbol{\mu}}\_{\mathsf{U}} = \left(\bar{\mathsf{C}} \mathsf{B}\_{\mathsf{U}}\right)^{+} \left(\dot{\mathsf{m}} - \bar{\mathsf{C}} \mathsf{A} \dot{\mathsf{x}} - \bar{\mathsf{C}} \mathsf{B}\_{\mathsf{k}} \boldsymbol{\mu}\_{\mathsf{k}}\right), \tag{4.12c}
$$

$$\hat{\mathbf{y}}^{\top} = \left(\mathbf{G} + \mathbf{P}\right)^{\top} \mathbf{Q} \hat{\mathbf{x}} + \left(\mathbf{M} + \mathbf{S}\right) \left(\boldsymbol{\upmu}\_{\mathbb{K}}^{\top} \ \hat{\boldsymbol{\upmu}}\_{\mathbb{u}}^{\top}\right)^{\top},\tag{4.12d}$$

*is an asymptotic input-state-output observer for the PHS* (4.1) *based on measurements* (4.2)*. In* (4.12)*, the vector<sup>z</sup>* <sup>∈</sup> <sup>R</sup> *n is the observer state and the term CB*¯ *u* <sup>+</sup> *is the Moore-Penrose inverse of CB*¯ *u.*

#### Proof:

We first prove that (4.12a) and (4.12b) yield an asymptotic reconstruction of the system state—independently of the unknown inputs. To this end, we follow the

approach from Darouach et al. [1994]. Afterwards, we show that (4.12c) and (4.12d) yield an asymptotic reconstruction of the unknown inputs and outputs, respectively.

Let Assumption 4.7 hold. Consider the reconstruction error <sup>ε</sup> <sup>=</sup> *<sup>x</sup>*<sup>ˆ</sup> <sup>−</sup>*x*. With (4.6) and (4.12), the error dynamics read

$$\mathbf{e} = \mathbf{N}\mathbf{e} + \left(\mathbf{N}\mathbf{K} + \mathbf{L}\bar{\mathbf{C}} - \mathbf{K}\mathbf{A}\right)\mathbf{x} + \left(\mathbf{F} - \mathbf{K}\mathbf{B}\_{\mathbf{k}}\right)\mathbf{u}\_{\mathbf{k}} - \mathbf{K}\mathbf{B}\_{\mathbf{u}}\mathbf{u}\_{\mathbf{u}},\tag{4.1.3}$$

where *K* = *I* +*EC*¯ . Suppose we have

$$\mathbf{0} = \mathbf{N}\mathbf{K} + \mathbf{L}\bar{\mathbf{C}} - \mathbf{K}\mathbf{A},\tag{4.14a}$$

$$\mathbf{O} = \mathbf{F} - \mathbf{K}\mathbf{B}\_k,\tag{4.14b}$$

$$\mathbf{0} = \mathbf{K} \mathbf{B}\_{\mathbf{u}}.\tag{4.14c}$$

If the conditions in (4.14) hold, the error dynamics read ε˙ = *N*ε . If, in addition, *<sup>N</sup>* is a Hurwitz matrix, we have <sup>ε</sup> <sup>→</sup> 0 for *<sup>t</sup>* <sup>→</sup> <sup>∞</sup>.

Next, we show that we can always find matrices *N*, *L*, *F*, and *E* such that (4.14) is fulfilled and *N* is a Hurwitz matrix.

Assumption 4.7 implies rank *CB*¯ u = rank(*B*u) = *p*<sup>u</sup> [Hautus, 1983, Theorem 1.6]. Hence, from (4.14c) we obtain the following solution set for *E*:

$$\mathbf{E} = -\mathbf{B}\_{\mathbf{u}} \left( \bar{\mathbf{C}} \mathbf{B}\_{\mathbf{u}} \right)^{+} + \mathbf{Y} \left( \mathbf{I} - \left( \bar{\mathbf{C}} \mathbf{B}\_{\mathbf{u}} \right) \left( \bar{\mathbf{C}} \mathbf{B}\_{\mathbf{u}} \right)^{+} \right), \tag{4.15}$$

where

$$\left(\bar{\mathbf{C}}\mathbf{B}\_{\mathbf{u}}\right)^{+} = \left(\left(\bar{\mathbf{C}}\mathbf{B}\_{\mathbf{u}}\right)^{\top}\left(\bar{\mathbf{C}}\mathbf{B}\_{\mathbf{u}}\right)\right)^{-1}\left(\bar{\mathbf{C}}\mathbf{B}\_{\mathbf{u}}\right)^{\top}\tag{4.16}$$

and *Y* ∈ R *n*×*p*<sup>u</sup> is an arbitrary matrix [Rao and Mitra, 1972]. Based on a particular solution for *E* we can then calculate matrix *F* from (4.14b):

$$\mathbf{F} = \left(\mathbf{I} + \mathbf{E}\bar{\mathbf{C}}\right)\mathbf{B}\_{\text{k}}.\tag{4.17}$$

For the determination of the matrix *N* we write (4.14a) as

$$\mathbf{N} = \mathbf{K}\mathbf{A} - \mathbf{Z}\bar{\mathbf{C}},\tag{4.18}$$

where *Z* = (*L* +*NE*). From Darouach et al. [1994, Theorem 2] and Hautus [1983, Theorem 1.5] it follows that Assumption 4.7 implies the pair *KA*,*C*¯ to be detectable. Thus, there always exists a matrix *Z* such that *N* is Hurwitz. Substituting (4.18) into *Z* = (*L* +*NE*) yields the following expression for *L*:

$$\mathbf{L} = \mathbf{Z}\left(\mathbf{I} + \mathbf{\bar{C}}\mathbf{E}\right) - \mathbf{K}\mathbf{A}\mathbf{E},\tag{4.19}$$

which then satisfies (4.14a). Hence, we can always find matrices (*N*,*L*,*F*,*E*) such that the conditions in (4.14) are fulfilled and such that *N* is a Hurwitz matrix.

Now for the reconstruction of the unknown inputs. We apply the idea of Ding [2008, p. 143]. Deriving (4.6b) with respect to time gives

$$
\dot{\mathfrak{m}} = \bar{\mathbf{C}}\mathfrak{x} = \bar{\mathbf{C}}\mathbf{A}\mathfrak{x} + \bar{\mathbf{C}}\mathbf{B}\_{\mathbf{k}}\mathfrak{u}\_{\mathbf{k}} + \bar{\mathbf{C}}\mathbf{B}\_{\mathbf{u}}\mathfrak{u}\_{\mathbf{u}}.\tag{4.20}
$$

With *CB*¯ u <sup>+</sup> we may solve (4.20) for *<sup>u</sup>*u:

$$\boldsymbol{\mu}\_{\rm u} = \left(\bar{\mathbf{C}} \mathbf{B}\_{\rm u}\right)^{+} \left(\dot{\mathbf{m}} - \bar{\mathbf{C}} \mathbf{A} \mathbf{x} - \bar{\mathbf{C}} \mathbf{B}\_{\rm k} \boldsymbol{\mu}\_{\rm k}\right). \tag{4.21}$$

In (4.21), we substitute *u*<sup>u</sup> with *u*ˆ <sup>u</sup> and *x* with *x*ˆ and obtain (4.12c). By comparing (4.21) and (4.12c), we may deduce *<sup>u</sup>*<sup>ˆ</sup> <sup>u</sup> <sup>→</sup> *<sup>u</sup>*<sup>u</sup> from *<sup>x</sup>*<sup>ˆ</sup> <sup>→</sup> *<sup>x</sup>* for *<sup>t</sup>* <sup>→</sup> <sup>∞</sup>.

Finally, Lemma 4.2 proves (4.12d) to yield an output reconstruction *y*ˆ with *y*ˆ → *y* for *t* → ∞.

In order to automate the design of the observer from Theorem 4.8, a computationally evaluable formulation of Assumption 4.7 is required. The subsequent proposition provides such a formulation.

**Proposition 4.9 (Evaluation of Assumption 4.7)** *Assumption 4.7 is satisfied if and only if the following two conditions hold: i*. rank *CB*¯ *u* = rank(*Bu*) = *pu*, (4.22a) *ii*. rank *sI* −*A* −*B<sup>u</sup> C*¯ 0 = *n*+ *pu*, ∀*s* ∈ Spec (*A*) : *Re*(*s*) ≥ 0. (4.22b)

#### Proof:

The proof follows directly from Darouach et al. [1994, Theorem 2] and Hautus [1983, Theorem 1.5] by noting that, in condition *ii*., "∀*<sup>s</sup>* <sup>∈</sup> <sup>C</sup>" is equivalent to "∀*<sup>s</sup>* <sup>∈</sup> Spec (*A*)" (cf. Hautus [1969]).

Algorithm 4.10 now summarizes the above insights in an automatable design scheme which determines the free observer parameters of the input-state-output observer from Theorem 4.8, i.e., the matrices *N*,*L*,*F*, and *E*.

In line 20 of Algorithm 4.10, the choice of the eigenvalues of the matrix *N* determines the dynamics of the state reconstruction error (cf. (4.13)). Appendix C.2 provides a straightforward method for the automated placement of the eigenvalues of *N*. Based on the eigenvalues chosen for *N*, the determination of the matrix *Z* in code line 21 can be accomplished by the standard pole placement techniques presented in Section 1.2.

The block diagram in Figure 4.2 depicts the structure of the input-state-output observer. As can be seen, the observer consists of two stages, viz. a pre-processing of the measurements and the actual observer (4.12).

The input-state-output observer in Figure 4.2 yields asymptotic reconstructions *u*ˆ, *x*ˆ, and *y*ˆ of the inputs, states, and outputs of the PHS. Theorem 4.8 gives a sufficient condition for the existence of such an input-state-output observer; Algorithm 4.10 provides a corresponding design scheme which can be fully automated. Hence, these methods solve Problem 4.1.

**Algorithm 4.10** Automated design of an input-state-output observer

**Input:** PHS (4.1) with measurements (4.2)


u)


**Figure 4.2:** Block diagram of the system with the input-state-output observer

Example 4.11 illustrates the results from above.

#### **Example 4.11:**

*Consider the following linear PHS:*

$$
\begin{pmatrix} \dot{\mathbf{x}}\_1 \\ \dot{\mathbf{x}}\_2 \end{pmatrix} = \begin{pmatrix} 0 & -1 \\ 1 & -d \end{pmatrix} \frac{\partial H}{\partial \mathbf{x}} + \begin{pmatrix} 1 \\ d \end{pmatrix} u,\tag{4.23a}
$$

$$\mathbf{y} = \begin{pmatrix} 1 & -d \end{pmatrix} \ \frac{\partial H}{\partial \mathbf{x}} + du,\tag{4.23b}$$

*with d* > 0 *and Hamiltonian H*(*x*) = *x* <sup>⊤</sup>*x. In the system, u, x, and y are unknown. Instead, we consider q* = 2 *measurements*

$$\mathfrak{m} = \underbrace{\begin{pmatrix} -d\\0 \end{pmatrix} u}\_{=\mathbf{C}\_{\mathsf{u}}} + \underbrace{\begin{pmatrix} 0 & 2d\\0 & 2 \end{pmatrix} x}\_{=\mathbf{C}\_{\mathsf{x}}} \mathbf{x} + \underbrace{\begin{pmatrix} 1\\0 \end{pmatrix} y}\_{=\mathbf{C}\_{\mathsf{y}}} \tag{4.24}$$

*With the formulas from Lemma 4.3, we can write* (4.23a) *and* (4.24) *as the following state-space system:*

$$
\dot{\mathbf{x}} = \begin{pmatrix} 0 & -2 \\ 2 & -2d \end{pmatrix} \mathbf{x} + \begin{pmatrix} 1 \\ d \end{pmatrix} u,\tag{4.25a}
$$

$$\mathbf{m} = \begin{pmatrix} 2 & 0 \\ 0 & 2 \end{pmatrix} \mathbf{x},\tag{4.25b}$$

*where u is an unknown input. As can be seen, in* (4.25) *we have no feedthrough which is why Assumption 4.4 is irrelevant in this example (cf. Remark 4.6). Moreover, the conditions in* (4.22) *are satisfied. Hence, Assumption 4.7 is met and we can design an input-state-output observer. From* (4.15) *and* (4.17) *we obtain*

$$\mathbf{E} = -\frac{1}{2} \begin{pmatrix} d^{-1} & 0 \\ 1 & 0 \end{pmatrix} \tag{4.26}$$

*and F* ∈ R 2×0 *, respectively. The eigenvalues of the matrix N are placed at* <sup>λ</sup>*min* <sup>=</sup> <sup>−</sup><sup>1</sup> *and* <sup>λ</sup>*min* <sup>=</sup> <sup>−</sup><sup>2</sup> *where* <sup>λ</sup>*min* <sup>=</sup> min{*Re*(λ*i*)} *with* <sup>λ</sup>*<sup>i</sup> the eigenvalues of the matrix A from* (4.25) *(i* = 1,2*). Via pole placement, we obtain*

$$\mathbf{Z} = \frac{1}{2} \begin{pmatrix} 0 & \operatorname{Re}\left(\sqrt{d^2 - 4}\right) + d - \frac{2}{d} + 2\\ \operatorname{Re}\left(\sqrt{d^2 - 4}\right) + d + 1 & 0 \end{pmatrix} . \tag{4.27}$$

*Based on* (4.27)*, we may now calculate N and L with* (4.18) *and* (4.19) *as*

$$\mathcal{N} = \begin{pmatrix} -\mathsf{Re}\left(\sqrt{d^2 - 4}\right) - d - 2 & 0\\ 0 & -\mathsf{Re}\left(\sqrt{d^2 - 4}\right) - d - 1 \end{pmatrix} \tag{4.28a}$$

*and*

$$\mathbf{L} = \begin{pmatrix} -\frac{\operatorname{Re}\left(\sqrt{d^2 - 4}\right) + d + 2}{2d} & \frac{1}{2}\left(\operatorname{Re}\left(\sqrt{d^2 - 4}\right) + d - \frac{2}{d} + 2\right) \\ 0 & 0 \end{pmatrix}, \quad \text{(4.28b)}$$

*respectively. This concludes the observer design.*

*The obtained input-state-output observer are illustrated by means of the results obtained from numerical simulations. The parameter d is chosen to d* = 1*. The initial values of the system and the observer are x*<sup>0</sup> = (0 0) ⊤ *and z*ˆ<sup>0</sup> = (1 1) ⊤ (= *x*ˆ0)*, respectively. The unknown input is a unit sawtooth signal with an angular frequency of* 1 s−1 *.*

*Figure 4.3 depicts the inputs, states, and outputs of the system* (4.23) *(solid, blue) together with the corresponding reconstructions from the inputstate-output observer (dashed, red).*

⊤

⊤

⊤

, (4.28b)

, (4.28b)

, (4.28b)

(= *x*ˆ0)*, respec-*

(= *x*ˆ0)*, respec-*

(= *x*ˆ0)*, respec-*

*.*

*.*

*.*

88 Chapter 4. Automated Observer Design

88 Chapter 4. Automated Observer Design

88 Chapter 4. Automated Observer Design

1 2 *Re*<sup>√</sup> *d* <sup>2</sup> −4 +*d* − 2 *<sup>d</sup>* +2 

1 2 *Re*<sup>√</sup> *d* <sup>2</sup> −4 +*d* − 2 *<sup>d</sup>* +2 

1 2 *Re*<sup>√</sup> *d* <sup>2</sup> −4 +*d* − 2 *<sup>d</sup>* +2 

0 0 !

0 0 !

0 0 !

⊤

⊤

⊤

*and z*ˆ<sup>0</sup> = (1 1)

*and z*ˆ<sup>0</sup> = (1 1)

*and z*ˆ<sup>0</sup> = (1 1)

*The obtained input-state-output observer are illustrated by means of the results obtained from numerical simulations. The parameter d is chosen to d* = 1*. The initial*

*Figure 4.3 depicts the inputs, states, and outputs of the system* (4.23) *(solid, blue) together with the corresponding reconstructions from the input-state-output observer*

*The obtained input-state-output observer are illustrated by means of the results obtained from numerical simulations. The parameter d is chosen to d* = 1*. The initial*

*The obtained input-state-output observer are illustrated by means of the resultsobtained from numerical simulations. The parameter <sup>d</sup> is chosen to <sup>d</sup>* <sup>=</sup> <sup>1</sup>*. The initial*

*Figure 4.3 depicts the inputs, states, and outputs of the system* (4.23) *(solid, blue) together with the corresponding reconstructions from the input-state-output observer*

*Figure 4.3 depicts the inputs, states, and outputs of the system* (4.23) *(solid, blue) together with the corresponding reconstructions from the input-state-output observer*

*tively. The unknown input is a unit sawtooth signal with an angular frequency of* 1 s−1

*tively. The unknown input is a unit sawtooth signal with an angular frequency of* 1 s−1

*tively. The unknown input is a unit sawtooth signal with an angular frequency of* 1 s−1

**Figure 4.3:** Inputs, states, and outputs of the PHS (4.23) (solid, blue) and corresponding observer reconstructions (dashed, red) *As can be seen, after three seconds the reconstructions of the input and states lie on* **Figure 4.3:** Inputs, states, and outputs of the PHS (4.23) (solid, blue) and corresponding observer reconstructions (dashed, red)

*top of the true system variables. Moreover, we obtain an output reconstruction which is identical to the true output. Unfortunately, this identity is coincidence and cannot be regarded as a general property of the observer.* The previous example illustrates the algorithmic design of a symbolic input-state-output observer for a PHS (4.1). The obtained observer yields asymptotic reconstructions of the *As can be seen, after three seconds the reconstructions of the input and states lie on top of the true system variables. Moreover, we obtain an output reconstruction which is identical to the true output. Unfortunately, this identity is coincidence and cannot be regarded as a general property of the observer.*

unknown system variables which confirms the theoretical results from this subsection. The previous example illustrates the algorithmic design of a symbolic inputstate-output observer for a PHS (4.1). The obtained observer yields asymptotic

Consider an interconnected system with nonlinearities in the interconnection structure and storages. The former kind of nonlinearity appears, for example, in the transformations between different reference frames in electric and mechanic systems as, e.g., the *dq*-transformation or generalized coordinate transformations, respectively (cf. Karnopp [1969]); the latter kind is present, for instance, in systems involving the potential energy of a

(cf. van der Schaft [2009, p. 66]) or systems exhibiting effects from relativistic mechanics (cf. Wellstead [1979, p. 27]). Systems with nonlinear interconnection structure and nonlinear storages lead to explicit port-Hamiltonian models with state-dependent matrices and possibly non-quadratic Hamiltonians (cf. Section 3.3). For many of such PHSs, the state and output of the system are unknown and have to be reconstructed. However, in contrast to Subsection 4.2.1, we now consider the situation where at least the input of the system is known. Besides the system input, we are given measurements that may be nonlinear in the <sup>3</sup>Recall that the potential energy *V*(*x*) of a mass *m* is given by *V*(*x*) = *mgx*, where *g* is the gravitional constant. This storage function is non-quadratic in the state and the corresponding storage element

4.2.2 Automated Observer Design for a Class of

Nonlinear PHSs

The present subsection was devoted to the development of an observer for linear PHSs. In the next subsection, we turn our attention to the automated observer design for nonlinear

PHSs.

mass<sup>3</sup>

therewith nonlinear.

*u*

*(dashed, red).*

*(dashed, red).*

1

0

1

*and*

*and*

*and*

*L* = − *Re*( √ *d* <sup>2</sup>−4)+*d*+<sup>2</sup> 2*d*

*L* = − *Re*( √ *d* <sup>2</sup>−4)+*d*+<sup>2</sup> 2*d*

*L* = − *Re*( √ *d* <sup>2</sup>−4)+*d*+<sup>2</sup> 2*d*

*respectively. This concludes the observer design.*

*respectively. This concludes the observer design.*

*respectively. This concludes the observer design.*

*values of the system and the observer are x*<sup>0</sup> = (0 0)

*values of the system and the observer are x*<sup>0</sup> = (0 0)

*values of the system and the observer are x*<sup>0</sup> = (0 0)

reconstructions of the unknown system variables which confirms the theoretical results from this subsection.

The present subsection was devoted to the development of an observer for linear PHSs. In the next subsection, we turn our attention to the automated observer design for nonlinear PHSs.

#### 4.2.2 Automated Observer Design for a Class of Nonlinear PHSs

Consider an interconnected system with nonlinearities in the interconnection structure and storages. The former kind of nonlinearity appears, for example, in the transformations between different reference frames in electric and mechanic systems as, e.g., the *dq*-transformation or generalized coordinate transformations, respectively (cf. Karnopp [1969]); the latter kind is present, for instance, in systems involving the potential energy of a mass<sup>3</sup> (cf. van der Schaft [2009, p. 66]) or systems exhibiting effects from relativistic mechanics (cf. Wellstead [1979, p. 27]). Systems with nonlinear interconnection structure and nonlinear storages lead to explicit port-Hamiltonian models with state-dependent matrices and possibly non-quadratic Hamiltonians (cf. Section 3.3). For many of such PHSs, the state and output of the system are unknown and have to be reconstructed. However, in contrast to Subsection 4.2.1, we now consider the situation where at least the input of the system is known. Besides the system input, we are given measurements that may be nonlinear in the states. The aim of this section is then to find an automatable design scheme for an asymptotic observer which reconstructs the states and outputs of the system. This is formalized in the following problem:

<sup>3</sup>Recall that the potential energy *V*(*x*) of a mass *m* is given by *V*(*x*) = *mgx*, where *g* is the gravitional constant. This storage function is non-quadratic in the state and the corresponding storage element therewith nonlinear.

**Problem 4.12 (Automated observer design for nonlinear PHSs)** *Consider an explicit PHS of the form*

$$\frac{d}{dt}\begin{pmatrix} \mathbf{x}'\\ \mathbf{x}' \end{pmatrix} = \left(\mathbf{J}(\mathbf{x}') - \mathbf{R}(\mathbf{x}')\right)\frac{\partial H}{\partial \mathbf{x}}\left(\mathbf{x}\right) + \mathbf{G}(\mathbf{x}')\mathbf{u}, \quad \mathbf{x}|\_{t=0} = \mathbf{x}\_0,\tag{4.29a}$$

$$\mathbf{y} = \mathbf{G}^{\top}(\mathbf{x}') \frac{\partial H}{\partial \mathbf{x}}(\mathbf{x}) \,, \tag{4.29b}$$

*with x* ′ ∈ X ′ ⊂ R *<sup>n</sup>*<sup>1</sup> *, x* ′′ ∈ X ′′ ⊂ R *<sup>n</sup>*−*n*<sup>1</sup> *, <sup>u</sup>* <sup>∈</sup> <sup>U</sup> <sup>⊂</sup> <sup>R</sup> *p , and <sup>y</sup>* <sup>∈</sup> <sup>Y</sup> <sup>⊂</sup> <sup>R</sup> *p , where* X ′ *and* X ′′ *are closed and bounded and therewith compact. The overall state vector is defined as x* := (*x* ′⊤ *x* ′′⊤) <sup>⊤</sup> ∈ X = X ′×X ′′*, where* X *is then also compact. The matrices in* (4.29) *are of proper sizes, continuously differentiable in x* ′ *, and have the usual symmetry and definiteness properties from Definition 2.23. Let the Hamiltonian of* (4.29) *be of the form*

$$H(\mathbf{x}) = \frac{1}{2} \begin{pmatrix} \mathbf{x'}^\top & \mathbf{x''}^\top \end{pmatrix} \begin{pmatrix} \mathbf{Q'} & \mathbf{0} \\ \mathbf{0} & \mathbf{Q''} \end{pmatrix} \begin{pmatrix} \mathbf{x'} \\ \mathbf{x''} \end{pmatrix} + \mathcal{N}(\mathbf{x'}),\tag{4.30}$$

*where Q* := blkdiag *Q* ′ ,*Q* ′′ = *Q* <sup>⊤</sup> ≻ 0 *and N* : X ′ → R*, x* ′ 7→ *N*(*x* ′ )*. The function N may be any function that is positive semi-definite and twice continuously differentiable in x* ′ *.*

*Suppose u is known but x and y are unknown. Moreover, assume measurements m* ∈ R *<sup>q</sup> with <sup>q</sup>* <sup>≥</sup> *<sup>n</sup>*<sup>1</sup> *of the form <sup>m</sup>* <sup>=</sup>*C*(*<sup>x</sup>* ′ )*Qx whereC*(*x* ′ )*is continuous in x* ′ *:*

$$
\begin{pmatrix} \mathfrak{m}\_1 \\ \mathfrak{m}\_2 \end{pmatrix} = \begin{pmatrix} \mathfrak{Q}'^{-1} & \mathbf{0} \\ \mathbf{C}'(\mathbf{x}') & \mathbf{C}''(\mathbf{x}') \end{pmatrix} \begin{pmatrix} \mathbf{Q}' & \mathbf{0} \\ \mathbf{0} & \mathbf{Q}'' \end{pmatrix} \begin{pmatrix} \mathbf{x}' \\ \mathbf{x}' \end{pmatrix}. \tag{4.31}
$$

*Note that we have m*<sup>1</sup> = *x* ′ *, i.e., x* ′ *is the measured part of the state vector x.*

*What is an asymptotic observer for* (4.29) *that produces reconstructions of x and y based on knowledge on m? How can we design such an observer in an automated manner?*

*Remark* 4.13 (Class of systems)*.* At first glance, the class of systems addressed in Problem 4.12 may seem rather restrictive. However, as Venkatraman and van der Schaft [2010] point out, this class covers a considerable number of physical examples such as mechanical and electromechanical PHSs, see, e.g., Yaghmaei and Yazdanpanah [2019b, Eq. (23) and (27)]. Moreover, note that the measurement equation can also be written as

$$
\begin{pmatrix} \mathbf{m}\_1 \\ \mathbf{m}\_2 \end{pmatrix} = \begin{pmatrix} I & \mathbf{0} \\ \tilde{\mathbf{C}}'(\mathbf{x}') & \tilde{\mathbf{C}}''(\mathbf{x}') \end{pmatrix} \begin{pmatrix} \mathbf{x}' \\ \mathbf{x}' \end{pmatrix} . \tag{4.32}
$$

In (4.32), we have *m*<sup>1</sup> = *x* ′ , *m*<sup>2</sup> = *C*˜(*x* ′ )*x* which reveals the generality of this formulation.

*Remark* 4.14 (System feedthrough)*.* In Problem 4.12, we consider a PHS without feedthrough. This is in contrast to Problem 4.1 from Subsection 4.2.1. However, due to the known inputs there is no loss of generality in neglecting the feedthrough (cf. Ludyk [1995, p. 7]). Throughout this section the omission of the feedthrough will allow for a compact notation.

Problem 4.12 contains a state-output reconstruction problem which involves three equations, viz. a dynamics equation (4.29a), an output equation (4.29b), and a measurement equation (4.31). Note that the measurement equation may be nonlinear in the states. Similar to Lemma 4.2, the following lemma shows that the state-output reconstruction problem from Problem 4.12 can be easily reduced to a state reconstruction problem which involves only two equations. Thereby, we consider an exponential convergence of the reconstructions.

#### **Lemma 4.15 (Output reconstruction based on** *x*ˆ**)**

*Consider the situation in Problem 4.12. Let x*ˆ *be a reconstruction of x with* <sup>∥</sup>*<sup>x</sup>* <sup>−</sup> *<sup>x</sup>*ˆ∥ ≤ *<sup>k</sup>*1*<sup>e</sup>* −*k*2*t for <sup>t</sup>* <sup>≥</sup> <sup>0</sup> *and some positive constants <sup>k</sup>*1, *<sup>k</sup>*<sup>2</sup> <sup>∈</sup> <sup>R</sup>><sup>0</sup>*. Then, we can calculate an output reconstruction*

$$
\hat{\mathbf{y}} = \mathbf{G}^{\top}(\hat{\mathbf{x}}') \frac{\partial H}{\partial \mathbf{x}}(\hat{\mathbf{x}}),\tag{4.33}
$$

*with* <sup>∥</sup>*<sup>y</sup>* <sup>−</sup>*y*ˆ∥ ≤ *<sup>k</sup>*3*<sup>e</sup>* −*k*2*t for all <sup>t</sup>* <sup>≥</sup> <sup>0</sup> *and some positive constant <sup>k</sup>*<sup>3</sup> <sup>∈</sup> <sup>R</sup>>0*.*

<sup>4</sup>To bring (4.32) to the form (4.31), we write *m* = *C*˜(*x* ′ )*Q* <sup>−</sup>1*Qx* = *C*(*x* ′ )*Qx* with *C*(*x* ′ ) = *C*˜(*x* ′ )*Q* −1 .

#### Proof:

Because X ′ and X are compact, *G* <sup>⊤</sup> and <sup>∂</sup>*<sup>H</sup>* ∂ *x* are bounded in *x* ′ and *x*, respectively, i.e., there exist constants *<sup>k</sup>G*, *<sup>k</sup><sup>H</sup>* <sup>∈</sup> <sup>R</sup>><sup>0</sup> such that <sup>∥</sup>*<sup>G</sup>* ⊤(*x* ′ )∥ < *k<sup>G</sup>* and ∥ ∂*H* ∂ *x* (*x*)<sup>∥</sup> <sup>&</sup>lt; *<sup>k</sup><sup>H</sup>* for all *<sup>x</sup>* ′ ∈ X ′ and *<sup>x</sup>* <sup>∈</sup> <sup>X</sup>. Moreover, since *<sup>G</sup>* <sup>⊤</sup> is continuously differentiable and X ′ is compact, *G* <sup>⊤</sup> is Lipschitz continuous on X ′ with constant *L<sup>G</sup>* = sup*<sup>x</sup>* ′∈X′ ∥ ∂*G* ∂ *x* ′(*x* ′ )<sup>∥</sup> that is <sup>∥</sup>*<sup>G</sup>* ⊤(*x* ′ 1 )−*G* ⊤(*x* ′ 2 )∥ ≤ *<sup>L</sup>G*∥*<sup>x</sup>* ′ <sup>1</sup> −*x* ′ <sup>2</sup><sup>∥</sup> for all *x* ′ 1 , *x* ′ <sup>2</sup> ∈ X ′ . Likewise <sup>∂</sup>*<sup>H</sup>* ∂ *x* is Lipschitz continuous with a constant *L<sup>H</sup>* on X.

We now can conclude

$$\begin{split} \|\mathbf{y} - \mathbf{\hat{y}}\| &= \|\mathbf{G}^{\top}(\mathbf{x}')\frac{\partial H}{\partial \mathbf{x}}(\mathbf{x}) - \mathbf{G}^{\top}(\hat{\mathbf{x}}')\frac{\partial H}{\partial \mathbf{x}}(\hat{\mathbf{x}})\| \\ &\leq \|\mathbf{G}^{\top}(\mathbf{x}')\frac{\partial H}{\partial \mathbf{x}}(\mathbf{x}) - \mathbf{G}^{\top}(\mathbf{x}')\frac{\partial H}{\partial \mathbf{x}}(\hat{\mathbf{x}})\| + \|\mathbf{G}^{\top}(\mathbf{x}')\frac{\partial H}{\partial \mathbf{x}}(\hat{\mathbf{x}}) - \mathbf{G}^{\top}(\hat{\mathbf{x}}')\frac{\partial H}{\partial \mathbf{x}}(\hat{\mathbf{x}})\| \\ &\leq \|\mathbf{G}^{\top}(\mathbf{x}')\| \|\|\frac{\partial H}{\partial \mathbf{x}}(\mathbf{x}) - \frac{\partial H}{\partial \mathbf{x}}(\hat{\mathbf{x}})\| + \|\mathbf{G}^{\top}(\mathbf{x}') - \mathbf{G}^{\top}(\hat{\mathbf{x}}')\| \|\frac{\partial H}{\partial \mathbf{x}}(\hat{\mathbf{x}})\| \\ &\leq k\_{G}L\_{H}\|\mathbf{x} - \hat{\mathbf{x}}\| + L\_{G}\|\mathbf{x}' - \hat{\mathbf{x}}'\|\_{H} \\ &\leq (k\_{G}L\_{H} + L\_{G}k\_{H})k\_{1}e^{-k\_{1}^{\*}}, \end{split} \tag{4.34}$$

where in the last step we used <sup>∥</sup>*<sup>x</sup>* ′ −*x*ˆ ′∥ ≤ ∥*<sup>x</sup>* <sup>−</sup>*x*ˆ<sup>∥</sup> and <sup>∥</sup>*<sup>x</sup>* <sup>−</sup>*x*ˆ∥ ≤ *<sup>k</sup>*1*<sup>e</sup>* −*k*2*t* .

Lemma 4.15 shows that an exponentially convergent reconstruction of the output can always be obtained from an exponentially convergent reconstruction of the state. Hence, Problem 4.12 can be formulated as an ordinary state reconstruction problem that involves two equations, viz. (4.29a) and (4.31). This motivates to approach with a Luenberger-like observer consisting of an internal model of the system dynamics and a measurement error injection term. This is the approach we follow in the subsequent lemma.

#### **Lemma 4.16 (Asymptotic state observer)**

*Consider a system with dynamics* (4.29a) *and measurements* (4.31)*. Suppose there exists a matrix <sup>L</sup>* <sup>∈</sup> <sup>R</sup> *<sup>n</sup>*×*<sup>q</sup> depending continuously on x* ′ *such that*

$$\mathbf{R}(\mathbf{x}') + \frac{1}{2}\mathbf{L}(\mathbf{x}')\mathbf{C}(\mathbf{x}') + \frac{1}{2}\mathbf{C}^\top(\mathbf{x}')\mathbf{L}^\top(\mathbf{x}') \succ 0,\tag{4.35}$$

*for all x* ′ ∈ X ′ *. Then, there exists a globally exponentially convergent state observer of the form*

$$\dot{\hat{\mathbf{x}}} = \left( \mathbf{J}(\mathbf{x}') - \mathbf{R}(\mathbf{x}') \right) \frac{\partial H}{\partial \mathbf{x}}(\hat{\mathbf{x}}) + \mathbf{G}(\mathbf{x}')\mathbf{u} + \mathbf{L}(\mathbf{x}') \left( \mathbf{m} - \mathbf{C}(\mathbf{x}') \mathbf{Q} \hat{\mathbf{x}} \right), \tag{4.34}$$

*with initial value <sup>x</sup>*ˆ<sup>|</sup> *<sup>t</sup>*=<sup>0</sup> <sup>=</sup> *<sup>x</sup>*ˆ0*. The vectors <sup>x</sup>*<sup>ˆ</sup> ′ ∈ X ′ *and x*ˆ ′′ ∈ X ′′ *of the splitting x*ˆ = *x*ˆ ′⊤ *x*ˆ ′′⊤ <sup>⊤</sup> *are mimicking the splitting of x* = (*x* ′⊤ *x* ′′⊤) ⊤*.*

#### Proof:

Let us define the reconstruction error as <sup>ε</sup> :<sup>=</sup> *<sup>x</sup>* <sup>−</sup>*x*ˆ. With (4.29a), (4.30), (4.31), and (4.36), the error dynamics can be expressed as

$$
\dot{\mathbf{c}} = \left( \mathbf{J}(\mathbf{x'}) - \mathbf{R}(\mathbf{x'}) - \mathbf{L}(\mathbf{x'}) \mathbf{C}(\mathbf{x'}) \right) \mathbf{Q} \mathbf{c}, \tag{4.37}
$$

with initial value <sup>ε</sup> <sup>0</sup> <sup>=</sup> *<sup>x</sup>*<sup>0</sup> <sup>−</sup> *<sup>x</sup>*ˆ0. Obviously, <sup>ε</sup> <sup>≡</sup> <sup>0</sup> is an equilibrium of (4.37). Next, we analyze the stability of this equilibrium by using Lyapunov's direct method. Consider the Lyapunov candidate

$$V(\mathfrak{e}) = \frac{1}{2} \mathfrak{e}^{\top} \mathfrak{Q} \mathfrak{e}.\tag{4.38}$$

As shown in Proposition C.4 from Appendix C.3, for a system and a Lyapunov candidate of the form (4.37) and (4.38), respectively, we obtain

$$\dot{V}(\mathbf{e}) = -\mathbf{e}^{\top} \underbrace{\mathcal{Q}\,\mathbf{R}(\mathbf{x}') + \frac{1}{2}\mathbf{L}(\mathbf{x}')\mathbf{C}(\mathbf{x}') + \frac{1}{2}\mathbf{C}^{\top}(\mathbf{x}')\mathbf{L}^{\top}(\mathbf{x}')}\_{=:\Gamma} \mathbf{Q}\,\mathbf{e}.\tag{4.39}$$

It is noteworthy that (4.39) is independent of the matrix *J*(*x* ′ ). Now let (4.35) hold. We then have Γ = Γ <sup>⊤</sup> <sup>≻</sup> <sup>0</sup> which is equivalent to *<sup>Q</sup>*Γ*<sup>Q</sup>* = (*Q*Γ*Q*) <sup>⊤</sup> ≻ 0. From this follows that *<sup>V</sup>*˙(<sup>ε</sup> ) is negative-definite and thus <sup>ε</sup> <sup>≡</sup> <sup>0</sup> an asymptotically stable equilibrium of (4.37). Moreover, as shown in Proposition C.5 from Appendix C.3, the positive definiteness of *Q* and *Q*Γ*Q* implies the existence of

positive constants *<sup>k</sup>*1, *<sup>k</sup>*2, *<sup>k</sup>*<sup>3</sup> <sup>∈</sup> <sup>R</sup>><sup>0</sup> such that

$$k\_1 \|\mathbf{e}\|\|^2 \le V(\mathbf{e}) \le k\_2 \|\mathbf{e}\|\|^2 \tag{4.40a}$$

and

$$
\dot{V}(\mathfrak{e}) \le -k\_3 \|\mathfrak{e}\|^2 \tag{4.40b}
$$

hold for all *<sup>x</sup>* <sup>∈</sup> <sup>X</sup>. Hence, <sup>ε</sup> <sup>≡</sup> <sup>0</sup> is a globally exponentially stable equilibrium of (4.37) [Khalil, 2002, Theorem 4.10]. This implies (4.36) to be a globally exponentially convergent observer for the system consisting of (4.29) and (4.31).

Equation (4.35) is a sufficient condition for the existence of an asymptotic observer of the form (4.36). Thus, the observer design problem is to find a matrix *L*(*x* ′ ) such that (4.35) is fulfilled. For the case where *R*(*x* ′ ) = *R* = const., *C*(*x* ′ ) = *C* = const., we can approach with a constant matrix *L*(*x* ′ ) = *L*. In this case, (4.35) represents a LMI. There exist powerful numerical methods to solve such an LMI, see, e.g., Boyd et al. [1994]. On the other hand, such an LMI-based design approach suffers from two shortcomings: (a) it is restricted to the case *R*(*x* ′ ) = *R* = const., *C*(*x* ′ ) = *C* = const.; (b) in general it is limited to a numeric observer design, i.e., it disallows for a symbolic observer design. Hence, in the sequel, we consider an alternative approach for finding a matrix *L*(*x* ′ ) such that (4.35) is satisfied.

Recall that *R*(*x* ′ ) <sup>⪰</sup> <sup>0</sup> for all *<sup>x</sup>* ′ ∈ X ′ . For (4.35) to hold, we need to find a matrix *L*(*x* ′ ) which moves the zero eigenvalues of <sup>−</sup>*R*(*<sup>x</sup>* ′ ) to the left. The following lemma proposes a choice of *L*(*x* ′ ) which has the best chances to accomplish this:

**Lemma 4.17 (Observer design)**

*Consider two matrices <sup>R</sup>*(*s*) <sup>∈</sup> <sup>R</sup> *<sup>n</sup>*×*<sup>n</sup> and <sup>C</sup>*(*s*) <sup>∈</sup> <sup>R</sup> *<sup>q</sup>*×*<sup>n</sup> depending on some parameter <sup>s</sup>* <sup>∈</sup> <sup>S</sup>*. Let <sup>R</sup>*(*s*) = *<sup>R</sup>* <sup>⊤</sup>(*s*) <sup>⪰</sup> <sup>0</sup> *for all <sup>s</sup>* <sup>∈</sup> <sup>S</sup>*. There exists a matrix L*(*s*) ∈ R *<sup>n</sup>*×*<sup>q</sup> which satisfies*

$$\mathbf{R}(\mathbf{s}) + \frac{1}{2}\mathbf{L}(\mathbf{s})\mathbf{C}(\mathbf{s}) + \frac{1}{2}\mathbf{C}^{\top}(\mathbf{s})\mathbf{L}^{\top}(\mathbf{s}) \succ 0, \quad \forall \mathbf{s} \in \mathbb{S}, \tag{4.41}$$

*if and only if* (4.41) *is satisfied for L*(*s*) = *C* ⊤(*s*)*.*

#### Proof:

We show that the following two statements are equivalent:

$$\begin{aligned} \mathbf{J}(i) & \quad \forall \mathbf{s} \in \mathbb{S} \colon \exists \mathbf{L}(\mathbf{s}) \in \mathbb{R}^{n \times q} \text{ s.t. } \mathbf{R}(\mathbf{s}) + \frac{1}{2} \mathbf{L}(\mathbf{s}) \mathbf{C}(\mathbf{s}) + \frac{1}{2} \mathbf{C}^{\top}(\mathbf{s}) \mathbf{L}^{\top}(\mathbf{s}) \succeq 0, \\\\ \mathbf{J}(i) & \quad \forall \mathbf{s} \in \mathbb{S} \colon \mathbf{R}(\mathbf{s}) + \mathbf{C}^{\top}(\mathbf{s}) \mathbf{C}(\mathbf{s}) \succeq 0. \end{aligned} \tag{4.42a}$$

$$\mathbf{a} \cdot (ii) \qquad \forall \mathbf{s} \in \mathbb{S} \colon \mathbf{R}(\mathbf{s}) + \mathbf{C}^{\top}(\mathbf{s})\mathbf{C}(\mathbf{s}) \succ 0. \tag{4.42b}$$

By setting *L*(*s*) = *C* <sup>⊤</sup>(*s*) it is easy to see that that (*ii*) implies (*i*). We now show that (*i*) also implies (*ii*). To this end, we show the contraposition, i.e., that if *R*(*s*) +*C* <sup>⊤</sup>(*s*)*C*(*s*) is not positive-definite, then the matrix in (*i*) is not positivedefinite for all *L*(*s*).

Let (*ii*) be violated. The matrix *R*(*s*) +*C* <sup>⊤</sup>(*s*)*C*(*s*) is positive semi-definite, i.e.,

$$\mathbf{R(s) + \mathbf{C}^{\top}(s)\mathbf{C(s)} \succeq 0}, \quad \forall \mathbf{s} \in \mathbb{S}, \tag{4.43}$$

as *<sup>R</sup>*(*s*) <sup>⪰</sup> 0 and

$$\boldsymbol{\nu}^{\top}\mathbf{C}^{\top}(\mathfrak{s})\mathbf{C}(\mathfrak{s})\boldsymbol{\nu} = ||\mathbf{C}(\mathfrak{s})\boldsymbol{\nu}|| \ge 0, \quad \forall \mathfrak{s} \in \mathbb{S}, \forall \mathfrak{v} \in \mathbb{R}^{n}, \tag{4.44}$$

i.e., *C* <sup>⊤</sup>(*s*)*C*(*s*) <sup>⪰</sup> <sup>0</sup> for all *<sup>s</sup>* <sup>∈</sup> <sup>S</sup>. From (4.43) and the negation of (*ii*) follows, that there exists a non-zero vector *<sup>v</sup>* <sup>∈</sup> <sup>R</sup> *<sup>n</sup>* and a value *<sup>s</sup>*<sup>0</sup> <sup>∈</sup> <sup>S</sup> such that

$$\mathbf{v}^{\top} \left( \mathbf{R}(\mathfrak{s}\_{0}) + \mathbf{C}^{\top}(\mathfrak{s}\_{0}) \mathbf{C}(\mathfrak{s}\_{0}) \right) \mathbf{v} = \mathbf{0}. \tag{4.45}$$

For this *v* and *s*<sup>0</sup> we have

$$\begin{aligned} \mathbf{v}\,^\top \mathbf{R}(\mathbf{s}\_0)\mathbf{v} + \mathbf{v}\,^\top \mathbf{C}^\top(\mathbf{s}\_0)\mathbf{C}(\mathbf{s}\_0)\mathbf{v} &= 0, \\ \Leftrightarrow \quad \mathbf{v}\,^\top \mathbf{R}(\mathbf{s}\_0)\mathbf{v} &= 0 \quad \wedge \quad \mathbf{v}\,^\top \mathbf{C}^\top(\mathbf{s}\_0)\mathbf{C}(\mathbf{s}\_0)\mathbf{v} = 0, \\ \Leftrightarrow \quad \mathbf{v}\,^\top \mathbf{R}(\mathbf{s}\_0)\mathbf{v} &= 0 \quad \wedge \quad \mathbf{v}\in \text{ker}\left(\mathbf{C}(\mathbf{s}\_0)\right). \end{aligned} \tag{4.446}$$

For the left hand side of (4.42a) we obtain

$$\underbrace{\boldsymbol{\nu}^{\top}\boldsymbol{\mathcal{R}}(\mathfrak{s}\_{0})\boldsymbol{\nu}}\_{=0} + \frac{1}{2}\boldsymbol{\nu}^{\top}\boldsymbol{\mathcal{L}}(\mathfrak{s}\_{0})\underbrace{\boldsymbol{\mathcal{C}}(\mathfrak{s}\_{0})\boldsymbol{\nu}}\_{=\mathbf{0}} + \frac{1}{2}\underbrace{\boldsymbol{\nu}^{\top}\boldsymbol{\mathcal{C}}^{\top}(\mathfrak{s}\_{0})\boldsymbol{\mathcal{L}}^{\top}(\mathfrak{s}\_{0})\boldsymbol{\nu} = 0. \tag{4.47}$$

Hence, for *<sup>s</sup>*<sup>0</sup> <sup>∈</sup> <sup>S</sup> and for all *<sup>L</sup>*(*s*) the matrix

$$\mathbf{R}(\mathbf{s}\_0) + \frac{1}{2}\mathbf{L}(\mathbf{s}\_0)\mathbf{C}(\mathbf{s}\_0) + \frac{1}{2}\mathbf{C}^\top(\mathbf{s}\_0)\mathbf{L}^\top(\mathbf{s}\_0) \tag{4.48}$$

is not positive-definite. This is the contraposition of statement (*i*).

*Remark* 4.18 (Scaling of the observer gain)*.* Lemma 4.17 holds also for an observer gain *L*(*s*) = α*C* <sup>⊤</sup>(*s*) where <sup>α</sup> <sup>∈</sup> <sup>R</sup>><sup>0</sup>. The parameter <sup>α</sup> can be used to increase (α > 1) or decrease (α < 1)the convergence rate of those observer states that are influenced by the error injection.

Lemma 4.16 presents a state observer for the PHS (4.29). Lemma 4.17 provides a simple design for such an observer. From Lemma 4.15 we know, that a state observer can be easily extended to a state-output observer. In the following theorem, we summarize these insights to formulate a globally exponentially convergent state-output observer for the PHS (4.29):

#### **Theorem 4.19 (State-output observer)**

*Consider a nonlinear PHS* (4.29) *with Hamiltonian* (4.30) *and measurements* (4.31)*. Let*

$$\mathbf{R(x') + \mathbf{C}^\top(x')\mathbf{C(x') \succ 0}}, \quad \forall \mathbf{x'} \in \mathbb{X'}.\tag{4.49}$$

*hold. A globally exponentially convergent state-output observer for the system is given by*

$$\dot{\hat{\mathbf{x}}} = \left( \mathbf{J}(\mathbf{x}') - \mathbf{R}(\mathbf{x}') \right) \frac{\partial H}{\partial \mathbf{x}}(\hat{\mathbf{x}}) + \mathbf{G}(\mathbf{x}')\mathbf{u} + \mathbf{C}^{\top}(\mathbf{x}') \left( \mathbf{m} - \mathbf{C}(\mathbf{x}') \mathbf{Q} \hat{\mathbf{x}} \right), \quad \text{(4.50a)}$$

$$
\hat{\mathbf{y}} = \mathbf{G}^{\top}(\mathbf{x}') \frac{\partial H}{\partial \mathbf{x}}(\hat{\mathbf{x}}),\tag{4.50b}
$$

*with initial value <sup>x</sup>*ˆ<sup>|</sup> *<sup>t</sup>*=<sup>0</sup> = *x*ˆ0*.*

#### Proof:

The proof follows directly from Lemma 4.15, Lemma 4.16, and Lemma 4.17. In the latter we substitute *<sup>s</sup>* <sup>∈</sup> <sup>S</sup> with *<sup>x</sup>* ′ ∈ X ′ .

It is important to note that the observer from Theorem 4.19 is directly obtained from the system model. In particular, there are no free observer parameters which is why its design is inherently automatable. Hence, Theorem 4.19 solves Problem 4.12.

In the following, the nonlinear observer from Theorem 4.19 is illustrated. To this end, we resume with the example that was used to demonstrate the methods from Chapter 3. This illustrates the consistency between the methods from chapters 3 and 4.

## **Example 4.20:**

*Consider the PHS from Example 3.34 for K* = 1*:*

$$
\begin{pmatrix}
\dot{\mathbf{x}}\_1 \\
\dot{\mathbf{x}}\_2 \\
\dot{\mathbf{x}}\_3
\end{pmatrix} = (\begin{pmatrix}
0 & 0 & 0 \\
0 & 0 & -1 \\
0 & 1 & 0
\end{pmatrix} - \begin{pmatrix}
d & de^{\mathbf{x}\mathbf{x}\_1} & 0 \\
de^{\mathbf{x}\mathbf{x}\_1} & de^{2\mathbf{x}\mathbf{x}\_1} & 0 \\
0 & 0 & 0
\end{pmatrix}) \frac{\partial H}{\partial \mathbf{x}}
$$

$$
+ \begin{pmatrix}
0 & d \\
1 & de^{\mathbf{x}\mathbf{x}\_1} \\
0 & 0
\end{pmatrix} \begin{pmatrix}
u\_1 \\
\mu\_2
\end{pmatrix},
\tag{4.51a}
$$

$$
\begin{pmatrix} \mathbf{y}\_1 \\ \mathbf{y}\_2 \end{pmatrix} = \begin{pmatrix} 0 & 1 & 0 \\ -d & -de^{\mathbf{x}\mathbf{x}\_1} & 0 \end{pmatrix} \frac{\partial H}{\partial \mathbf{x}} + \begin{pmatrix} 0 & 0 \\ 0 & d \end{pmatrix} \begin{pmatrix} u\_1 \\ u\_2 \end{pmatrix}, \tag{4.51b}
$$

*with d* > 0 *and the non-quadratic Hamiltonian*

$$H(\mathfrak{x}) = \frac{1}{2} \mathfrak{x}^{\top} \begin{pmatrix} q\_1 & 0 & 0 \\ 0 & q\_2 & 0 \\ 0 & 0 & q\_3 \end{pmatrix} \mathfrak{x} + \frac{1}{4} \mathfrak{x}\_1^4,\tag{4.52}$$

*where q*1,*q*2,*q*<sup>3</sup> > 0*. For the system, consider two measurements m*<sup>1</sup> = *x*<sup>1</sup> *and m*<sup>2</sup> = *e* <sup>κ</sup>*x*<sup>1</sup> *x*3*. The corresponding measurement equation reads:*

$$\mathfrak{m} = \underbrace{\begin{pmatrix} q\_1^{-1} & 0 & 0 \\ 0 & 0 & q\_3^{-1} e^{\mathbf{x} \mathbf{x}\_1} \\ \hline \\ \mathbf{C}(\mathbf{x}\_1) \end{pmatrix}}\_{=\mathbf{C}(\mathbf{x}\_1)} \begin{pmatrix} q\_1 & 0 & 0 \\ 0 & q\_2 & 0 \\ 0 & 0 & q\_3 \end{pmatrix} \begin{pmatrix} \mathbf{x}\_1 \\ \mathbf{x}\_2 \\ \mathbf{x}\_3 \end{pmatrix}. \tag{4.533}$$

*Following the notation from Problem 4.12, we have x* ′ = *x*<sup>1</sup> *and x* ′′ = (*x*<sup>2</sup> *x*3) ⊤*.*

*Now for the observer. We have*

$$\mathbf{R}(\mathbf{x}\_{\mathrm{l}}) + \mathbf{C}^{\top}(\mathbf{x}\_{\mathrm{l}}) \mathbf{C}(\mathbf{x}\_{\mathrm{l}}) = \begin{pmatrix} d + q\_{1}^{-2} & de^{\mathbf{x}\mathbf{x}\_{\mathrm{l}}} & 0 \\ de^{\mathbf{x}\mathbf{x}\_{\mathrm{l}}} & de^{2\mathbf{x}\mathbf{x}\_{\mathrm{l}}} & 0 \\ 0 & 0 & q\_{3}^{-2}e^{2\mathbf{x}\mathbf{x}\_{\mathrm{l}}} \end{pmatrix} \succ 0,\tag{4.54}$$

−1 −0.5 0

−2

observer (4.50) (dashed, red)

) = *C* = const.

−1

*y*2

*C*(*x* ′ 0

*y*1

*e* κ

*e* κ

*for all <sup>x</sup>* <sup>∈</sup> <sup>X</sup>*. Thus, the observer existence condition* (4.49) *is satisfied and an asymptotic state-output observer is given by* (4.50)*. for all x* ∈ X*. Thus, the observer existence condition* (4.49) *is satisfied and an asymptotic for all x* ∈ X*. Thus, the observer existence condition* (4.49) *is satisfied and an asymptotic state-output observer is given by* (4.50)*.*

*d* +*q* −2 1

*de*κ*<sup>x</sup>*<sup>1</sup> *de*<sup>2</sup>κ*<sup>x</sup>*<sup>1</sup> 0

*d* +*q* −2 1

> *de*κ*<sup>x</sup>*<sup>1</sup> *de*<sup>2</sup>κ*<sup>x</sup>*<sup>1</sup> 0

96 Chapter 4. Automated Observer Design

96 Chapter 4. Automated Observer Design

*<sup>x</sup>*<sup>1</sup> *x*3*. The corresponding measurement equation reads:*

*<sup>x</sup>*<sup>1</sup> *x*3*. The corresponding measurement equation reads:*

*Following the notation from Problem 4.12, we have x*

*Following the notation from Problem 4.12, we have x*

<sup>⊤</sup>(*x*1)*C*(*x*1) =

<sup>⊤</sup>(*x*1)*C*(*x*1) =

0 0 0 0 *q*

0 0 0 0 *q*



−1 3 *e* κ*x*1 !

−1 3 *e* κ*x*1 !

 

 

*m* = *q* −1 1

*m* = *q* −1 1

*Now for the observer. We have*

*R*(*x*1) +*C*

*Now for the observer. We have*

*where q*1,*q*2,*q*<sup>3</sup> > 0*. For the system, consider two measurements m*<sup>1</sup> = *x*<sup>1</sup> *and m*<sup>2</sup> =

*where q*1,*q*2,*q*<sup>3</sup> > 0*. For the system, consider two measurements m*<sup>1</sup> = *x*<sup>1</sup> *and m*<sup>2</sup> =

 

 

*q*<sup>1</sup> 0 0 0 *q*<sup>2</sup> 0 0 0 *q*<sup>3</sup>

*q*<sup>1</sup> 0 0 0 *q*<sup>2</sup> 0 0 0 *q*<sup>3</sup>

> *de*κ*<sup>x</sup>*<sup>1</sup> 0

0 0 *q*

*de*κ*<sup>x</sup>*<sup>1</sup> 0

0 0 *q*

 

 

′ = *x*<sup>1</sup> *and x*

′ = *x*<sup>1</sup> *and x*

−2 3 *e* 2κ*x*1

−2 3 *e* 2κ*x*1

 *x*1 *x*2 *x*3

 *x*1 *x*2 *x*3

. (4.53)

. (4.53)

⊤*.*

<sup>≻</sup> <sup>0</sup>, (4.54)

⊤*.*

′′ = (*x*<sup>2</sup> *x*3)

′′ = (*x*<sup>2</sup> *x*3)

*Now, the results obtained from numerical simulation of the system* (4.51) *and the observer* (4.50) *are illustrated. The system parameters are chosen to d* = 1*, q*<sup>1</sup> = 1 2 *, q*<sup>2</sup> = 1 3 *, q*<sup>3</sup> = 1 4 *, and* κ = 0.1*. The initial values of the system and the observer are given by x*<sup>0</sup> = (0 0 0) <sup>⊤</sup> *and x*ˆ<sup>0</sup> = (1 1 1) <sup>⊤</sup>*, respectively. The input signals are specified to <sup>u</sup>*<sup>1</sup> <sup>=</sup> <sup>σ</sup>(*<sup>t</sup>* <sup>−</sup>10s) *and <sup>u</sup>*<sup>2</sup> <sup>=</sup> sin(0.1s−<sup>1</sup> *t*) *where* <sup>σ</sup>(·) *is the unit step function. state-output observer is given by* (4.50)*. Now, the results obtained from numerical simulation of the system* (4.51) *and the observer* (4.50) *are illustrated. The system parameters are chosen to d* = 1*, q*<sup>1</sup> = 1 2 *q*<sup>2</sup> = 1 3 *, q*<sup>3</sup> = 1 4 *, and* κ = 0.1*. The initial values of the system and the observer are given by x*<sup>0</sup> = (0 0 0) <sup>⊤</sup> *and x*ˆ<sup>0</sup> = (1 1 1) ⊤*, respectively. The input signals are specified to u*<sup>1</sup> = σ(*<sup>t</sup>* <sup>−</sup>10 s) *and <sup>u</sup>*<sup>2</sup> <sup>=</sup> sin(0.1 s−<sup>1</sup> *t*) *where* σ(·) *is the unit step function. Now, the results obtained from numerical simulation of the system* (4.51) *and the observer* (4.50) *are illustrated. The system parameters are chosen to d* = 1*, q*<sup>1</sup> = *q*<sup>2</sup> = 1 3 *, q*<sup>3</sup> = 1 4 *, and* κ = 0.1*. The initial values of the system and the observer are given by x*<sup>0</sup> = (0 0 0) <sup>⊤</sup> *and x*ˆ<sup>0</sup> = (1 1 1) ⊤*, respectively. The input signals are specified to u*<sup>1</sup> = σ(*<sup>t</sup>* <sup>−</sup>10 s) *and <sup>u</sup>*<sup>2</sup> <sup>=</sup> sin(0.1 s−<sup>1</sup> *t*) *where* σ(·) *is the unit step function. Figure 4.4 depicts the states x<sup>i</sup> (solid, blue) and the reconstructions x*ˆ*<sup>i</sup> (dashed, red) for i* = 1,2,3*.*

*Figure 4.4 depicts the states x<sup>i</sup> (solid, blue) and the reconstructions x*ˆ*<sup>i</sup> (dashed, red) for i* = 1,2,3*. Figure 4.4 depicts the states x<sup>i</sup> (solid, blue) and the reconstructions x*ˆ*<sup>i</sup> (dashed, red) for i* = 1,2,3*.* 1

observer (4.50) (dashed, red) *As can be seen, the state reconstructions reach the true states in less than ten seconds.* **Figure 4.4:** States of the system (4.51) (solid, blue) and corresponding reconstructions from the observer (4.50) (dashed, red)

**Figure 4.4:** States of the system (4.51) (solid, blue) and corresponding reconstructions from the

*The reconstructions of the system output are given in the following figure:* 0.5 1 *As can be seen, the state reconstructions reach the true states in less than ten seconds. The reconstructions of the system output are given in the following figure:*

0 5 10 15 20 25 30 35 40 45 50

*System Observer*

*t in* s

0 5 10 15 20 25 30 35 40 45 50

*t in* s

**Figure 4.5:** Outputs of the system (4.51) (solid, blue) and corresponding reconstructions from the

*The figure shows that the reconstructed outputs also converge to the true outputs.*

In the following two corollaries, we analyze the results obtained so far more in detail. First, we consider the case of linear measurements, i.e., the case where in (4.31) we have

*,*

1 2 *,*

4.2. Main Results 97

4.2. Main Results 97

0 5 10 15 20 25 30 35 40 45 50

*t in* s

0 5 10 15 20 25 30 35 40 45 50

*t in* s

**Figure 4.4:** States of the system (4.51) (solid, blue) and corresponding reconstructions from the

*As can be seen, the state reconstructions reach the true states in less than ten seconds.*

**Figure 4.4:** States of the system (4.51) (solid, blue) and corresponding reconstructions from the

*The reconstructions of the system output are given in the following figure:*

*The reconstructions of the system output are given in the following figure:*

**Figure 4.5:** Outputs of the system (4.51) (solid, blue) and corresponding reconstructions from the observer (4.50) (dashed, red) observer (4.50) (dashed, red) *The figure shows that the reconstructed outputs also converge to the true outputs.* **Figure 4.5:** Outputs of the system (4.51) (solid, blue) and corresponding reconstructions from the observer (4.50) (dashed, red)

**Figure 4.5:** Outputs of the system (4.51) (solid, blue) and corresponding reconstructions from the

*t in* s

#### *The figure shows that the reconstructed outputs also converge to the true outputs.* In the following two corollaries, we analyze the results obtained so far more in detail. *As can be seen, the reconstructed outputs also converge to the true outputs.*

In the following two corollaries, we analyze the results obtained so far more in detail. First, we consider the case of linear measurements, i.e., the case where in (4.31) we have *C*(*x* ′ ) = *C* = const. First, we consider the case of linear measurements, i.e., the case where in (4.31) we have *C*(*x* ′ ) = *C* = const. In the following two corollaries, we analyze the results obtained so far more in detail. First, we consider the case of linear measurements, i.e., the case where in (4.31) we have *C*(*x* ′ ) = *C* = const.

#### **Corollary 4.21 (Linear Measurements)**

*Given a system with dynamics* (4.29a) *and measurements* (4.31) *where the measurement matrix is a constant matrix C*(*x* ′ ) = *C. The existence condition* (4.35) *for an observer of the form* (4.36) *is satisfied if and only if it is satisfied for the constant matrix L* = *C* ⊤*.*

#### Proof:

The claim follows from Lemma 4.16 and Lemma 4.17 under *C*(*x* ′ ) = *C*.

The main point from Corollary 4.21 is as follows. Despite the fact that the matrix *R*(*x* ′ ) is parametrized over *x* ′ , a constant observer gain *L* is sufficient to evaluate if the existence condition (4.35) is solvable or not. In other words, for *C*(*x* ′ ) = *C* = const., there is no benefit in approaching with a parametrized

observer (4.50) (dashed, red)

1

observer (4.50) (dashed, red)

*x*3

*x*3

observer gain *L*(*x* ′ ). 5 In this context, Corollary 4.21 reflects the idea behind Lemma 4.17. Loosely speaking, if the output error injection allows to access those parts of <sup>−</sup>*R*(*<sup>x</sup>* ′ ) which corresponds to zero eigenvalues, we can shift them to the left. In the case of linear measurements, a constant observer gain which is independent of *x* ′ is sufficient towards this endeavor. On the other hand, if *R*(*x* ′ ) is already positive-definite, the observer (4.36) is asymptotic without any error injection. This is addressed in the last corollary of this subsection.

#### **Corollary 4.22 (Strictly passive systems)**

*Consider a strictly passive PHS* (4.29) *with measurements* (4.31)*, i.e., the case where R*(*x* ′ ) <sup>≻</sup> <sup>0</sup> *for all <sup>x</sup>* ′ ∈ X ′ *. A globally exponentially convergent state observer for the system is given by* (4.36) *with L* = 0*.*

#### Proof:

The statement follows from Lemma 4.16 under *R*(*x* ′ ) <sup>≻</sup> 0 for all *<sup>x</sup>* ′ ∈ X ′ .

Corollaries 4.21 and 4.22 conclude the observer design methods from this subsection. Thereby, like the previous Subsection 4.2.1, the subsection at hand addressed the design of a centralized observer based on global model knowledge. However, as argued in Chapter 2, the design of distributed observers based on local model knowledge is also of interest in the context of interconnected systems. This is the topic to be addressed in the next subsection.

#### 4.2.3 Automated Design of Distributed Observers

In this subsection, we investigate how the methods from subsections 4.2.1 and 4.2.2 can be applied for an automated design of distributed observers based on local model knowledge.<sup>6</sup> First, the system setup is briefly outlined. Afterwards, two approaches for an automated design of distributed observers are presented. The first approach is based on the methods from Subsection 4.2.1; the second approach is based on the methods from Subsection 4.2.2.

Consider an interconnected system Σ described by an open graph G = (V,B) where <sup>V</sup> <sup>=</sup> <sup>V</sup><sup>I</sup> <sup>∪</sup> <sup>V</sup>B, <sup>B</sup> <sup>=</sup> <sup>B</sup><sup>I</sup> <sup>∪</sup>B<sup>B</sup> (cf. Term 2.3). Let the set of inner vertices

<sup>5</sup>This statement is limited to the property of an observer of being asymptotic.

<sup>6</sup>As outlined in Chapter 2, the here applied notion of a distributed observer follows that of Castanedo [2013] and Kupper [2019].

<sup>V</sup><sup>I</sup> represent *<sup>N</sup>* <sup>=</sup> <sup>|</sup>VI<sup>|</sup> subsystems <sup>Σ</sup>*<sup>i</sup>* (*<sup>i</sup>* <sup>∈</sup> <sup>V</sup>I). The *<sup>N</sup>* subsystems are coupled through *<sup>M</sup>* <sup>=</sup> <sup>|</sup>BI<sup>|</sup> inner edges that represent power-conserving interconnections. Moreover, the subsystems Σ*<sup>i</sup>* may interact with the environment of Σ via *P* boundary vertices and corresponding boundary edges (*<sup>P</sup>* <sup>=</sup> <sup>|</sup>VB<sup>|</sup> <sup>=</sup> <sup>|</sup>BB|). Each edge *<sup>j</sup>* <sup>∈</sup> <sup>B</sup> carries an effort *<sup>e</sup> <sup>j</sup>* <sup>∈</sup> <sup>R</sup> *<sup>K</sup><sup>j</sup>* and a flow *f <sup>j</sup>* ∈ R *<sup>K</sup><sup>j</sup>* where *<sup>K</sup><sup>j</sup>* <sup>∈</sup> <sup>N</sup>≥<sup>1</sup> for all *j* ∈ B.

Figure 4.6 depicts the situation for an example system <sup>Σ</sup> with <sup>V</sup><sup>I</sup> <sup>=</sup> {1,2,3}, <sup>V</sup><sup>B</sup> <sup>=</sup> {*B*1,*B*2}, <sup>B</sup><sup>I</sup> <sup>=</sup> {(1,2),(2,3)}, *<sup>B</sup>*<sup>B</sup> <sup>=</sup> {(*B*1,1),(*B*2,2)}, i.e., *<sup>N</sup>* <sup>=</sup> 3, *<sup>M</sup>* <sup>=</sup> 2, and *P* = 2.

**Figure 4.6:** Exemplary interconnected system

In the following, we consider the situation where both—the observers and the model knowledge—are distributed according to the subsystems Σ*<sup>i</sup>* of Σ. The first approach for an automated design of a distributed observer is based on the methods from Subsection 4.2.1.

#### Design of a Distributed Observer with the Methods from Subsection 4.2.1

Given an interconnected system Σ consisting of *N* subsystems as described above. Suppose that Σ is a linear system. Moreover, let us consider the case where the interactions between the subsystems are completely unknown.

**Assumption 4.23 (Unknown interaction)** *For each <sup>j</sup>* <sup>∈</sup> <sup>B</sup>*, the effort-flow pair* (*<sup>e</sup> <sup>j</sup>*, *<sup>f</sup> j* ) *is not available for measurement.*

From Assumption 4.23 we deduce that the input and output of each subsystem model is completely unknown. Moreover, subsystem states may also be unknown. Hence, for each subsystem the input, state, and output have to be reconstructed. To this end, we consider measurements that are linear combinations of the respective inputs, states, and outputs.

From a subsystem perspective, this setup is a special case of Problem 4.1 from Subsection 4.2.1. Accordingly, the following corollary reconsiders the methods from Subsection 4.2.1 in a subsystem-wise manner to design a distributed inputstate-output observer:

**Corollary 4.24 (Distributed observer for system with unknown interactions)**

*Consider an interconnected system* Σ *described by a graph* G = (V,B)*. Let the subsystems* Σ*<sup>i</sup> be described by linear explicit PHSs of the form*

$$\dot{\mathbf{x}}\_{l} = \left(\mathbf{J}\_{l} - \mathbf{R}\_{l}\right) \left. \mathbf{Q}\_{l} \mathbf{x}\_{l} + \left(\mathbf{G}\_{l} - \mathbf{P}\_{l}\right) \mathbf{u}\_{l} \right|\_{l=0} = \mathbf{x}\_{l,0},\tag{4.55a}$$

$$\mathbf{y}\_{l} = (\mathbf{G}\_{l} + \mathbf{P}\_{l})^{\top} \mathbf{Q}\_{l} \mathbf{x}\_{l} + (\mathbf{M}\_{l} + \mathbf{S}\_{l}) \mathbf{u}\_{l},\tag{4.55b}$$

*with ui*, *y<sup>i</sup>* ∈ R *<sup>p</sup><sup>i</sup> and <sup>x</sup><sup>i</sup>* <sup>∈</sup> <sup>R</sup> *<sup>n</sup><sup>i</sup> for <sup>i</sup>* <sup>∈</sup> <sup>V</sup><sup>I</sup> *. In* (4.55)*, we have Q<sup>i</sup>* = *Q* ⊤ *<sup>i</sup>* <sup>≻</sup> <sup>0</sup>*; the remaining matrices satisfy the usual symmetry and definiteness conditions of such a PHS (cf. Definition 2.23). For each <sup>i</sup>* <sup>∈</sup> <sup>V</sup><sup>I</sup> *, consider q<sup>i</sup>* > *p<sup>i</sup> linear independent measurements <sup>m</sup><sup>i</sup>* <sup>∈</sup> <sup>R</sup> *<sup>q</sup><sup>i</sup> of the form*

$$\mathbf{m}\_{i} = \mathbf{C}\_{i,u}\mathbf{u}\_{i} + \mathbf{C}\_{i,\mathbf{x}}\mathbf{x}\_{i} + \mathbf{C}\_{i,\mathbf{y}}\mathbf{y}\_{i}.\tag{4.56}$$

*Then, for each <sup>i</sup>* <sup>∈</sup> <sup>V</sup><sup>I</sup> *we can formulate an unknown-input system*

$$
\dot{\mathbf{x}}\_l = \mathbf{A}\_l \mathbf{x}\_l + \mathbf{B}\_l \mathbf{u}\_l,\tag{4.57a}
$$

$$
\bar{\mathbf{m}}\_{l} = \bar{\mathbf{C}}\_{l} \mathbf{x}\_{l}, \tag{4.57b}
$$

*where m*¯ *<sup>i</sup>* ∈ R *<sup>q</sup>i*−*r<sup>i</sup> with r<sup>i</sup>* = rank(*Ci*,*<sup>u</sup>* +*Ci*,*<sup>y</sup>* (*M<sup>i</sup>* +*Si*))*. Let* (4.57) *be strong*<sup>∗</sup> *detectable for each <sup>i</sup>* <sup>∈</sup> <sup>V</sup><sup>I</sup> *. Then, for each <sup>i</sup>* <sup>∈</sup> <sup>V</sup><sup>I</sup> *we can*


#### Proof:

The proof is given for one subsystem *<sup>i</sup>* <sup>∈</sup> <sup>V</sup><sup>I</sup> but translates to all other subsystems. Let Assumption 4.23 hold. Consider the PHS (4.55) with measurements (4.56). Assumption 4.23 implies that *u<sup>i</sup>* is completely unknown. The rest follows from Theorem 4.8 for the special case without known inputs.

The observers from Corollary 4.24 process only local measurement information to calculate reconstructions of the subsystems' inputs, states, and outputs. By this, the observers are fully distributed.

The design of the individual observers requires to determine the matrices *Ni*, *Li*, and *Ei*. These matrices can be automatically computed via a subsystem-wise application of Algorithm 4.10. For each subsystem, the respective execution of the algorithm requires only local model knowledge.

In the above, we considered a linear system where the exogenous variables of the subsystems are completely unknown. Instead, there have been measurements that are local with respect to the individual subsystems. In the following, we switch to a contrary case, viz. a class of nonlinear systems where the interactions between the subsystems are completely known without having additional measurement information from inside the system. Here, we apply the methods from Subsection 4.2.2 to propose an automated scheme for the design of distributed observers.

#### Design of a Distributed Observer with the Methods from Subsection 4.2.2

Suppose an interconnected system Σ consisting of *N* nonlinear subsystems. Let us consider the case in which the interactions amongst the subsystems and between the subsystems and the environment of Σ are fully available for measurement.

**Assumption 4.25 (Known interaction)** *For each <sup>j</sup>* <sup>∈</sup> <sup>B</sup>*, the effort-flow pair* (*<sup>e</sup> <sup>j</sup>*, *<sup>f</sup> j* ) *is known or measured.*

A key implication of Assumption 4.25 is that the input and the output of each subsystem model is known or measured. Thus, in this case all inputs are known and the measurement vector equals the output vector. Hence, no input and output reconstruction is required. As an example, we can think of a system consisting of subsystems with collocated sensors and actuators.

The following corollary particularizes the methods from Subsection 4.2.2 for an automated design of a distributed nonlinear observer:

**Corollary 4.26 (Distributed observer under known interactions)** *Given an interconnected system* Σ *described by a graph* G = (V,B)*. For each i* ∈ V<sup>I</sup> *, let the subsystem* Σ*<sup>i</sup> be described by an explicit PHS of the form*

$$\mathbf{x}\_{i} = \left(\mathbf{J}\_{i}(\mathbf{y}\_{i}) - \mathbf{R}\_{i}(\mathbf{y}\_{i})\right) \frac{\partial H\_{l}}{\partial \mathbf{x}\_{l}}(\mathbf{x}\_{i}) + \mathbf{G}\_{l}\mathbf{u}\_{i}, \quad \mathbf{x}\_{i}|\_{t=0} = \mathbf{x}\_{i,0},\tag{4.59a}$$

$$\mathbf{y}\_{l} = \mathbf{G}\_{l}^{\top} \frac{\partial H\_{l}}{\partial \mathbf{x}\_{l}}(\mathbf{x}\_{l}),\tag{4.59b}$$

*with u<sup>i</sup>* ∈ U*<sup>i</sup>* ⊂ R *pi , x<sup>i</sup>* ∈ X*<sup>i</sup>* ⊂ R *ni , and <sup>y</sup><sup>i</sup>* <sup>∈</sup> <sup>Y</sup>*<sup>i</sup>* <sup>⊂</sup> <sup>R</sup> *<sup>p</sup><sup>i</sup> where* X*<sup>i</sup> and* Y*<sup>i</sup> are compact. The Hamiltonian of* (4.59) *is given by Hi*(*xi*) = <sup>1</sup> 2 *x* ⊤ *<sup>i</sup> Qix<sup>i</sup>* + *Ni*(*y<sup>i</sup>* ) *where Q<sup>i</sup>* = *Q* ⊤ *<sup>i</sup>* <sup>≻</sup> <sup>0</sup> *is a matrix and <sup>N</sup><sup>i</sup>* : <sup>Y</sup>*<sup>i</sup>* <sup>→</sup> <sup>R</sup>*, <sup>y</sup><sup>i</sup>* 7→ *Ni*(*y<sup>i</sup>* ) *is a positive semi-definite and twice differentiable function that may be nonlinear. Let Assumption 4.25 hold. Moreover, let*

$$\mathbf{R}\_{l}(\mathbf{y}\_{l}) + \mathbf{G}\_{l}\mathbf{G}\_{l}^{\top} \succ \mathbf{0}, \quad \forall \mathbf{y}\_{l} \in \mathbb{Y}\_{l} \tag{4.60}$$

*be satisfied for all <sup>i</sup>* <sup>∈</sup> <sup>V</sup><sup>I</sup> *. Then, for each <sup>i</sup>* <sup>∈</sup> <sup>V</sup><sup>I</sup> *an exponentially convergent state observer is given by*

$$\dot{\mathfrak{X}}\_{l} = \left(\mathbf{J}\_{l}(\mathbf{y}\_{l}) - \mathbf{R}\_{l}(\mathbf{y}\_{l})\right) \frac{\partial H\_{l}}{\partial \mathbf{x}\_{l}}(\mathbf{\hat{x}}\_{l}) + \mathbf{G}\_{l} \left(\mathbf{u}\_{l} + \mathbf{y}\_{l} - \mathbf{G}\_{l}^{\top} \frac{\partial H\_{l}}{\partial \mathbf{x}\_{l}}(\mathbf{\hat{x}}\_{l})\right),\tag{4.61}$$

*with initial value <sup>x</sup>*ˆ*i*<sup>|</sup> *<sup>t</sup>*=<sup>0</sup> = *x*ˆ*i*,0*.*

#### Proof:

We particularize the results from Section 4.2.2 to the case where the measurement output equals the passive output.

Let (4.60) hold. The proof is given for the subsystem *<sup>i</sup>* <sup>∈</sup> <sup>V</sup><sup>I</sup> but translates to all other subsystems. Consider the state reconstruction error <sup>ε</sup> *<sup>i</sup>* <sup>=</sup> *<sup>x</sup><sup>i</sup>* <sup>−</sup>*x*ˆ*i*. With (4.59a) and (4.61), the error dynamics read

$$
\dot{\mathbf{c}}\_{l} = \left(\mathbf{J}\_{l}(\mathbf{y}\_{l}) - \mathbf{R}\_{l}(\mathbf{y}\_{l}) - \mathbf{G}\_{l}\mathbf{G}\_{l}^{\top}\right) \mathbf{Q}\_{l}\mathbf{c}\_{l}.\tag{4.62}
$$

Applying the Lyapunov function candidate *Vi*(ε *<sup>i</sup>*) = <sup>1</sup> 2 ε ⊤ *<sup>i</sup> Qi*ε *<sup>i</sup>* we obtain

$$\boldsymbol{\dot{V}}(\mathbf{e}\_{i}) = -\mathbf{e}\_{i}^{\top}\underbrace{\mathbf{Q}\_{i}\left(\mathbf{R}\_{i}(\mathbf{y}\_{i}) + \mathbf{G}\_{i}\mathbf{G}\_{i}^{\top}\right)}\_{\succ 0}\mathbf{Q}\_{i}\mathbf{e}\_{i}.\tag{4.63}$$

From this follows that <sup>ε</sup> *<sup>i</sup>* <sup>≡</sup> <sup>0</sup> is exponentially stable (cf. proof of Lemma 4.16). Thus, (4.61) is an exponentially convergent observer for (4.59).

*Remark* 4.27 (PHS with feedthrough)*.* Corollary 4.26 can be easily extended to a PHS with feedthrough (cf. Remark 4.14).

As can be seen, the observers from Corollary 4.26 require only knowledge of the interactions between the subsystems and are therewith distributed. Moreover, analogously to Subsection 4.2.2, the observers do not require a dedicated design. Instead, the observer parameters can be determined from the subsystems models.

This section showed that the centralized methods from subsections 4.2.1 and 4.2.2 can also be applied for an automated design of distributed observers based on local model information. It is important to note that the presented idea to distribute an observer design is not restricted to the two special cases from this subsection. The proposed principle may also be applied to several intermediate cases. For example, in Section 5.3 the methods from from Subsection 4.2.2 are applied to a nonlinear interconnected systems with partially known subsystem interaction. A theoretical examination of such intermediate cases, however, would not give new insights which is why we refrain from this step at this point.

This concludes the presentation of automated design methods for centralized and distributed observers for PHSs. In the next section, we discuss the presented methods with respect to the overall objectives of this thesis and previous results from the related literature.

#### 4.3 Discussion

The first main results of this chapter is Theorem 4.8 in which an automatable design scheme for an input-state-output observer for linear PHSs is proposed. A sufficient existence condition for this observer requires (i) that there are more (independent) measurements than unknown inputs (i.e., *q*˜ > *p*u) and (ii) that the state-space system (4.6) is strong<sup>∗</sup> detectable. In comparison, the existence condition for the input-state-output estimator from the preliminary work authored by Pfeifer et al. [2019a] demands the number of measurements to be greater or equal to the number of unknown inputs plus the number of states, i.e., *<sup>q</sup>*˜ <sup>≥</sup> *<sup>p</sup>*<sup>u</sup> <sup>+</sup>*n*. Hence, subcondition (i) is less restrictive than the existence condition from Pfeifer et al. [2019a]. Hautus [1983, Theorem 1.12] showed that subcondition (ii) is necessary and sufficient for the existence of an asymptotic state observer for a system (4.6). Thus, for the presented approach, subcondition (ii) is inevitable.

An interesting special case of Theorem 4.8 appears for a PHS with known inputs. In this case, subcondition (i) is always fufilled. Moreover, subcondition (ii) reduces to the condition of the system being detectable. This indicates the existence conditions of Theorem 4.8 to be reasonable. For the special case of known inputs, the observer design from Theorem 4.8 yields a standard Luenberger observer extended by an output reconstruction.

The subconditions (i) and (ii) can be evaluated by a computer algebra system (cf. Remark 4.9). If both subconditions are fulfilled, we can automatically design an input-state-output observer by using Algorithm 4.10. Thereby, as for the

modeling, the system size for a purely symbolic observer design is limited (cf. Section 3.3). The symbolic computation of the singular value decomposition, the generalized inverse, and the pole placement may lead to expressions of considerable size. Again, it is impossible to state an absolute limit for the system size as the feasibility of the symbolic calculations strongly depend on the specific structure of the matrices. For a numeric observer design with Algorithm 4.10 the computational complexity is determined by the complexity of the calculation of the inverse matrices required for the pole placement. Here, the upper bound is polynomial and given by *O*(*n* 3 ) where *n* is the number of system states, see Lyche [2020, p. 65].<sup>7</sup>

The observer obtained from Algorithm 4.10 requires the first time-derivative of the measurement vector which, however, is unavoidable for an input reconstruction with a continuous observer [Hou and Patton, 1998]. To circumvent this problem, one can approach with a discontinuous sliding mode observer as from Edwards and Spurgeon [1994]. The design of sliding mode observers, however, involves more degrees of freedom which makes its automation delicate. The interested reader may refer to the thesis of Singer [2019].

Let us summarize that for linear PHSs with unknown inputs, states, and outputs we can design asymptotic observer in an automated manner. The existence conditions of the observer are reasonable.

The second main result of this chapter is Theorem 4.19. The theorem provides a sufficient condition for global exponential convergence of a state-output observer applicable to a class of nonlinear PHS. This class is quite general as it allows for state-dependent matrices and a possibly non-quadratic Hamiltonian. Venkatraman and van der Schaft [2010] consider an almost identical class of systems. A limitation of this class of PHSs is the assumption that those states which are responsible for the state-dependence of the PHSs matrices and which constitute the non-quadratic part of the Hamiltonian are measured. On the other hand, in practical systems this assumption may be satisfied by an appropriate sensor placement.

The observer from Theorem 4.19 obviates a dedicated "design" as it can be derived directly from the system model. This is in contrast to the observer design from Venkatraman and van der Schaft [2010] which requires the closed-form solution of a set of PDEs and algebraic equations. According to the underlying model, the observer resulting from Theorem 4.19 will be symbolic or numeric.

<sup>7</sup>The upper bound *O*(*n* 3 ) is under the assumption that the number of states is greater than the number of measurements and greater than the number of unknown inputs.

The existence condition of the observer requires the error system to be sufficiently damped. Thereby, the damping consists of two parts, viz. the natural damping of the system and a virtual damping arising from the error injection. To ensure a fast convergence of all observer states, the error injection must access those states subject to no or weak natural dissipation. On the other hand, if the natural damping is sufficiently strong on all states (i.e., the system is strictly passive), one can completely omit the error injection in the observer (cf. Corollary 4.22).

The damping interpretation is closely related to well-known insights for the control of PHSs, see, e.g., Kugi [2001, Sec. 2.4] and van der Schaft [2017, Sec. 7.1]. By this relation, the results from Subsection 4.2.2 may also be applied for the design of controllers. As an example, in Appendix C.4 we use Lemma 4.17 for the automated design of an asymptotically stabilizing feedback controller for PHSs without feedthrough.

As an interim conclusion, for a class of nonlinear PHSs we can derive globally exponentially convergent observers directly from the system model.

A third considerable result from this chapter is given in corollaries 4.24 and 4.26. Corollary 4.24 shows that is is straightforward to reconsider the approach from Theorem 4.8 to design subsystem observers for linear interconnected systems on the basis of local models. The obtained observers only require measurement information which is local with respect to the subsystems. Even further, the observers from Corollary 4.24 obviate any information on the interactions between the subsystems. Hence, the observers (and their design) are fully distributed which is at the cost of a sufficiently large number of interior measurements in each subsystem.

Analogously to Corollary 4.24, Corollary 4.26 shows that for nonlinear interconnected systems with known interactions between subsystems, the design of the centralized observers from Theorem 4.19 translates into the design of a distributed observer. This claim is not restricted to the observer design from Theorem 4.19 but applies to many observer designs from the literature, see Section 4.1. Although this result is intuitive, it was not explicitly stated in the literature yet. The key is that known interaction variables imply the inputs and outputs of the local models to be known. Hence, based on the subsystem models, we can design distributed independently. To this end, the observer existence condition has to be fulfilled for each subsystem, e.g., by a suitable partitioning of the system into subsystems and/or an appropriate sensor placement.

It is noteworthy that, in general, the distributed observers resulting from corollaries 4.24 and 4.26 cannot be extracted from a centralized observer of the system. This can be explained by the fact that a local model of a subsystem is in general not equal to the corresponding submodel of a centralized model. For example, in Section 5.3, we consider an interconnected system in which the local models have feedthrough while the global model has not.

A natural limitation of the deterministic observer methods from this chapter is that they do not explicitly consider uncertainties. An analysis of the influence of measurement noise to the observers from this chapter will be provided in the numerical simulations that follow in Chapter 5.

Let us conclude the discussion of this section. For linear PHSs with unknown inputs, states, and outputs, we can design asymptotic observers in an automated manner. Moreover, for an important class of nonlinear PHSs we developed an approach to derive globally exponentially convergent observers directly from the system model. The observer methods can be also applied for an automated design of distributed observers based on local model knowledge.

## 4.4 Summary and Contributions

The extent of interconnected systems hampers a manual or partially computeraided observer design. Existing automatable observer design techniques are purely numeric and disregard the physical background of a system. This chapter addressed this research gap by presenting methods and algorithms for an automated design of observers for PHSs. The original contributions of this research are:


(C2.3) two automated designs of distributed observers (corollaries 4.24 and 4.26) based on local model knowledge which are obtained from a reconsideration of the methods from C2.1 and C2.2.

The presented techniques are the first to enable an automated design of observers for a considerable class of PHSs and therewith reach research objective O2 from Section 1.3. The automated observer design methods were demonstrated for a linear and a nonlinear example system. Numerical simulations verified the convergence of the obtained observers.

# Chapter 5

## Proof of Principle

The aim of this thesis is to show that for a large class of interconnected systems the process of deriving explicit state-space models and the process of designing observers can be automated. This chapter provides a proof of principle towards this endeavor. To this end, in Section 5.1 the methods from the previous two chapters are integrated in a software prototype. The prototype enables an automated generation of models and observers for interconnected systems. In Section 5.2 and Section 5.3, the prototype is applied to two example systems, viz. an unbalanced power distribution system and a large-scale nonlinear system, respectively. The validity of the obtained models and observers is analyzed through numerical simulations. The proof of principle ends with a discussion and a summary of the contributions in Section 5.4 and Section 5.5, respectively.

## 5.1 Software Prototype

The prototype is named AMOTO which is an acronym for automatic model generation and observer design tool. AMOTO implements the methods from Chapter 3 (viz. algorithms 3.36 and 3.48) and Chapter 4 (viz. Algorithm 4.10 and Theorem 4.19). The development of AMOTO started in 2018. The first version of the program has been presented in Pfeiffer et al. [2019]. The current version is 1.1.4. The core of the tool is implemented in the Wolfram language. Hence, the main calculations are performed by the Mathematica kernel. A graphical user interface (GUI) for AMOTO was developed in Java. The Wolfram J/Link interface enables the communication between the Java GUI and the Mathematica core. AMOTO requires Wolfram Mathematica version 11 and Java runtime version 8 or respective later versions.

The workflow in AMOTO is as follows. First, the user enters a bond graph representation of the interconnected system under consideration. The constitutive relations of the bond graph elements are entered symbolically or numerically. Moreover, we specify in the bond graph model which variables are available for measurement. To this end, bond graph variables can be set to "measured". This step is optional and only required if we aim at an automated observer design.

Based on the bond graph model, the user can start the model generation in which AMOTO derives an explicit port-Hamiltonian model. The calculation runs fully automatic. After the calculation, the resulting PHS is displayed to the user. Afterwards, we may run the automated observer design. The obtained observer equations are also displayed to the user.

AMOTO features an export function in which the obtained models and observers can be written to external files in the formats of Mathematica, MATLAB, and LATEX. This facilitates subsequent steps in the development of models and observers as, e.g., their simulation, analysis, documentation and, finally, their implementation in the system under consideration.

Figure 5.1 summarizes the workflow for the development of models and observers with AMOTO.

**Figure 5.1:** Illustration of the workflow with the software prototpye AMOTO

Figure 5.2 depicts the AMOTO GUI. The GUI consists of a menu bar, a graph panel, a type list, an element list, an element panel, a tool bar, and a log panel. In the sequel, the different parts of the GUI are briefly described.

**Figure 5.2:** Screenshot of the AMOTO GUI with labeling of the panels, bars, and lists in red


this element to another element by inserting a bond. Within the graph panel, elements and bonds can be moved with drag and drop. Elements and bonds can be deleted by right clicking on the corresponding instance and choosing "remove". Measurements can be specified by right clicking on a bond. For the selected bond, we then specify whether the flow, the effort or both are measured. Measurements of states are specified by right clicking on a C-type element and choosing the corresponding option.


For the export, one can choose between the file extensions <sup>∗</sup> .wl, ∗ .m, and ∗ .tex, i.e., file formats for Mathematica, MATLAB, and LATEX, respectively.

◦ *Log panel:* The log panel is used to document the session. The most important feature is that the log panel informs the user if any existence conditions are violated. Moreover, the log panel reports if there are problems with the program configuration.

This concludes the presentation of AMOTO. In the subsequent sections, AMOTO will be applied for the model generation and observer design in two interconnected systems.

## 5.2 Case Study 1: Unbalanced Distribution System

#### 5.2.1 Study Objectives

Distribution systems are the final stage in the delivery of electric power. The distribution level plays a crucial role for the decarbonization of electric energy. In the control-oriented power systems research, the distribution system is one of the hot topics often addressed under the names "Smart grid" or "Microgrid", see, e.g., Schiffer et al. [2016]; Simpson-Porco et al. [2017]; Strehle et al. [2019].

A distribution system is a multi-phase power system that operates on a medium to low voltage level. Compared to transmission systems, the treatment of distribution systems is more intricate as their voltages and currents are unbalanced [Kersting, 2017]. In many cases, a distribution system comprises a high number of buses and lines and therewith involves high dimensional variable spaces.

State estimation techniques are of key importance for the monitoring and control of a distribution system. The state estimators currently used in distribution system control centers rely on the assumption that the network is in quasi-steady state [Zhao et al., 2019]. The quasi-steady state assumption simplifies the design of a state estimator for the network to the derivation of a static weighted least squares (WLS) estimator. However, as the IEEE Task Force on Power System Dynamic State and Parameter Estimation recently pointed out, in reality, power systems never operate in quasi-steady state as there are continuous variations of generation and demand [Zhao et al., 2019]. The situation is aggravated by the recent changes in the distribution system, viz. the extensive

integration of distributed energy resources, complex loads, and demand-response technologies. In the distribution system, these changes induce faster transients and stronger harmonic distortions [IEEE Standards Association, 2014]. A WLSbased state estimator is unable to capture these transients and harmonics which motivates the development of new monitoring techniques.

Power system dynamic state estimation (PSDSE) is a promising approach to account for the recent changes in the distribution system. The survey papers from Primadianto and Lu [2017] and Zhao et al. [2019] outline the state of the art in PSDSE. In contrast to a WLS-based state estimation, PSDSE methods are based on a state-space dynamic model. Based on the dynamic model, an estimator is derived by designing a Luenberger observer, a Kalman filter, or extensions thereof. In existing PSDSE approaches, the system dynamics originate from a dynamic modeling of components that are connected to the network as for example synchronous generators or storage systems, see, e.g., Zhao et al. [2017]; Singh and Pal [2019]; Alhelou et al. [2019] and references therein. To our knowledge, in all existing approaches, the network is still described in quasi-steady state. In the literature, there are no previous reports on PSDSE approaches that reject the quasi-steady state assumption for the network.<sup>1</sup> In other words, the benefit of considering the network dynamics for the state estimation has been largely unexplored.

AMOTO is used to bridge this research gap. First, we derive a distribution system model which explicitly considers the line dynamics. Based on the model, we apply the automated observer design to generate a dynamic state estimator. The performance of the obtained model and estimator is analyzed through numerical simulations.

This study will demonstrate the capabilities of AMOTO. In particular, it will be shown that


<sup>1</sup>An exception is given by the class of transient state estimation methods, see, e.g., Watson and Yu [2008]. This class of methods, however, focuses on fault detection and isolation and cannot be used for a continuous system monitoring.

#### 5.2.2 System Description

Consider a three-phase unbalanced distribution system with *N* buses. The three phases are denoted by A, B, and C. *P* of the *N* buses are connected to higher-level systems. The remaining *<sup>N</sup>* <sup>−</sup> *<sup>P</sup>* buses are connected to *<sup>N</sup>* <sup>−</sup> *<sup>P</sup>* uncontrollable loads. Thereby, each load is connected to exactly one bus. The *N* buses are connected by *M* three-phase lines. As can be seen, such a distribution system is clearly an interconnected system in the sense of Term 2.3: the set of inner vertices *V*<sup>I</sup> contains the *N* buses; the set of boundary vertices V<sup>B</sup> contains the *P* higher-level systems and *<sup>N</sup>* <sup>−</sup>*<sup>P</sup>* loads; the set of inner edges <sup>B</sup><sup>I</sup> contains the *<sup>M</sup>* lines; and the set of boundary vertices B<sup>B</sup> contains the *N* (lossless) connections to the higher-level systems and loads. Let us assume that the open graph G = (V,B) with <sup>V</sup> <sup>=</sup> <sup>V</sup><sup>I</sup> <sup>∪</sup>V<sup>B</sup> and <sup>B</sup> <sup>=</sup> <sup>B</sup><sup>I</sup> <sup>∪</sup>B<sup>B</sup> is connected.

Figure 5.3a shows an exemplary distribution system with *N* = 33, *M* = 32, and *P* = 1. The depicted system is the well-known IEEE 33 Bus System from Baran and Wu [1989]. The nominal voltage of this system is 12.66 kV; the system frequency is 50 Hz. The open graph representation of the IEEE 33 Bus System is illustrated in Figure 5.3b.

#### 5.2.3 Bond Graph Model

This subsection presents a methodology for deriving a bond graph model of an unbalanced distribution system. To this end, we first describe the components of a distribution system separately. The overall distribution system model can then be obtained by assembling the component models. The component models are described in the following

A bus *<sup>i</sup>* <sup>∈</sup> <sup>V</sup><sup>I</sup> is modeled as ideal Kirchhoff node, i.e., a 0-junction. An element *<sup>i</sup>* <sup>∈</sup> <sup>V</sup><sup>B</sup> is modeled as three-phase voltage source, i.e., an Se-type element.<sup>2</sup> We describe an element *<sup>j</sup>* <sup>∈</sup> <sup>B</sup><sup>B</sup> as an ideal (lossless) connection, i.e., an ordinary power bond. Finally, a line *<sup>j</sup>* <sup>∈</sup> <sup>B</sup><sup>I</sup> is described by the <sup>π</sup>-section model in Figure 5.4. The π-section model considers phase resistances *Rk*, *<sup>j</sup>* , phase self inductances *Lk*,*k*, *<sup>j</sup>* and line-line mutual inductances *<sup>L</sup>k*,*l*, *<sup>j</sup>* where *<sup>k</sup>*,*<sup>l</sup>* ∈ {A,B,C}, *<sup>k</sup>* ̸<sup>=</sup> *<sup>l</sup>*. The latter are necessary as distribution lines are in general untransposed [Kersting, 2017, p. 79]. The resistances and inductances are collected in the following resistance

<sup>2</sup>The parameters of loads are constantly changing during system operation and are unknown for the state estimation [Kersting, 2017, p. 28]. Hence, we describe the loads by the voltages across them.

**Figure 5.3:** IEEE 33 Bus System: schematic diagram (a) and open graph representation (b)

**Figure 5.4:** π-section equivalent circuit of a three-phase distribution line

**Figure 5.5:** Bond graph representation of the π-section model from Figure 5.4

and inductance matrices:

$$\mathbf{R}\_{j} = \begin{pmatrix} R\_{A,j} & 0 & 0 \\ 0 & R\_{B,j} & 0 \\ 0 & 0 & R\_{C,j} \end{pmatrix}, \quad \text{and} \quad \mathbf{L}\_{j} = \begin{pmatrix} L\_{A,A,j} & L\_{A,B,j} & L\_{A,C,j} \\ L\_{A,B,j} & L\_{B,B,j} & L\_{B,C,j} \\ L\_{A,C,j} & L\_{B,C,j} & L\_{C,C,j} \end{pmatrix}, \tag{5.1}$$

respectively, with *<sup>j</sup>* <sup>∈</sup> <sup>B</sup>I. Figure 5.5 depicts the bond graph representation of the <sup>π</sup>-section model of line *<sup>j</sup>* <sup>∈</sup> <sup>B</sup><sup>I</sup> from Figure 5.4. The ports <sup>I</sup>1, *<sup>j</sup>* and <sup>I</sup>2, *<sup>j</sup>* are open ports for the interconnection to the incident buses.

By using the above component models, we may construct a bond graph model of an unbalanced distribution system. Figure 5.6 depicts the obtained bond graph model for the IEEE 33 Bus System from Figure 5.3. Note that each line model <sup>L</sup>*<sup>j</sup>* consists of a bond graph as depicted in Figure 5.5 (*<sup>j</sup>* <sup>∈</sup> <sup>B</sup>I).

**Figure 5.6:** IEEE 33 Bus System: bond graph model with measured variables highlighted in green

#### 5.2.4 Automated Model Generation

To demonstrate the automated model generation for the IEEE 33 Bus System, the bond graph from Figure 5.6 was entered into AMOTO. The system parameters were taken from Baran and Wu [1989].<sup>3</sup> Based on the entered bond graph, we then run the automated model generation of AMOTO. After approximately 19 seconds<sup>4</sup> , AMOTO outputs a linear PHS of the form

$$
\dot{\mathbf{x}} = -\mathbf{R}\mathbf{Q}\mathbf{x} + \mathbf{G}\mathbf{u},\tag{5.2a}
$$

$$\mathbf{y} = \mathbf{G}^{\top} \mathbf{Q} \mathbf{x},\tag{5.2b}$$

with *x* ∈ R <sup>96</sup> and *<sup>u</sup>*, *<sup>y</sup>* <sup>∈</sup> <sup>R</sup> 99 .

The complete model is far too large to be displayed in the format of this thesis. Hence, we focus on structural properties of the model.

The state vector consists of the magnetic flux linkages ψ of the *M* = 32 lines. Each line is described by three states, viz. the magnetic flux linkages of the phases A, B, and C. Hence, the overall number of states is <sup>3</sup> · <sup>32</sup> <sup>=</sup> <sup>96</sup> and the state vector is given by *x* = ((ψ)*k*)*<sup>j</sup>* for all *<sup>k</sup>* ∈ {A,B,C} and *<sup>j</sup>* <sup>∈</sup> <sup>B</sup>I.

The input vector of (5.2) consists of the <sup>3</sup> · <sup>33</sup> <sup>=</sup> <sup>99</sup> bus voltages, i.e., *<sup>u</sup>* <sup>=</sup> ((*V*)*<sup>k</sup>* ) *i* for all *<sup>k</sup>* ∈ {A,B,C} and *<sup>i</sup>* <sup>∈</sup> <sup>V</sup>I. The output vector contains the corresponding 99 bus currents, i.e., *y* = ((*I*)*<sup>k</sup>* ) *i* for all *<sup>k</sup>* ∈ {A,B,C} and *<sup>i</sup>* <sup>∈</sup> <sup>V</sup>I. These are the currents that flow between the buses on the one hand and the loads and higher level system on the other hand. As the bus voltages and currents are uncontrollable, the input vector is a pure disturbance vector; the output vector is the corresponding disturbance output vector.

The matrix *<sup>R</sup>* in (5.2) is given by *<sup>R</sup>* <sup>=</sup> blkdiag(*<sup>R</sup> <sup>j</sup>*) with *<sup>j</sup>* <sup>∈</sup> <sup>B</sup><sup>I</sup> where *<sup>R</sup> <sup>j</sup>* is from (5.1). Likewise, the matrix *Q* is a block diagonal matrix that contains the inverse matrices of the inductance matrices from (5.1), i.e., *Q* = blkdiag(*L* −1 *j* ). The matrix *<sup>G</sup>* is a sparse matrix. The non-zero entries in *<sup>G</sup>* appear in <sup>3</sup> <sup>×</sup> <sup>3</sup> diagonal blocks which are either diag(1,1,1) or <sup>−</sup>diag(1,1,1). The arrangement of the non-zero blocks reflects the incidence matrix of the connected subgraph G<sup>I</sup> = (VI,B*I*). The remaining PHS matrices *J*, *P*, *M*, and *S* are calculated to zero.

<sup>3</sup>Baran and Wu [1989] provide values only for the self-inductances of the lines. The ratio between the line self-inductances and the line-line mutual inductances is assumed to be 0.8.

<sup>4</sup>Calculated on a computer with Intel(R) Core(TM) i7-6600U CPU @ 2.60 GHz and 12 GB RAM.

#### 5.2.5 Automated Observer Design

To demonstrate the automated observer design of AMOTO for the IEEE 33 Bus System, we first define a set of measurement buses <sup>V</sup>*<sup>M</sup>* <sup>⊆</sup> <sup>V</sup>*I*. We assume the following buses to be equipped with measurement units:

$$\mathbb{V}\_M = \{2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 23, 25, 27, 29, 31, 33\}. \tag{5.3}$$

In each measurement bus *<sup>i</sup>* <sup>∈</sup> <sup>V</sup>*M*, sensors provide synchronized measurements of the three-phase network currents, i.e., the currents flowing through the incident lines. The load currents are assumed to be non-measured. For the entire system, we assume only one three-phase voltage measurement which is located at bus 2. This voltage measurement acts as reference for the voltage reconstructions. In Figure 5.6, the buses and quantities that are available for measurement are highlighted in green.

In the graph panel of AMOTO we enter the measurements to the bond graph by setting the appropriate efforts and flows to "measured". From the extended bond graph, AMOTO computes a measurement equation of the form *m*¯ = *Cy*¯ with *m*¯ ∈ R <sup>96</sup> and *<sup>C</sup>*¯ ∈ {0,−1} <sup>96</sup>×<sup>99</sup>. Based on the measurement equation and the model (5.2), AMOTO calculates an input-state-output observer of the form

$$
\dot{\mathbf{z}}\_{-}=\mathbf{Nz}, \quad \mathbf{z}|\_{t=0}=\mathbf{z}\_{0},\tag{5.4a}
$$

$$
\hat{\mathbf{x}}\_{-} = \mathbf{z} - \mathbf{E}\bar{\mathbf{m}},\tag{5.4b}
$$

$$
\hat{\boldsymbol{\mu}}\_2 = \left(\bar{\mathbf{C}} \mathbf{G}\_2\right)^+ \left(\dot{\mathbf{m}} + \bar{\mathbf{C}} \mathbf{R} \hat{\mathbf{x}} - \bar{\mathbf{C}} \mathbf{G}\_1 \boldsymbol{\mu}\_1\right),
\tag{5.4c}
$$

$$
\hat{\mathbf{y}}^{\perp} = \mathbf{G}^{\perp} \,\mathbf{Q} \hat{\mathbf{x}},\tag{5.4d}
$$

with *z* ∈ R <sup>96</sup>. The vectors *<sup>x</sup>*<sup>ˆ</sup> <sup>∈</sup> <sup>R</sup> <sup>96</sup> and *<sup>y</sup>*<sup>ˆ</sup> <sup>∈</sup> <sup>R</sup> <sup>99</sup> are reconstructions of the magnetic flux linkages of the lines and the bus currents, respectively. The vector *<sup>u</sup>*<sup>1</sup> <sup>∈</sup> <sup>R</sup> 3 contains the known inputs, i.e., the three-phase bus voltage at bus 2. The vector *u*ˆ <sup>2</sup> ∈ R <sup>96</sup> is a reconstruction of the unknown inputs, i.e., the three-phase bus voltages at the remaining buses. The matrices *G*<sup>1</sup> and *G*<sup>2</sup> can be obtained from splitting the matrix *G* from (5.2) according to the splitting of *u*.

The matrix *N* is calculated as a diagonal matrix. The diagonal values of *N* are negative and lie in the complex plane left to the eigenvalues of the matrix <sup>−</sup>*RQ* from (5.2). This is meaningful, as it ensures the error dynamics to be faster

than the system dynamics. The matrix *E* is a sparse matrix. The arrangement of the non-zero matrix blocks again reflects the incidence matrix of the connected subgraph G*<sup>I</sup>* = (V*I*,B*I*).

This concludes the presentation of the results obtained from the automated model generation and observer design of AMOTO for the IEEE 33 Bus System. Next, the obtained model and observer are validated through numerical simulations.

#### 5.2.6 Simulation Setup

The aim of the simulation study is (i) to evaluate the validity of the model (5.2) and the observer (5.4) and (ii) to compare the performance of the observer with the performance of a WLS-based estimation. It is interesting to note that we can use AMOTO to calculate a WLS estimator for (ii). The detailed derivation of a WLS estimator for the IEEE 33 Bus System with AMOTO is illustrated in Appendix D.1.

As a ground truth we use the verified MATLAB/Simulink time-domain simulation model of the IEEE 33 Bus System from Wong [2020]. By default, this simulation model describes a scenario in which the system is balanced and in quasi-steady state. Hence, to account for the recent changes in distribution systems, the model from Wong [2020] is modified in three points:


<sup>5</sup>This yields a total harmonic distortion of 5% which is within the range of an allowed total harmonic distortion [IEEE Standards Association, 2014].

From now on, we denote to the modified model from Wong [2020] as benchmark model. For the evaluation of the model and observer, first the benchmark model has been simulated which gives us time series for all bus voltages, bus currents, line currents, and line flux linkages. The bus voltages are the inputs of the model (5.2). Hence, based on the time-series of the bus voltages one may simulate (5.2). Likewise, the time-series of the variables from the vectors *m*¯ and *u*<sup>1</sup> obtained from the simulation of the benchmark model are collected. With these data one may simulate the observer (5.4).

All simulations were conducted in MATLAB/Simulink R2019a with a fixedstep solver at a simulation step size of 0.01 ms. The model, the observer, and the WLS estimator were written to MATLAB code by using the export function from AMOTO. The resulting files comprise more than 18000 lines of MATLAB code. The initial values of the models and the observer are chosen such that the simulation starts in quasi-steady state. The simulation time was set to *T* = 4s.

#### 5.2.7 Simulation Results

For the evaluation of the model (5.2) and observer (5.4) we use the relative error signal power (RESP).<sup>6</sup> For each signal obtained from the model and observer, an error signal based on the corresponding signal from the benchmark model is computed. The RESP is then the quotient of the signal power of the error signal and the signal power of the benchmark signal. Therewith, the RESP is a relative measure for the similarity of a signal to the corresponding benchmark signal. The formal definition of the RESP can be found in Appendix D.2.

First, we analyze the RESP of the bus currents that have been computed from the model (5.2) and the observer (5.4). Figure 5.7 shows the three-phase average RESP over the bus number for the model and the observer in blue and red, respectively. The underlying numerical data can be found in Table D.1 and Table D.2 in Appendix D.3.

As can be seen, for each of the buses the RESP of the model takes values equal or less than 0.25 %. Hence, we can say that the model (5.2) accurately reproduces the behavior of the benchmark model.<sup>7</sup> For the observer, we obtain

<sup>6</sup>Note that the deterministic, periodic nature of the signals obtained from the model (5.2) and observer (5.4) make the well-known similarity measures from statistics inappropriate for this study.

<sup>7</sup>The remaining difference between the models can be further decreased by choosing a smaller simulation step size.

5.2. Case Study 1: Unbalanced Distribution System 119

First, we analyze the RESP of the bus currents that have been computed from the model (5.2) and the observer (5.4). Figure 5.7 shows the three-phase average RESP over the bus number for the model and the observer in blue and red, respectively. The underlying

benchmark signal. The formal definition of the RESP can be found in Appendix D.2.

**Figure 5.7:** Three-phase average RESP of the bus currents for the model (5.2) (blue) and the observer (5.4) (red) **Figure 5.7:** Three-phase average RESP of the bus currents for the model (5.2) (blue) and the observer (5.4) (red)

As can be seen, for each of the buses the RESP of the model takes values equal or less than 0.25 %. Hence, we can say that the model (5.2) accurately reproduces the behavior of even smaller RESP values of less than 0.025 %. This can be explained by the observer error injection, which induces a robustness against model uncertainties.

the benchmark model.<sup>7</sup> For the observer, we obtain even smaller RESP values of less than 0.025 %. This can be explained by the observer error injection, which induces a robustness against model uncertainties. Figure 5.8 depicts the time courses of the three-phase bus current at bus 17 for the benchmark model (solid, green), the model (5.2) (dashed, blue) and the observer (5.4) (dotdashed, red) for the time between 1.95 s and 2.10 s. We can clearly identify the fundamental frequency of 50 Hz. Due to the load imbalance at phase B of bus 17, the amplitude of the current at phase B is slightly higher than the amplitudes for the currents at the phases A and C. At *t* = 2 s we can see the load jump in which the amplitude of the bus current increases approximately by the factor of 2. As can be seen, the model (5.2) and the observer (5.4) correctly reproduce the behavior of the benchmark model at this crucial point. Visually, we Figure 5.8 depicts the time courses of the three-phase bus current at bus 17 for the benchmark model (solid, green), the model (5.2) (dashed, blue) and the observer (5.4) (dotdashed, red) for the time between 1.95 s and 2.10 s. We can clearly identify the fundamental frequency of 50 Hz. Due to the load imbalance at phase B of bus 17, the amplitude of the current at phase B is slightly higher than the amplitudes for the currents at the phases A and C. At *t* = 2s we can see the load jump in which the amplitude of the bus current increases approximately by the factor of 2. As can be seen, the model (5.2) and the observer (5.4) correctly reproduce the behavior of the benchmark model at this crucial point. Visually, we cannot distinguish between the obtained currents.

cannot distinguish between the obtained currents. As an interim result, let us summarize that the model (5.2) accurately reflects the behavior of the benchmark model. Moreover, the observer (5.4) produces estimates that are very close to the values from the benchmark model. Hence, we can say that the observer is asymptotic. Next, we compare the simulation results of the observer (5.4) with the results obtained As an interim result, let us summarize that the model (5.2) accurately reflects the behavior of the benchmark model. Moreover, the observer (5.4) produces estimates that are very close to the values from the benchmark model. Hence, we can say that the observer is asymptotic.

for the WLS estimator (D.8). The RESPs for all bus voltage signals are given in Table D.3 and Table D.4 in Appendix D.3. For the observer, the mean RESP over all reconstructed bus <sup>7</sup>The remaining difference between the models can be further decreased by choosing a smaller simulation step size. Next, we compare the simulation results of the observer (5.4) with the results obtained for the WLS estimator (D.8). The RESPs for all bus voltage signals are given in Table D.3 and Table D.4 in Appendix D.3. For the observer, the mean RESP over all reconstructed bus voltages is <sup>1</sup>.5×10−<sup>3</sup> % (standard deviation: <sup>9</sup>.2×10−<sup>4</sup> %). The respective value for the WLS estimator is <sup>5</sup>.1 % (standard deviation: <sup>6</sup>.3×10−<sup>2</sup> %). Hence, the observer significantly outperforms the WLS estimator. This can be explained by two reasons.

First, the WLS estimator cannot capture the harmonic distortion. This is illustrated in Figure 5.9 which shows one oscillation period of the voltage at phase A of bus 17 starting from 2 s. In contrast to the WLS estimator (dotdashed,

**Figure 5.8:** Bus current at bus 17 for the benchmark model (solid, green), the model (5.2) (dashed, blue) and the observer (5.4) (dotdashed, red) for the time between 1.95 s and 2.10 s **Figure 5.8:** Bus current at bus 17 for the benchmark model (solid, green), the model (5.2) (dashed, blue) and the observer (5.4) (dotdashed, red) for the time between 1.95 s and 2.10 s

voltages is <sup>1</sup>.5×10−<sup>3</sup> % (standard deviation: <sup>9</sup>.2×10−<sup>4</sup> %). The respective value for the WLS estimator is <sup>5</sup>.1 % (standard deviation: <sup>6</sup>.3×10−<sup>2</sup> %). Hence, the observer significantly outperforms the WLS estimator. This can be explained by two reasons. brown) the observer (dashed, red) is able to reconstruct the harmonic distortion from the benchmark model (solid, green).

First, the WLS estimator cannot capture the harmonic distortion. This is illustrated in Figure 5.9 which shows one oscillation period of the voltage at phase A of bus 17 starting from 2 s. In contrast to the WLS estimator (dotdashed, brown) the observer (dashed, red) is able to reconstruct the harmonic distortion from the benchmark model (solid, green). Second, the WLS estimator cannot deal with abrupt changes in the load. This is shown in Figure 5.10 which depicts the estimated bus current for phase A of bus 17 between 1.95 s Second, the WLS estimator cannot deal with abrupt changes in the load. This is shown in Figure 5.10 which depicts the estimated bus current for phase A of bus 17 between 1.95 s and 2.1 s. As can be seen, the WLS estimator (dotdashed, brown) requires about four periods to reach the amplitude of the current computed by the observer (dashed, red) and benchmark model (solid, green). Naturally, such errors in the bus current lead to an increase of the voltage RESP.

and 2.1 s. As can be seen, the WLS estimator (dotdashed, brown) requires about four periods to reach the amplitude of the current computed by the observer (dashed, red) and benchmark model (solid, green). Naturally, such errors in the bus current lead to an increase of the voltage RESP. In the last part of this case study, we now analyze the validity of the reconstructions from the observer and the WLS estimator under measurement noise. To this end, the measurement equation is extended by noise, i.e., *m*¯ = *Cy*¯ +ε where ε is vector-valued Gaussian random In the last part of this case study, we now analyze the validity of the reconstructions from the observer and the WLS estimator under measurement noise. To this end, the measurement equation is extended by noise, i.e., *m*¯ = *Cy*¯ +ε where ε is vector-valued Gaussian random process with zero mean and covariance matrix σ 2 *<sup>I</sup> <sup>q</sup>*¯, <sup>σ</sup> <sup>∈</sup> <sup>R</sup>≥<sup>0</sup>. The above simulations of the observer and the WLS estimator are then repeated on the basis of the noisy measurements.

10

in the WLS estimator.

**Figure 5.9:** Bus voltage at phase A of bus 17 for the benchmark model (solid, green), the observer (5.4) (dashed, red), and the WLS estimator (D.8) (dotdashed, brown) for the time between 2 s and 2.02 s **Figure 5.9:** Bus voltage at phase A of bus 17 for the benchmark model (solid, green), the observer (5.4) (dashed, red), and the WLS estimator (D.8) (dotdashed, brown) for the time between 2 s and 2.02 s **Figure 5.9:** Bus voltage at phase A of bus 17 for the benchmark model (solid, green), the observer (5.4) (dashed, red), and the WLS estimator (D.8) (dotdashed, brown) for the time between 2 s and 2.02 s

*t* in s

process with zero mean and covariance matrix σ 2 *I <sup>q</sup>*¯, σ ∈ R≥0. The above simulations of the observer and the WLS estimator are then repeated on the basis of the noisy measurements. **Figure 5.10:** Bus current at phase A of bus 17 for the benchmark model (solid, green), the observer (5.4) (dashed, red), and the WLS estimator (D.8) (dotdashed, brown) for the time between 1.95 s and 2.1 s **Figure 5.10:** Bus current at phase A of bus 17 for the benchmark model (solid, green), the observer (5.4) (dashed, red), and the WLS estimator (D.8) (dotdashed, brown) for the time between 1.95 s and 2.1 s

The results are depicted in Figure 5.11. The figure shows the mean RESPs of the

σ

2

σ

(dashed, red), and the WLS estimator (D.8) (dotdashed, brown) for the time between 1.95 s and 2.1 s

reconstructed bus voltages for the observer (5.4) (red) and the WLS estimator (D.8) (brown) for different noise variances σ 2 . For the six considered noise variances 10−<sup>5</sup> , 10−<sup>4</sup> , 10−<sup>3</sup> 10−<sup>2</sup> , 10−<sup>1</sup> , and 10<sup>0</sup> , the mean signal-to-noise ratios (SNRs) over all measurement signals is given by 98.0 dB, 86.5 dB, 75.0 dB, 63.4 dB, 51.9 dB, and 40.4 dB, respectively. As seen, starting on a low level, the mean RESP of the reconstructions from the observer increases with increasing noise variance. In contrast, the RESPs of the WLS estimator are almost constant over the different noise variances. Figure 5.11 shows that for a variance smaller or equal to 10−<sup>2</sup> (i.e., an SNR≥ 63.4 dB), the observer gives adequate reconstructions which have a significantly lower mean RESP than the reconstructions obtained from the WLS estimator. However, an increasing noise process with zero mean and covariance matrix *I q*¯ , ∈ R≥0. The above simulations of the observer and the WLS estimator are then repeated on the basis of the noisy measurements. The results are depicted in Figure 5.11. The figure shows the mean RESPs of the reconstructed bus voltages for the observer (5.4) (red) and the WLS estimator (D.8) (brown) for different noise variances σ 2 . For the six considered noise variances 10−<sup>5</sup> , 10−<sup>4</sup> , 10−<sup>3</sup> 10−<sup>2</sup> , 10−<sup>1</sup> , and 10<sup>0</sup> , the mean signal-to-noise ratios (SNRs) over all measurement signals is given by 98.0 dB, 86.5 dB, 75.0 dB, 63.4 dB, 51.9 dB, and 40.4 dB, respectively. As seen, starting on a low level, the mean RESP of the reconstructions from the observer increases with increasing noise variance. In contrast, the RESPs of the WLS estimator are almost constant over the different noise variances. The results are depicted in Figure 5.11. The figure shows the mean RESPs of the reconstructed bus voltages for the observer (5.4) (red) and the WLS estimator (D.8) (brown) for different noise variances σ 2 . For the six considered noise variances 10−<sup>5</sup> , 10−<sup>4</sup> , 10−<sup>3</sup> , 10−<sup>2</sup> , 10−<sup>1</sup> , and 10<sup>0</sup> , the mean signal-to-noise ratios (SNRs) over all measurement signals is given by 98.0 dB, 86.5 dB, 75.0 dB, 63.4 dB, 51.9 dB, and 40.4 dB, respectively. As seen, starting on a low level, the mean RESP of the reconstructions from the observer increases with increasing noise variance. In contrast, the RESPs of the WLS estimator are almost constant over the different noise variances.

level leads to an increasing deterioration of the reconstructions from the observer. In contrast, the WLS estimator remains almost unaffected by the measurement noise. This can be explained by the smoothing property of the phase-locked loops for the phasor computation in the WLS estimator. Figure 5.11 shows that for a variance smaller or equal to 10−<sup>2</sup> (i.e., an SNR≥ 63.4 dB), the observer gives adequate reconstructions which have a significantly lower mean RESP than the reconstructions obtained from the WLS estimator. However, an increasing noise level leads to an increasing deterioration of the reconstructions from the observer. In con-Figure 5.11 shows that for a variance smaller or equal to 10−<sup>2</sup> (i.e., an SNR<sup>≥</sup> <sup>63</sup>.4dB), the observer gives adequate reconstructions which have a significantly lower mean RESP than the reconstructions obtained from the WLS estimator. However, an increasing noise level leads to an increasing deteriora-

trast, the WLS estimator remains almost unaffected by the measurement noise. This can be explained by the smoothing property of the phase-locked loops for the phasor computation

,

,

**Figure 5.11:** Mean RESPs over all voltages from the reconstructions of the observer (5.4) (red) and the WLS estimator (D.8) (brown) for different noise variances σ 2 **Figure 5.11:** Mean RESPs over all voltages from the reconstructions of the observer (5.4) (red) and the WLS estimator (D.8) (brown) for different noise variances σ 2

In conclusion, the observer (5.4) captures harmonic distortion and thus allows for a busspecific power quality assessment, e.g., to identify critical loads. Moreover, the algorithm immediately detects fast transients which is an important prerequisite for the application of new primary control schemes in low-inertia power systems (cf. Milano et al. [2018] and Strehle et al. [2019]). Therewith, the proposed observer extends the functionalities of a tion of the reconstructions from the observer. In contrast, the WLS estimator remains almost unaffected by the measurement noise. This can be explained by the smoothing property of the phase-locked loops for the phasor computation in the WLS estimator.

classical WLS-based power system state estimation. The basis for these functionalities are measurements with a low to moderate SNR. Provided such measurements are available, the proposed observer is a promising approach to deal with the challenges in the supervision of future power systems. 5.3 Case Study 2: Large-Scale Nonlinear System 5.3.1 Study Objectives In conclusion, the observer (5.4) captures harmonic distortion and thus allows for a bus-specific power quality assessment, e.g., to identify critical loads. Moreover, the algorithm immediately detects fast transients which is an important prerequisite for the application of new primary control schemes in low-inertia power systems (cf. Milano et al. [2018] and Strehle et al. [2019]). Therewith, the proposed observer extends the functionalities of a classical WLS-based power system state estimation. The basis for these functionalities are measurements with a low to moderate SNR. Provided such measurements are available, the proposed observer is a promising approach to deal with the challenges in the supervision of future power systems.

#### Compared to the previous subsection, we now turn our attention to a nonlinear system. We consider an interconnected system of academic nature which features nonlinearities in both, the interconnection structure and storages. Based on the system, it will be shown that 5.3 Case Study 2: Large-Scale Nonlinear System

#### ◦ AMOTO is able to automatically generate global and local models of a nonlinear interconnected system; 5.3.1 Study Objectives

noise.

◦ AMOTO can be used to derive a centralized and a distributed observer based on local and global model knowledge, respectively; ◦ in numerical simulations, the centralized and the distributed observer obtained from AMOTO yield asymptotic reconstructions of the unknown system variables. Compared to the previous subsection, we now turn our attention to a nonlinear system. We consider an interconnected system of academic nature which features nonlinearities in both, the interconnection structure and storages. Based on the system, it will be shown that

Moreover, we will discuss the convergence of the observers in the presence of measurement

**Figure 5.12:** Large-scale nonlinear interconnected system


Moreover, we will discuss the convergence of the observers in the presence of measurement noise.

#### 5.3.2 System Description

Let us consider the interconnected system from Figure 5.12. The system consists of 15 subsystems <sup>V</sup>*<sup>s</sup>* <sup>=</sup> {1,...,15} and five zero junctions <sup>V</sup><sup>0</sup> <sup>=</sup> {01,...,05}. Following Definition 2.1, the set of inner vertices is given by <sup>V</sup><sup>I</sup> <sup>=</sup> <sup>V</sup>*<sup>s</sup>* <sup>∪</sup>V0. The 20 inner vertices are connected by 20 inner edges <sup>B</sup><sup>I</sup> <sup>=</sup> {*I*1,...,*I*20}. The system contains four boundary vertices <sup>V</sup><sup>B</sup> <sup>=</sup> {Sf1,...,Sf4} which determine the flow variables at the system boundary. The boundary vertices are connected to the subsystems *<sup>j</sup>* <sup>=</sup> <sup>1</sup>,10,12,15 by four boundary edges <sup>B</sup><sup>B</sup> <sup>=</sup> {*B*1,*B*2,*B*3,*B*4}.

Each subsystem *<sup>j</sup>* <sup>∈</sup> <sup>V</sup>*<sup>s</sup>* consists of a four-dimensional bond graph as depicted in Figure 5.13. The bond graph contains two energy-storing elements with the

**Figure 5.13:** Interior structure of the subsystems *<sup>j</sup>* <sup>∈</sup> <sup>V</sup>*<sup>s</sup>* from Figure 5.12

following storage functions

$$V\_{1,j}(\mathbf{x}\_{1,j}) = \frac{1}{2} \mathbf{x}\_{1,j}^\top \mathbf{Q}\_{1,j} \mathbf{x}\_{1,j} + \frac{||\mathbf{x}\_{1,j}||^4}{||\mathbf{x}\_{1,j}||^2 + \cos\left(||\mathbf{x}\_{1,j}||^2 + 1\right)},\tag{5.5a}$$

$$V\_{2,j}(\mathbf{x}\_{2,j}) = \frac{1}{2} \mathbf{x}\_{2,j}^{\top} \mathbf{Q}\_{2,j} \mathbf{x}\_{2,j},\tag{5.5b}$$

where *x*1, *<sup>j</sup>*, *x*2, *<sup>j</sup>* ∈ R <sup>4</sup> and *Q*1, *<sup>j</sup>* ,*Q*2, *<sup>j</sup>* ∈ R 4×4 symmetric, positive-definite matrices (*<sup>j</sup>* <sup>∈</sup> <sup>V</sup>*s*). The two energy-dissipating elements are specified by the symmetric, positive-definite matrices *<sup>D</sup>*1, *<sup>j</sup>*,*D*2, *<sup>j</sup>* <sup>∈</sup> <sup>R</sup> 4×4 (*<sup>j</sup>* <sup>∈</sup> <sup>V</sup>*s*). The junction structure consists of a 1-junction, a 0-junction, and a state-modulated transformer with transformation ratio

$$\mathcal{U}\_j(\mathfrak{x}\_{1,j}) = \exp\left(\text{diag}\left(\mathfrak{x}\_{1,j}\right)\right) \in \mathbb{R}^{4 \times 4},\tag{5.6}$$

where exp(·) is the matrix exponential (*<sup>j</sup>* <sup>∈</sup> <sup>V</sup>*s*). The port <sup>I</sup> is an open port for the connection to the inner edges. Likewise, the port B is an open port for the connection to boundary edges and hence only relevant for the subsystems *j* = 1,10,12,15.

#### 5.3.3 Automated Model Generation

This subsection initially presents a global model obtained from AMOTO for the system depicted in Figure 5.12. Afterwards, a local model for the subsystems *j* ∈ V*<sup>s</sup>* is described.

#### Global Model

For the global model, we first set up a bond graph model of the overall system. To this end, we substitute the subsystems *<sup>j</sup>* <sup>∈</sup> <sup>V</sup>*<sup>s</sup>* in Figure 5.12 by their bond graph representation from Figure 5.13. The resulting overall bond graph is entered into AMOTO. The dissipation matrices *D*1, *<sup>j</sup>*,*D*2, *<sup>j</sup>* are specified with the numerical values as given in Appendix D.4 (*<sup>j</sup>* <sup>∈</sup> <sup>V</sup>*s*).

AMOTO outputs a nonlinear PHS of the form

$$
\dot{\mathbf{x}} = -\mathbf{R}(\mathbf{x'}) \frac{\partial H}{\partial \mathbf{x}} + \mathbf{G} \mathbf{u},
\tag{5.7}
$$

$$\mathbf{y} = \mathbf{G}^{\top} \frac{\partial H}{\partial \mathbf{x}},\tag{5.8}$$

with *x* ∈ R <sup>120</sup> and *<sup>u</sup>*, *<sup>y</sup>* <sup>∈</sup> <sup>R</sup> 16 .

The vector *x* ′ ∈ R <sup>60</sup> is the subvector of *x* which contains the states of the storage elements with the storage functions *V*1, *<sup>j</sup>*, i.e., *x* ′ = (*x*1, *<sup>j</sup>*) for all *<sup>j</sup>* <sup>∈</sup> <sup>V</sup>*<sup>s</sup>* . The input vector consists of the flows that are determined by the boundary vertices, i.e., *u* = (*f* <sup>B</sup>,*<sup>i</sup>* ) for *<sup>i</sup>* <sup>∈</sup> <sup>B</sup>B. The output vector contains the conjugated variables, i.e., the efforts, and is thus given by *<sup>y</sup>* = (*e*B,*i*) for *<sup>i</sup>* <sup>∈</sup> <sup>B</sup>B.

The Hamiltonian in (5.7) is the sum of the individual storage functions from (5.5):

$$H\left(\mathbf{x}\right) = \sum\_{j=1}^{15} \left( V\_{1,j}(\mathbf{x}\_{1,j}) + V\_{2,j}(\mathbf{x}\_{2,j}) \right). \tag{5.9}$$

The matrix *R*(*x* ′ ) consists of <sup>30</sup>×<sup>30</sup> non-zero blocks of the size <sup>4</sup>×4. This reveals the damping of the energy-dissipating elements to act across subsystem boundaries. On the other hand, *R*(*x* ′ ) neither reflects the incidence nor the adjacency relations of the subsystems or alike. In contrast, the matrix *G* is a sparse matrix in which the only non-zero blocks are four identity matrices *I* <sup>4</sup>. These identity matrices are located in the lines corresponding to *x*˙2, *<sup>j</sup>* for

*j* = 1,10,12,15. This makes the matrix *G* transparent with respect to the system structure. The remaining matrices of the PHS are calculated to zero.

#### Local Model

Next we use AMOTO to derive a local model of the subsystems *<sup>j</sup>* <sup>∈</sup> <sup>V</sup>*<sup>s</sup>* . To this end, the bond graph from Figure 5.13 is entered into AMOTO and the automated model generation is executed.<sup>8</sup> From this, we obtain the following PHS for subsystem *j* ∈ V*<sup>s</sup>* :

$$\underbrace{\frac{\mathbf{d}}{\mathbf{d}t}\underbrace{\begin{pmatrix}\mathbf{x}\_{1,j}\\ \mathbf{x}\_{2,j}\end{pmatrix}}\_{=\mathbf{x}\_{j}}}=-\underbrace{\begin{pmatrix}\mathbf{0}&\mathbf{0}\\ \mathbf{0}&\mathbf{D}\_{2,j}\end{pmatrix}}\_{=\mathbf{R}\_{j}}\underbrace{\frac{\partial H\_{j}}{\partial \mathbf{x}\_{j}}}\_{=\mathbf{R}\_{j}}(\mathbf{x}\_{j})+\underbrace{\begin{pmatrix}\mathbf{0}&\mathbf{I}\\ \mathbf{I}&\mathbf{U}(\mathbf{x}\_{1,j})\end{pmatrix}}\_{=\mathbf{G}\_{j}(\mathbf{x}\_{1,j})}\underbrace{\begin{pmatrix}\mathbf{f}\_{\mathcal{R},j}\\ \mathbf{f}\_{\mathcal{J},j}\end{pmatrix}}\_{=\mathbf{u}\_{j}},\tag{5.10a}$$

$$\underbrace{\begin{pmatrix}\mathbf{e}\_{\mathcal{R},j}\\ \mathbf{e}\_{\mathcal{J},j}\end{pmatrix}}\_{=\mathbf{y}\_{j}}=\underbrace{\begin{pmatrix}\mathbf{0}&\mathbf{I}\\ \mathbf{I}&\mathbf{U}(\mathbf{x}\_{1,j})\end{pmatrix}}\_{=\mathbf{G}\_{j}^{\top}(\mathbf{x}\_{1,j})}\underbrace{\frac{\partial H\_{j}}{\partial \mathbf{x}\_{j}}(\mathbf{x}\_{j})}\_{=\mathbf{S}\_{j}}+\underbrace{\begin{pmatrix}\mathbf{0}&\mathbf{0}\\ \mathbf{0}&\mathbf{D}\_{1,j}^{-1}\end{pmatrix}}\_{=\mathbf{u}\_{j}}\underbrace{\begin{pmatrix}\mathbf{f}\_{\mathcal{R},j}\\ \mathbf{f}\_{\mathcal{J},j}\end{pmatrix}}\_{=\mathbf{u}\_{j}},\tag{5.10b}$$

where *u*, *x*, *y* ∈ R <sup>8</sup> and *Hj*(*x <sup>j</sup>*) = *V*1, *<sup>j</sup>*(*x*1, *<sup>j</sup>*) +*V*2, *<sup>j</sup>*(*x*2, *<sup>j</sup>*) with the storage functions from (5.5). As can be seen, the PHS is passive but not strictly passive (cf. Proposition 2.26). Moreover, in contrast to the global model, the local model has feedthrough. Keep in mind that the input *f* <sup>B</sup>, *<sup>j</sup>* is only relevant for the subsystems *j* = 1,10,12,15. For the remaining subsystems, the input *f* <sup>B</sup>, *<sup>j</sup>* can be neglected.

#### 5.3.4 Automated Observer Design

First, we apply AMOTO to design a centralized observer based on the global model. Subsequently, we use the local model to design a distributed observer.

#### Centralized Observer Based on the Global Model

Consider the global model (5.7). For the centralized observer design, suppose that *u* and *x* ′ are known. Hence, the measurement vector reads *m* = *x* ′ = *x*1, *<sup>j</sup>* for

<sup>8</sup>The open ports B and I of the bond graph in Figure 5.13 are terminated with two Sf-type elements as AMOTO does not allow for open ports.

*j* ∈ V*<sup>s</sup>* . In AMOTO, we set the variables from *u* and *x* ′ to "measured" and execute the automated observer design. The program first calculates a measurement equation of the form (4.31):

$$\mathbf{m} = \mathbf{x}' = \underbrace{\begin{pmatrix} \mathbf{Q}\_{1,1}^{-1} & \mathbf{0} & \mathbf{0} & \mathbf{0} & \mathbf{0} & \mathbf{0} & \dots \\ \mathbf{0} & \mathbf{0} & \mathbf{Q}\_{1,2}^{-1} & \mathbf{0} & \mathbf{0} & \mathbf{0} & \dots \\ \mathbf{0} & \mathbf{0} & \mathbf{0} & \mathbf{0} & \mathbf{Q}\_{1,3}^{-1} & \mathbf{0} & \dots \\ \vdots & \vdots & \vdots & \vdots & \vdots & \ddots \end{pmatrix}}\_{=\mathbf{C} \in \mathbb{R}^{60 \times 120}} \mathbf{Q} \mathbf{x}, \tag{5.11}$$

where *Q* = blkdiag *Q*1, *<sup>j</sup>* ,*Q*2, *<sup>j</sup>* for all *<sup>j</sup>* <sup>∈</sup> <sup>V</sup>*<sup>s</sup>* . Moreover, AMOTO reports that the observer existence condition *R*(*x* ′ ) +*C* <sup>⊤</sup>*C* is met (cf. Theorem 4.19). The obtained centralized nonlinear state-output observer reads

$$\dot{\hat{\mathbf{x}}} = -\mathbf{R}(\mathbf{x}')\frac{\partial H}{\partial \mathbf{x}}(\hat{\mathbf{x}}) + \mathbf{G}\mathbf{u} + \alpha \mathbf{C}^\top \left(\mathbf{m} - \mathbf{C}Q\hat{\mathbf{x}}\right),\tag{5.12a}$$

$$
\hat{\mathbf{y}} = \mathbf{G}^{\top} \frac{\partial H}{\partial \mathbf{x}}(\hat{\mathbf{x}}),
\tag{5.12b}
$$

where *x*ˆ ∈ R 120 , *y*ˆ ∈ R <sup>16</sup>. The parameter <sup>α</sup> <sup>∈</sup> <sup>R</sup>><sup>0</sup> is a convergence parameter (see Remark 4.18).

#### Distributed Observer Based on the Local Model

Now consider the local model (5.10). For the design of a distributed observer, assume *<sup>u</sup> <sup>j</sup>* and *<sup>x</sup>*1, *<sup>j</sup>* to be known (*<sup>j</sup>* <sup>∈</sup> <sup>V</sup>*s*). Note that from a global point of view we have now more known variables than for the centralized observer. In the local bond graph model in AMOTO, the variables *u <sup>j</sup>* and *x*1, *<sup>j</sup>* are set to "measured". Afterwards, we run the automated observer design. AMOTO outputs the local measurement equation

$$\mathbf{m}\_{j} = \mathbf{x}\_{1,j} = \underbrace{\left(\mathbf{Q}\_{1,j}^{-1} \quad \mathbf{0}\right)}\_{=\mathbf{C}\_{j} \in \mathbb{R}^{4 \times 8}} \mathbf{Q}\_{j} \mathbf{x}\_{j}, \tag{5.13}$$

where *Q <sup>j</sup>* = blkdiag *Q*1, *<sup>j</sup>* ,*Q*2, *<sup>j</sup>* (*<sup>j</sup>* <sup>∈</sup> <sup>V</sup>*s*). The observer existence condition *R <sup>j</sup>* +*C* ⊤ *<sup>j</sup> <sup>C</sup> <sup>j</sup>* <sup>≻</sup> <sup>0</sup> is fulfilled for all *<sup>j</sup>* <sup>∈</sup> <sup>V</sup>*<sup>s</sup>* . The obtained state-output observer for the subsystems *<sup>j</sup>* <sup>∈</sup> <sup>V</sup>*<sup>s</sup>* read:

$$\dot{\hat{\mathbf{x}}}\_{j} = -\mathbf{R}\_{j} \frac{\partial H\_{j}}{\partial \mathbf{x}\_{j}}(\hat{\mathbf{x}}\_{j}) + \mathbf{G}\_{j}(\mathbf{x}\_{1,j})\boldsymbol{\mu}\_{j} + \alpha \mathbf{C}\_{j}^{\top} \left(\mathbf{m}\_{j} - \mathbf{C}\_{j} \mathbf{Q}\_{j} \hat{\mathbf{x}}\_{j}\right),\tag{5.14a}$$

$$
\hat{\mathbf{y}}\_{j} = \mathbf{G}\_{j}^{\top}(\mathbf{x}\_{1,j}) \frac{\partial H\_{j}}{\partial \mathbf{x}}(\hat{\mathbf{x}}\_{j}) + \mathbf{S}\_{j} \boldsymbol{\mu}\_{j},\tag{5.14b}
$$

where *x*ˆ *<sup>j</sup>*, *y*ˆ *<sup>j</sup>* ∈ R <sup>8</sup> and <sup>α</sup> <sup>∈</sup> <sup>R</sup>><sup>0</sup>. All subsystem observers (5.14) together form the distributed observer.

#### 5.3.5 Simulation Setup

The objective of the simulation study is to analyze the convergence of the reconstructions produced by the centralized and distributed observer. To this end, the global model (5.7), the centralized observer (5.12), and the distributed observer (5.14) are exported to MATLAB/Simulink. It is noteworthy that the MATLAB code only for the nonlinear expression *R*(*x* ′ ) from (5.7) comprises about 5000 lines of MATLAB code.

For the simulation, the matrices *D*1, *<sup>j</sup>*, *D*2, *<sup>j</sup>*, *Q*1, *<sup>j</sup>* , and *Q*2, *<sup>j</sup>* are chosen as diagonal matrices. The diagonal entries were specified by random numbers between 0.1 and 10. The obtained matrices can be found in Appendix D.4. For the observers (5.12) and (5.14), the convergence parameter is set to α = 10.

For the specification of the input of the model (5.7), we split *<sup>u</sup>* <sup>∈</sup> <sup>R</sup> <sup>16</sup> into *u* = *u* ⊤ <sup>1</sup> *u* ⊤ <sup>2</sup> *u* ⊤ <sup>3</sup> *u* ⊤ 4 ⊤ . The subvectors *<sup>u</sup><sup>k</sup>* <sup>∈</sup> <sup>R</sup> <sup>4</sup> are chosen as

$$
\mu\_k = 100 \cdot \begin{pmatrix} 1 & 1 & 1 & 1 \end{pmatrix}^\top \text{pulse}\_{0.2s}^{\mathcal{G}\%}(t - t\_{0,k}), \tag{5.15}
$$

for *k* = 1,...,4. The function pulse*<sup>w</sup> T* (*t*) is a periodic pulse excitation of period *T* and pulse width *w*:

$$\text{pulse}\_T^w(t) = \begin{cases} 1, & (i-1)T \le t < (i-1+\omega)T, \quad i \in \mathbb{N}\_{\ge 1} \\ 0, & \text{otherwise}. \end{cases} \tag{5.16}$$

The initial state of the system (5.7) is set to *x*<sup>0</sup> = (2...2) <sup>⊤</sup> ∈ R <sup>120</sup>. The centralized observer (5.12) is initialized with *x*ˆ<sup>0</sup> = (1...1) <sup>⊤</sup> ∈ R <sup>120</sup>. Accordingly, the initial values of the distributed observer (5.14) are set to *x*ˆ0, *<sup>j</sup>* = (1...1) <sup>⊤</sup> ∈ R 8 for *j* ∈ V*<sup>s</sup>* .

The simulation was carried out in MATLAB / Simulink R2019a by using the automatic variable-step solver selection from Simulink. The simulation time was set to 20 seconds.

#### 5.3.6 Simulation Results

In order to analyze the convergence of the centralized and the distributed observer let us introduce a variable *t*δ,*<sup>i</sup>* . Consider a state *x<sup>i</sup>* and a corresponding reconstruction *<sup>x</sup>*ˆ*i*. For a constant <sup>δ</sup> <sup>∈</sup> <sup>R</sup>><sup>0</sup>, the time *<sup>t</sup>*δ,*<sup>i</sup>* is defined as the smallest time *<sup>t</sup>* <sup>≥</sup> <sup>0</sup> such that <sup>|</sup>*x<sup>i</sup>* <sup>−</sup>*x*ˆ*i*<sup>|</sup> <sup>&</sup>lt; <sup>δ</sup> for all *<sup>t</sup>* <sup>&</sup>gt; *<sup>t</sup>*δ,*<sup>i</sup>* . The time *t*δ,*<sup>i</sup>* is hence a measure for the advance of the convergence of a reconstruction towards the true state. In the sequel, we set δ = 0.01.

Figure 5.14 shows the values of *t*0.01,*<sup>i</sup>* for the *i* = 1,...,120 states as obtained from the centralized observer (5.12) (red) and the distributed observer (5.14) (brown). The corresponding numerical data can be found in Appendix D.5. For both observers, in the majority of states, the time *t*0.01,*<sup>i</sup>* is smaller than one second (see lowest help line in Figure 5.14). For some states, *t*0.01,*<sup>i</sup>* is higher than 1 s but still less than 5 s, e.g., for *i* = 32,64,78. An outlier is given for the 87th state from the distributed observer by *<sup>t</sup>*0.01,<sup>87</sup> <sup>≈</sup> <sup>12</sup>.8s. This outlier can be explained by two reasons: (i) the state *x*<sup>87</sup> is subject to a weak natural damping (see the third element in the matrix *D*2,<sup>11</sup> in Appendix D.4); (ii) the error injection in the observer has no access to this observer state. The centralized observer is robust against (i) as it makes use of the damping of all subsystems and not only of one single subsystem (cf. matrix *R*(*x* ′ ) in (5.7)). From Figure 5.14 we can also see that none of the observers outperforms the other over all states. This might be unintuitive at a first glance as a centralized observer is usually expected to produce better results as a distributed observer. However, this does not apply in our case as the distributed observer has more known variables available than the centralized observer.

Figure 5.15 depicts the time courses of the first, fifth, and 32nd state of the model (5.7), the centralized observer (5.12), and the distributed observer (5.14), respectively. The reconstructions of the first and fifth state quickly converge to the true values. The convergence of the 32nd state is slower which confirms the corresponding value from Figure 5.14.

128 Chapter 5. Proof of Principle

our case as the distributed observer has more known variables available than the centralized

**Figure 5.14:** Time *t*δ,*i* for δ = 0.01 over the state number *i* for the centralized and distributed observer **Figure 5.14:** Time *t*δ,*<sup>i</sup>* for δ = 0.01 over the state number *i* for the centralized and distributed observer

Figure 5.15 depicts the time courses of the first, fifth, and 32nd state of the model (5.7), the centralized observer (5.12), and the distributed observer (5.14) in solid blue, dashed red, and dashdotted brown, respectively, for the time between 0 s and 1 s. As can be seen, the reconstructions of the first and fifth state quickly converge to the true values. The convergence of the 32nd state is slower which confirms the corresponding value from Figure 5.14. Finally, let us discuss the convergence of the observers under the influence of measurement noise. To this end, a zero-mean Gaussian white noise is added to the measurements. Afterwards, the simulations of the centralized observer (5.12) and the distributed observer (5.14) are rerun on the basis of the noisy measurements.

Finally, let us discuss the convergence of the observers under the influence of measurement noise. To this end, a zero-mean Gaussian white noise is added to the measurements. Afterwards, the simulations of the centralized observer (5.12) and the distributed observer (5.14) are rerun on the basis of the noisy measurements. The simulation setup and the results are described in Appendix D.6. It turns out that those observer states whose convergence is ascribed only to the natural damping of the system remain unaffected by the measurement noise. In contrast, observer states which are influenced by the measurement error injection lose the property of asymptotic convergence.What can be stated positively, however, is that these reconstructions reach with increasing time a tolerance band around the value of the variable to be reconstructed. The width of this tolerance The simulation setup and the results are described in Appendix D.6. It turns out that those observer states whose convergence is ascribed only to the natural damping of the system remain unaffected by the measurement noise. In contrast, observer states which are influenced by the measurement error injection lose the property of asymptotic convergence.What can be stated positively, however, is that these reconstructions reach with increasing time a tolerance band around the value of the variable to be reconstructed. The width of this tolerance band depends on the noise level. In practice, it has to be considered whether such a tolerance band is acceptable or if additional measures for noise suppression are to be implemented.

band depends on the noise level. In practice, it has to be considered whether such a toler-Let us conclude the insights from this subsection. AMOTO was shown to be able to generate a model, a centralized observer, and a distributed observer for a large-scale nonlinear system. The simulation results verify the theoretical result

**Figure 5.15:** System state *x<sup>i</sup>* from the model (5.7) and reconstructions *x*ˆ*<sup>i</sup>* from the centralized observer (5.12) and the distributed observer (5.14) for *i* = 1,5,32 and the time between 0 s and 1 s **Figure 5.15:** System state *x<sup>i</sup>* from the model (5.7) and reconstructions *x*ˆ*<sup>i</sup>* from the centralized observer (5.12) and the distributed observer (5.14) for *i* = 1,5,32 and the time between 0 s and 1 s

ance band is acceptable or if additional measures for noise suppression are to be implemented.

Let us conclude the insights from this subsection. AMOTO was shown to be able to generate a model, a centralized observer, and a distributed observer for a large-scale nonlinear system. The simulation results verify the theoretical result that the obtained observers are that the obtained observers are asymptotic. In the case of noisy measurements, the property of asymptotic convergence reduces to a convergence into a tolerance band around the value to be reconstructed.

#### asymptotic. In the case of noisy measurements, the property of asymptotic convergence reduces to a convergence into a tolerance band around the value to be reconstructed. 5.4 Discussion

5.4 Discussion The previous two sections demonstrated the capabilities of the software prototype AMOTO. It was shown that the program can be used for the automated model generation and observer The previous two sections demonstrated the capabilities of the software prototype AMOTO. It was shown that the program can be used for the automated model generation and observer design in linear and nonlinear interconnected systems with 100 states and more. The results from this chapter have been confirmed in

many other studies as, e.g., by Muller [2018] in which AMOTO is applied to the modeling of a wind turbine system with doubly fed induction generator.

In numerical simulations, the obtained models produced plausible results. Section 5.2 showed that the model obtained from AMOTO yields simulation results that are almost identical to the results produced by a verified benchmark model from the literature. This is remarkable as the AMOTO model is a causal ODE model while the benchmark model is an acausal, component-based Simscape model. Numerical simulations verified the observers obtained from AMOTO to be asymptotic. In the presence of measurement noise, the property of asymptotic convergence reduces to a convergence into a tolerance band whose width depends on the noise level. In this context, a pre-processing of the measurements may be good choice to reduce the influence of the noise to the observer.

In AMOTO, the user exclusively operates on an intuitive graphical level. As was shown, this prevents the engineer from dealing with hundreds of equations. Therewith, AMOTO enables a transparent and comfortable modeling and observer design for interconnected systems. The program fits seamlessly in the workflow for developing control systems. The bond graph for AMOTO can be generated with well-known computer tools that feature extensive component libraries, e.g., Modelica or 20-sim. Moreover, AMOTO's export function allows to write the obtained models and observers to the file formats of MATLAB, Mathematica, and LATEXfor subsequent steps in the development of control systems as, e.g., their simulation, analysis, and documentation.

In both case studies, the time required to calculate the models and observers is well under a minute. It is noteworthy, however, that the models and observers obtained from AMOTO may exceed the simulation capabilities of MATLAB/Simulink. The bottleneck is not the simulation itself but the compilation of a model or observer. Large expressions that involve several thousand lines of MATLAB code may lead to the situation where the compilation cannot be finished in a reasonable time.

In conclusion, this proof of principle demonstrated that AMOTO allows for an intuitive, time-efficient, and error-resistant model generation and observer design for large-scale interconnected systems.

## 5.5 Summary and Contributions

This chapter presented a proof of principle for the automated model generation and observer design. To this end, the software prototype AMOTO integrating

the methods and algorithms from Chapter 3 and Chapter 4 was introduced. In a first case study, AMOTO was applied to design a time-domain dynamic state estimator for an unbalanced power distribution system. In a second case study, we applied AMOTO to a large-scale nonlinear interconnected system. In both case studies, numerical simulations illustrated the validity of the models and observers that were generated by AMOTO. The main achievements of this chapter, including contributions are:


These contributions verify that the process of deriving explicit state-space models and the process of designing model-based observers for interconnected systems can be indeed automated. Moreover, they emphasize the practical usefulness of such an approach.

# Chapter 6

## Conclusion

The model derivation in interconnected systems is time- and cost-intensive and may require experts from different engineering fields. Moreover, for such systems, the curse of dimensionality leads to extensive equations which makes a manual or partially computer-aided model development prone to error. Besides the modeling, the curse of dimensionality hampers many subsequent steps in a model-based control system development as, e.g., the design of observers. Hence, to reduce complexity, engineers may be forced to apply unjustified simplifications in the description of the systems' physics.

This thesis outlined a new approach to handle the complexity of interconnected systems. The idea is to consistently *automate* the model derivation and observer design in the physically unifying framework of port-Hamiltonian systems (PHSs). Following this idea, this work has made innovative methodological contributions in two areas: first, methods and algorithms for an automated generation of explicit port-Hamiltonian models from bond graphs have been presented; second, methods and algorithms for an automated PHS-based design of observers have been developed. By these contributions, we reach the research objectives stated in Chapter 1. The approach is intuitive, efficient, and error-resistant and allows to treat a wide class of interconnected systems covering the electric, mechanic, hydraulic, thermal, and chemical domain.

The methods and algorithms from this work are implemented in a software prototype named AMOTO. AMOTO was successfully demonstrated for two interconnected systems, viz. an unbalanced power distribution network and a large-scale nonlinear system. For the former, one obtains a dynamic state estimator which significantly extends the functionalities of the static WLS estimator that is used in nowadays power system control centers. Various numerical simulations verify the validity of the models and observers generated by AMOTO.

A natural direction for future research is to consider the automated design of controllers. Appendix C.4 provides a first result towards this direction. Moreover, the thesis at hand follows an approach based on explicit models and observers. Two well-known limitations of an explicit approach are (i) that it disallows to consider systems with irreversible thermodynamic processes, and (ii) that it imposes an input-state-output causality on the system which may reduce the physical transparency in the obtained models and observers. This motivates to reconsider the research questions from this thesis in the framework of implicit PHSs—a class of systems that has been recently proposed, e.g., by van der Schaft and Maschke [2018] and Beattie et al. [2018].

As a final conclusion, this thesis is the first to consistently automate the processes of a physics-based state-space model derivation and a model-based observer design for a wide class of interconnected systems.

## Appendices for Chapter 2

## A.1 Proof of Proposition 2.26

Proposition 2.26 claims that explicit PHSs are passive or even strictly passive as a consequence of their system formulation. The proof follows here.

#### Proof:

The proof is oriented on van der Schaft [2017, p. 114]. Consider the explicit PHS from Definition 2.23. As the Hamiltonian *H* is bounded from below, we always find a constant *<sup>c</sup>* <sup>∈</sup> <sup>R</sup>≥<sup>0</sup> such that *<sup>V</sup>* (*x*) = *<sup>H</sup>* (*x*) +*<sup>c</sup>* is a non-negative function. The time derivative of *V* is calculated as

$$\begin{split} \dot{V} \left( \mathbf{x} \right) &= \left( \frac{\partial V}{\partial \mathbf{x}} \left( \mathbf{x} \right) \right)^{\top} \dot{\mathbf{x}} = \left( \frac{\partial H}{\partial \mathbf{x}} \left( \mathbf{x} \right) \right)^{\top} \dot{\mathbf{x}} \\ &\stackrel{\text{(2.12a)}}{=} \left( \frac{\partial H}{\partial \mathbf{x}} \left( \mathbf{x} \right) \right)^{\top} \left( \left( \mathbf{J} \left( \mathbf{x} \right) - \mathbf{R} \left( \mathbf{x} \right) \right) \frac{\partial H}{\partial \mathbf{x}} \left( \mathbf{x} \right) + \left( \mathbf{G} \left( \mathbf{x} \right) - \mathbf{P} \left( \mathbf{x} \right) \right) \mathbf{u} \right) \\ &= - \left( \frac{\partial H}{\partial \mathbf{x}} \left( \mathbf{x} \right) \right)^{\top} \mathbf{R} \left( \mathbf{x} \right) \frac{\partial H}{\partial \mathbf{x}} \left( \mathbf{x} \right) + \left( \frac{\partial H}{\partial \mathbf{x}} \left( \mathbf{x} \right) \right)^{\top} \left( \mathbf{G} \left( \mathbf{x} \right) - \mathbf{P} \left( \mathbf{x} \right) \right) \mathbf{u} . \end{split} \tag{\triangleq \mathbf{0}}$$

With (2.12b), the last term in (A.1) can be written as

$$\begin{aligned} \left(\frac{\partial H}{\partial \mathbf{x}}(\mathbf{x})\right)^{\top} (\mathbf{G}(\mathbf{x}) - \mathbf{P}(\mathbf{x})) \boldsymbol{\mathfrak{u}} \\ = \mathbf{y}^{\top} \boldsymbol{\mathfrak{u}} - 2 \left(\frac{\partial H}{\partial \mathbf{x}}(\mathbf{x})\right)^{\top} \mathbf{P}(\mathbf{x}) \boldsymbol{\mathfrak{u}} - \mathbf{u}^{\top} \left(\mathbf{M}(\mathbf{x}) + \mathbf{S}(\mathbf{x})\right)^{\top} \boldsymbol{\mathfrak{u}} .\end{aligned} \tag{\mathsf{A.2}}$$

Inserting (A.2) into (A.1) and recalling that *M* (*x*) is skew-symmetric yields

$$\dot{\boldsymbol{V}}(\mathbf{x}) = -\left(\frac{\partial H}{\partial \mathbf{x}}(\mathbf{x})\right)^{\top} \mathbf{R}(\mathbf{x}) \frac{\partial H}{\partial \mathbf{x}}(\mathbf{x}) + \mathbf{y}^{\top} \boldsymbol{\mu} - 2\left(\frac{\partial H}{\partial \mathbf{x}}(\mathbf{x})\right)^{\top} \mathbf{P}(\mathbf{x}) \boldsymbol{\mu} - \mathbf{u}^{\top} \mathbf{S}^{\top}(\mathbf{x}) \boldsymbol{u}. \tag{A.3}$$

Equation (A.3) can be rearranged as

$$\dot{V}\left(\mathbf{x}\right) = \boldsymbol{\mathfrak{u}}^{\top}\mathbf{y} - \left(\left(\frac{\partial H}{\partial \mathbf{x}}\left(\mathbf{x}\right)\right)^{\top}\quad \mathbf{u}^{\top}\right) \underbrace{\begin{pmatrix} \mathbf{R}\left(\mathbf{x}\right) & \mathbf{P}\left(\mathbf{x}\right) \\ \mathbf{P}^{\top}\left(\mathbf{x}\right) & \mathbf{S}\left(\mathbf{x}\right) \end{pmatrix}}\_{=\mathbf{S}\left(\mathbf{x}\right)} \begin{pmatrix} \frac{\partial H}{\partial \mathbf{x}}\left(\mathbf{x}\right) \\ \mathbf{u} \end{pmatrix} \overset{\{2.13}{\leq} \mathbf{u}^{\top}\mathbf{y}, \quad \forall t \geq 0.15$$

Hence, the PHS is passive. If <sup>Θ</sup> (*x*) is positive-definite for all *<sup>x</sup>* <sup>∈</sup> <sup>X</sup>, we have *V*˙ < *u* <sup>⊤</sup>*y* for all non-equilibrium points and the system is strictly passive.

# Appendix B

## Appendices for Chapter 3

## B.1 Discussion on Assumption 3.22

In Subsection 3.2.5, it was argued that the source elements of a bond graph are independent if and only if Assumption 3.22 is met. In the following, we prove this statement formally. To this end, let us first introduce another matrix representation of a Dirac structure, viz. the *image representation*.

**Definition B.1 (Image representation)**

*An image representation of a Dirac structure* <sup>D</sup>(*x*) <sup>⊂</sup> <sup>R</sup> *<sup>n</sup>* <sup>×</sup><sup>R</sup> *<sup>n</sup> with <sup>x</sup>* <sup>∈</sup> <sup>X</sup> *is*

$$\mathbb{D}(\mathbf{x}) = \{(\mathbf{f}, \mathbf{e}) \in \mathbb{R}^n \times \mathbb{R}^n \mid \exists \lambda \in \mathbb{R}^n \text{ s.t. } \mathbf{f} = \mathbf{E}^\top(\mathbf{x}) \lambda, \mathbf{e} = \mathbf{F}^\top(\mathbf{x}) \lambda\}. \tag{\mathbb{B}.\mathbf{1}}$$

*As with the kernel representation from Definition 2.18, the matrices F* (*x*) *and E* (*x*) *in* (B.1) *satisfy* (2.5)*; the power balance is given by* (2.6)*.*

Now for the dependent sources.

#### **Proposition B.2 (Dependent sources)**

*Given a bond graph as in Definition 3.5 whose junction structure is described by a Dirac structure of the form* (3.27)*. The source elements of the bond graph are independent for all <sup>x</sup>* <sup>∈</sup> <sup>X</sup> *if and only if Assumption 3.22 is satisfied.*

#### Proof:

We first show that a violation of Assumption 3.22 implies that the bond graph has dependent source elements. To this end, we use the idea from Golo et al. [2003, Remark 1].

Let Assumption 3.22 be violated, i.e.,

$$\exists \mathbf{x} \in \mathbb{X} \colon \text{rank}\left(\mathbf{E}\_{\text{Sf}}\left(\mathbf{x}\right) \mid \mathbf{F}\_{\text{Se}}\left(\mathbf{x}\right)\right) < K \left(N\_{\text{Sf}} + N\_{\text{Se}}\right) \,. \tag{\mathbb{B}.2}$$

For such an *x*, the matrix (*E*Sf(*x*) *F*Se (*x*)) has not full rank and there exists a non-zero matrix (*U* (*x*) *V* (*x*)) such that

$$\begin{pmatrix} \mathcal{U}\begin{pmatrix} \mathbf{x} \end{pmatrix} & \mathbf{V}\begin{pmatrix} \mathbf{x} \end{pmatrix} \end{pmatrix} \begin{pmatrix} \mathbf{E}\_{\mathrm{Sf}}(\mathbf{x}) & \mathbf{F}\_{\mathrm{Se}}(\mathbf{x}) \end{pmatrix}^{\top} = \mathbf{0}. \tag{\mathsf{B.3}}$$

By post-multiplying (B.3) with a non-zero <sup>λ</sup> <sup>∈</sup> <sup>R</sup> *<sup>K</sup>*(*N*Sf+*N*Se) we obtain

$$\mathbf{U}\begin{pmatrix}\mathbf{x}\end{pmatrix}\underbrace{\mathbf{E}\_{\text{Sf}}^{\top}\boldsymbol{\lambda}}\_{\stackrel{\scriptstyle\mbox{(B.1)}}{=}\mathbf{f}\_{\text{Sf}}}+\mathbf{V}\begin{pmatrix}\mathbf{x}\end{pmatrix}\underbrace{\mathbf{F}\_{\text{Se}}^{\top}\boldsymbol{\lambda}}\_{\stackrel{\scriptstyle\mbox{(B.1)}}{=}\mathbf{e}\_{\text{Se}}}=\mathbf{0}.\tag{\mathbb{B.4}}$$

Equation (B.4) reveals the junction structure to imply an algebraic dependency between *f* Sf and *e*Se. This proves Assumption 3.22 to be a necessary condition for the independence of sources. The proof for sufficiency is obtained from the backwards calculation of the above formulas from (B.4) over (B.3) to (B.2).

## B.2 Analysis of the Input-Output Matrix

At the end of the proof of Lemma 3.23, we apply the insights from the proof of Theorem 4 from Bloch and Crouch [1999] for the construction of the skewsymmetric matrix *Z* (*x*). In their proof, Bloch and Crouch [1999] consider the Dirac structure on abstract (finite-dimensional) vector spaces. This is in contrast to most practical cases in which a Dirac structure is considered on Euclidean vector spaces. In the following proposition, we elaborate the calculation law

of the matrix *Z* (*x*) from Lemma 3.23 for Dirac structures on Euclidean vector spaces:

#### **Proposition B.3 (Caculation law for** *Z* (*x*)**)**

*The calculation law* (3.38) *ensures the equation systems in* (3.36) *and* (3.27) *to describe the same relations. Moreover,* (3.38) *yields a matrix Z* (*x*) *that is skew-symmetric.*

#### Proof:

We neglect the argument *<sup>x</sup>* and the supplement "for all *<sup>x</sup>* <sup>∈</sup> <sup>X</sup>" in this proof.

Using the splitting of *F* <sup>C</sup>, *F* <sup>R</sup>, *E*C, *E*<sup>R</sup> and likewise the splitting of *f* <sup>C</sup>, *f* <sup>R</sup>, *e*C, *e*R, the condition in (3.27) reads

$$\begin{aligned} &-\mathbf{F}\_{\mathrm{C},1}\mathbf{f}\_{\mathrm{C},1} - \mathbf{F}\_{\mathrm{C},2}\mathbf{f}\_{\mathrm{C},2} - \mathbf{F}\_{\mathrm{R},1}\mathbf{f}\_{\mathrm{R},1} - \mathbf{F}\_{\mathrm{R},2}\mathbf{f}\_{\mathrm{R},2} + \mathbf{F}\_{\mathrm{S}\mathrm{f}}\mathbf{f}\_{\mathrm{S}\mathrm{f}} + \mathbf{F}\_{\mathrm{S}\mathrm{e}}\mathbf{f}\_{\mathrm{S}\mathrm{e}} \\ &+ \mathbf{E}\_{\mathrm{C},1}\mathbf{e}\_{\mathrm{C},1} + \mathbf{E}\_{\mathrm{C},2}\mathbf{e}\_{\mathrm{C},2} + \mathbf{E}\_{\mathrm{R},1}\mathbf{e}\_{\mathrm{R},1} + \mathbf{E}\_{\mathrm{R},2}\mathbf{e}\_{\mathrm{R},2} + \mathbf{E}\_{\mathrm{S}\mathrm{f}}\mathbf{e}\_{\mathrm{S}\mathrm{f}} + \mathbf{E}\_{\mathrm{Se}}\mathbf{e}\_{\mathrm{Se}} = \mathbf{0}. \end{aligned} \tag{\mathrm{B.5}}$$

Combining and gathering the different matrices we can write this as

 *F* <sup>C</sup>,<sup>1</sup> *E*C,<sup>2</sup> *F* <sup>R</sup>,<sup>1</sup> *E*R,<sup>2</sup> *E*Sf *F*Se −*f* <sup>C</sup>,<sup>1</sup> *e*C,<sup>2</sup> −*f* <sup>R</sup>,<sup>1</sup> *e*R,<sup>2</sup> *e*Sf *f* Se + *E*C,<sup>1</sup> *F* <sup>C</sup>,<sup>2</sup> *E*R,<sup>1</sup> *F* <sup>R</sup>,<sup>2</sup> *F*Sf *E*Se *e*C,<sup>1</sup> −*f* <sup>C</sup>,<sup>2</sup> *e*R,<sup>1</sup> −*f* <sup>R</sup>,<sup>2</sup> *f* Sf *e*Se = 0, (B.6)

which is equivalent to

$$
\begin{pmatrix}
\mathbf{e}\_{\text{C},2} \\
\mathbf{e}\_{\text{R},2} \\
\mathbf{e}\_{\text{S}\mathbf{f}} \\
\mathbf{f}\_{\text{Se}}
\end{pmatrix} = -\begin{pmatrix}
\mathbf{F}\_{\text{C},1} & \mathbf{E}\_{\text{C},2} & \mathbf{F}\_{\text{R},1} & \mathbf{E}\_{\text{R},2} & \mathbf{E}\_{\text{S}\mathbf{f}} & \mathbf{F}\_{\text{Se}}
\end{pmatrix}^{-1}
$$

$$
\begin{pmatrix}
\mathbf{E}\_{\text{C},1} & \mathbf{F}\_{\text{C},2} & \mathbf{E}\_{\text{R},1} & \mathbf{F}\_{\text{R},2} & \mathbf{F}\_{\text{S}\mathbf{f}} & \mathbf{E}\_{\text{Se}}
\end{pmatrix}
\begin{pmatrix}
\mathbf{e}\_{\text{C},1} \\
\mathbf{f}\_{\text{S}\mathbf{f}}
\end{pmatrix},
\tag{\mathbf{B}.7}
$$

i.e., equivalent to the condition in (3.36). To prove the skew-symmetry of *Z* we again follow the idea of Bloch and Crouch [1999, Theorem 4]. Equation (2.5a) can be written as

$$\begin{split} \mathbf{0} &= \mathbf{E} \mathbf{F}^{\top} + \mathbf{F} \mathbf{E}^{\top} \\ &= \begin{aligned} &\mathbf{E}\_{\mathbf{C},1} \mathbf{F}\_{\mathbf{C},1}^{\top} + \mathbf{E}\_{\mathbf{C},2} \mathbf{F}\_{\mathbf{C},2}^{\top} + \mathbf{E}\_{\mathbf{R},1} \mathbf{F}\_{\mathbf{R},1}^{\top} + \mathbf{E}\_{\mathbf{R},2} \mathbf{F}\_{\mathbf{R},2}^{\top} + \mathbf{E}\_{\mathbf{S} \mathbf{f}} \mathbf{F}\_{\mathbf{S} \mathbf{f}}^{\top} + \mathbf{E}\_{\mathbf{S} \mathbf{e}} \mathbf{F}\_{\mathbf{S} \mathbf{e}}^{\top} + \\ &\mathbf{F}\_{\mathbf{C},1} \mathbf{E}\_{\mathbf{C},1}^{\top} + \mathbf{F}\_{\mathbf{C},2} \mathbf{E}\_{\mathbf{C},2}^{\top} + \mathbf{F}\_{\mathbf{R},1} \mathbf{E}\_{\mathbf{R},1}^{\top} + \mathbf{F}\_{\mathbf{R},2} \mathbf{E}\_{\mathbf{R},2}^{\top} + \mathbf{F}\_{\mathbf{S} \mathbf{f}} \mathbf{E}\_{\mathbf{S} \mathbf{f}}^{\top} + \mathbf{F}\_{\mathbf{S} \mathbf{e}} \mathbf{E}\_{\mathbf{S} \mathbf{e}}^{\top}. \end{aligned} \end{split}$$

Resorting and combining the matrices we can write this as

$$\begin{aligned} \mathbf{0} &= \begin{pmatrix} \mathbf{F}\_{\mathbf{C},1} & \mathbf{E}\_{\mathbf{C},2} & \mathbf{F}\_{\mathbf{R},1} & \mathbf{E}\_{\mathbf{R},2} & \mathbf{E}\_{\mathbf{S}\mathbf{f}} & \mathbf{F}\_{\mathbf{S}\mathbf{e}} \end{pmatrix} \\ &\cdot \begin{pmatrix} \mathbf{E}\_{\mathbf{C},1} & \mathbf{F}\_{\mathbf{C},2} & \mathbf{E}\_{\mathbf{R},1} & \mathbf{F}\_{\mathbf{R},2} & \mathbf{F}\_{\mathbf{S}\mathbf{f}} & \mathbf{E}\_{\mathbf{S}\mathbf{e}} \end{pmatrix}^{\top} \\ &+ \begin{pmatrix} \mathbf{E}\_{\mathbf{C},1} & \mathbf{F}\_{\mathbf{C},2} & \mathbf{E}\_{\mathbf{R},1} & \mathbf{F}\_{\mathbf{R},2} & \mathbf{F}\_{\mathbf{S}\mathbf{f}} & \mathbf{E}\_{\mathbf{S}\mathbf{e}} \end{pmatrix}^{\top} \\ &\cdot \begin{pmatrix} \mathbf{F}\_{\mathbf{C},1} & \mathbf{E}\_{\mathbf{C},2} & \mathbf{F}\_{\mathbf{R},1} & \mathbf{E}\_{\mathbf{R},2} & \mathbf{E}\_{\mathbf{S}\mathbf{f}} & \mathbf{F}\_{\mathbf{S}\mathbf{e}} \end{pmatrix}^{\top} . \end{aligned} \tag{\mathbf{B},\mathbf{9}}$$

Inverting the first and last matrix we get the equation of the skew-symmetry of *Z*:

$$\begin{aligned} \mathbf{-Z^{\top}} &= \begin{pmatrix} \mathbf{E}\_{\mathbf{C},1} & \mathbf{F}\_{\mathbf{C},2} & \mathbf{E}\_{\mathbf{R},1} & \mathbf{F}\_{\mathbf{R},2} & \mathbf{F}\_{\mathbf{S}\mathbf{f}} & \mathbf{E}\_{\mathbf{S}\mathbf{e}} \end{pmatrix}^{\top} \\ &\cdot \left( \begin{pmatrix} \mathbf{F}\_{\mathbf{C},1} & \mathbf{E}\_{\mathbf{C},2} & \mathbf{F}\_{\mathbf{R},1} & \mathbf{E}\_{\mathbf{R},2} & \mathbf{E}\_{\mathbf{S}\mathbf{f}} & \mathbf{F}\_{\mathbf{S}\mathbf{e}} \end{pmatrix}^{\top} \right)^{\top} \\ &= -\begin{pmatrix} \mathbf{F}\_{\mathbf{C},1} & \mathbf{E}\_{\mathbf{C},2} & \mathbf{F}\_{\mathbf{R},1} & \mathbf{E}\_{\mathbf{R},2} & \mathbf{E}\_{\mathbf{S}\mathbf{f}} & \mathbf{F}\_{\mathbf{S}\mathbf{e}} \end{pmatrix}^{-1} \\ &\cdot \left( \mathbf{E}\_{\mathbf{C},1} & \mathbf{F}\_{\mathbf{C},2} & \mathbf{E}\_{\mathbf{R},1} & \mathbf{F}\_{\mathbf{R},2} & \mathbf{F}\_{\mathbf{S}\mathbf{f}} & \mathbf{E}\_{\mathbf{S}\mathbf{e}} \right) \\ &= \mathbf{Z} . \end{aligned} \tag{\mathbf{B}.10}$$

## B.3 Discussion on Assumption 3.30

In Subsection 3.3, it was argued that Assumption 3.30 is always fulfilled if all resistive elements from the bond graph are truly dissipative. In the following proposition, we elaborate this statement more in detail:

#### **Proposition B.4 (Truly dissipative resistive elements)** *Given a bond graph according to Definition 3.5. Let all resistive elements <sup>i</sup>* <sup>∈</sup> <sup>V</sup><sup>R</sup> *be truly dissipative, i.e., they obey the constitutive relation*

$$\mathbf{f}\_{\ j} = \mathbf{D}\_{i}(\mathbf{x})\mathbf{e}\_{j},\tag{\mathsf{B.11}}$$

*with j* ∈ B(*i*)*, Di*(*x*) ∈ R *<sup>K</sup>*×*<sup>K</sup>, and Di*(*x*) = *Di*(*x*) <sup>⊤</sup> <sup>≻</sup> <sup>0</sup>*, for all <sup>x</sup>* <sup>∈</sup> <sup>X</sup>*. Note that in contrast to the general case from Subsection 3.2.2, we now assume Di*(*x*) *to be positive-definite. Let the junction structure of the bond graph be described by a Dirac structure in kernel form* (3.27) *which satisfies Assumption 3.22. Then, we always find an input-output representation* (3.36) *of* (3.27) *with a splitting of resistive variables that fulfills Assumption 3.30.*

#### Proof:

We neglect the argument *<sup>x</sup>* and the supplement "for all *<sup>x</sup>* <sup>∈</sup> <sup>X</sup>" in this proof.

Consider a Dirac structure in kernel form (3.27) which satisfies Assumption 3.22. From Lemma 3.23 and the properties of a causal bond graph we know that we always find an input-output representation of (3.27) in the form (3.36) where for each *<sup>j</sup>* <sup>∈</sup> <sup>B</sup>(*i*), *<sup>i</sup>* <sup>∈</sup> <sup>V</sup><sup>R</sup> the pair *f j* , *e <sup>j</sup>* lies either completely in *f* <sup>R</sup>,<sup>1</sup> , *e*R,<sup>1</sup> or completely in *f* <sup>R</sup>,<sup>2</sup> , *e*R,<sup>2</sup> . Possibly after permutations, we may thus write the resistive relations (B.11) as

$$
\begin{pmatrix} \mathbf{f}\_{\mathbf{R},1} \\ \mathbf{f}\_{\mathbf{R},2} \end{pmatrix} = \underbrace{\begin{pmatrix} \mathbf{D}\_{11} & \mathbf{0} \\ \mathbf{0} & \mathbf{D}\_{22} \end{pmatrix}}\_{=\mathbf{D}} \begin{pmatrix} \mathbf{e}\_{\mathbf{R},1} \\ \mathbf{e}\_{\mathbf{R},2} \end{pmatrix},\tag{\mathsf{B.12}}$$

where *D*<sup>11</sup> = *D* ⊤ <sup>11</sup> ≻ 0 and *D*<sup>22</sup> = *D* ⊤ <sup>22</sup> <sup>≻</sup> <sup>0</sup> are block diagonal matrices. Equation (B.12) may be rewritten as

$$\underbrace{\begin{pmatrix} \mathbf{e}\_{\mathbb{R},1} \\ -\mathbf{f}\_{\mathbb{R},2} \end{pmatrix}}\_{=\mathbf{u}\_{\mathbb{R}}} = -\underbrace{\begin{pmatrix} \mathbf{D}\_{11}^{-1} & \mathbf{0} \\ \mathbf{0} & \mathbf{D}\_{22} \end{pmatrix} \begin{pmatrix} -\mathbf{f}\_{\mathbb{R},1} \\ \mathbf{e}\_{\mathbb{R},2} \end{pmatrix}}\_{=\mathbf{h}},\tag{\mathbb{B}.\mathbf{13}},$$

where *R*˜ = *R*˜ <sup>⊤</sup> <sup>≻</sup> 0. Equation (B.13) is of the form (3.66) which is why Assumption 3.30 is fulfilled.

## B.4 Port-Hamiltonian Systems with Nonlinear Dissipation

In this section, it is shown that the modeling approach from Chapter 3 can be generalized to systems with resistive relations which are nonlinear in the power variables.

Consider the Dirac structure obtained from Corollary 3.28:

<sup>D</sup>(*x*) = {( *f* C *f* R *f* Sf *f* Se , *e*<sup>C</sup> *e*<sup>R</sup> *e*Sf *e*Se ) ∈ R *KN*<sup>E</sup> <sup>×</sup><sup>R</sup> *KN*<sup>E</sup> <sup>|</sup> *y*C *y*R *y*P = *Z*CC (*x*) −*Z*CR (*x*) −*Z*CP (*x*) *Z* ⊤ CR (*x*) *Z*RR (*x*) −*Z*RP (*x*) *Z* ⊤ CP (*x*) *Z* ⊤ RP (*x*) *Z*PP (*x*) | {z } *Z*(*x*) *u*<sup>C</sup> *u*<sup>R</sup> *u*P }, (B.14)

where *<sup>Z</sup>* (*x*) = <sup>−</sup>*<sup>Z</sup>* <sup>⊤</sup> (*x*) ∈ R *KN*E×*KN*<sup>E</sup> for all *<sup>x</sup>* <sup>∈</sup> <sup>X</sup>. The inputs and outputs in (B.14) are given by *u*<sup>C</sup> = *e*C, *u*<sup>R</sup> = (*e* ⊤ R,1 *f* ⊤ R,2 ) <sup>⊤</sup>, *u*<sup>P</sup> = (*f* ⊤ Sf *e* ⊤ Se) <sup>⊤</sup>, *y*<sup>C</sup> = −*f* <sup>C</sup>, *<sup>y</sup>*<sup>R</sup> = (−*<sup>f</sup>* ⊤ <sup>R</sup>,<sup>1</sup> *e* ⊤ R,2 ) <sup>⊤</sup>, and *y*<sup>P</sup> = (*e* ⊤ Sf *f* ⊤ Se) <sup>⊤</sup>. With the following assumption, we exclude the presence of causal paths between resistive elements:

$$\begin{aligned} \textbf{Assumption B.5} \quad & \text{(\textbf{Matrix block in (B.14)})}\\ \ln \text{ (B.14), we have } \textbf{Z}\_{\text{RR}} \left( \textbf{x} \right) = \textbf{0} \text{ for all } \textbf{x} \in \mathbb{X}. \end{aligned}$$

Recall the constitutive relations of storages from (3.65):

$$\mathfrak{y}\_{\mathcal{C}} = -\mathcal{f}\_{\mathcal{C}} = -\mathfrak{x}, \qquad \mathfrak{u}\_{\mathcal{C}} = \mathfrak{e}\_{\mathcal{C}} = \frac{\partial V}{\partial \mathfrak{x}} \left( \mathfrak{x} \right), \tag{\mathsf{B.15}}$$

and define *z* := *u*C. For resistive elements, suppose nonlinear constitutive relations which are expressed as the graph of an input-output map (cf. van der Schaft and Jeltsema [2014, p. 24]):

$$\mathfrak{u}\_{\mathbb{R}} = \Phi(\mathfrak{y}\_{\mathbb{R}}, \mathfrak{x}, \mathfrak{z}, \mathfrak{u}), \tag{\mathbb{B}.16}$$

where *y* ⊤ <sup>R</sup>*u*<sup>R</sup> <sup>≤</sup> 0. Now we have everything prepared for a port-Hamiltonian formulation of a system with nonlinear dissipation.

#### **Proposition B.6 (PHS of a system with nonlinear dissipation)**

*Given an explicit Dirac structure* (B.14) *which satisfies Assumption B.5. Let the constitutive relations of storage elements and resistive elements be given in the forms* (B.15) *and* (B.16)*, respectively. Equations* (B.14)*,* (B.15)*,* *and* (B.16) *can be written as explicit input-state-output PHSs of the form*

$$\mathbf{x} = \mathbf{J}\left(\mathbf{x}\right)\mathbf{z} - \mathcal{R}\left(\mathbf{x}, \mathbf{z}, \mathbf{u}\right) + \mathbf{G}\left(\mathbf{x}\right)\mathbf{u},\tag{\mathsf{B.17a}}$$

$$\mathbf{y} = \mathbf{G}^{\perp}(\mathbf{x})\,\mathbf{z} + \mathcal{P}^{\diamond}(\mathbf{x}, \mathbf{z}, \mathbf{u}) + \mathbf{M}\,(\mathbf{x})\,\mathbf{u},\tag{\mathsf{B.17b}}$$

*with mappings* <sup>R</sup> (*x*,·,·) : <sup>R</sup> *<sup>n</sup>* <sup>→</sup> <sup>R</sup> *n ,* P (*x*,·,·) : R *<sup>n</sup>* <sup>→</sup> <sup>R</sup> *<sup>p</sup> and u* = *u*P*, y* = *y*P *. In* (B.17)*, the matrices and mappings satisfy <sup>J</sup>* (*x*) = <sup>−</sup>*<sup>J</sup>* <sup>⊤</sup>(*x*)*, M* (*x*) = <sup>−</sup>*M*⊤(*x*)*, and*

$$
\begin{pmatrix} \mathbf{z} \\ \mathbf{u} \end{pmatrix}^{\top} \begin{pmatrix} \mathcal{R} \ (\mathbf{x}, \mathbf{z}, \mathbf{u}) & \mathbf{0} \\ \mathbf{0} & \mathcal{P} (\mathbf{x}, \mathbf{z}, \mathbf{u}) \end{pmatrix} \ge 0, \quad \forall \mathbf{x} \in \mathbb{X}, \mathbf{z} \in \mathbb{R}^{n}, \mathbf{u} \in \mathbb{U}. \tag{\mathsf{B.18}}$$

*The matrices can be obtained from <sup>J</sup>* (*x*) = <sup>−</sup>*Z*CC (*x*)*, <sup>G</sup>* (*x*) = *<sup>Z</sup>*CP (*x*)*, and M* (*x*) = *Z*PP (*x*)*; the mappings are calculated as*

$$\mathcal{A}^{\mathcal{J}}(\mathbf{x}, \mathbf{z}, \mathfrak{u}) = -\mathbf{Z}\_{\text{CR}}(\mathbf{x}) \Phi \left( \mathbf{Z}\_{\text{CR}}^{\top}(\mathbf{x}) \mathbf{z} - \mathbf{Z}\_{\text{CP}}(\mathbf{x}) \, \mathfrak{u}, \mathbf{x}, \mathfrak{z}, \mathfrak{u} \right), \tag{\mathsf{B.19a}}$$

$$\mathcal{O}^{\boldsymbol{\theta}}(\mathbf{x}, \mathbf{z}, \boldsymbol{\upmu}) = \quad \mathbf{Z}\_{\mathrm{RP}}^{\top}(\mathbf{x}) \boldsymbol{\upPhi}\left(\mathbf{Z}\_{\mathrm{CR}}^{\top}(\mathbf{x}) \,\mathbf{z} - \mathbf{Z}\_{\mathrm{CP}}(\mathbf{x}) \,\boldsymbol{\upmu}, \mathbf{x}, \mathbf{z}, \boldsymbol{\upmu}\right). \tag{\mathsf{B.19b}}$$

#### Proof:

Inserting *u*<sup>C</sup> = *z* and (B.16) into the first line of the equation system from (B.14) yields

$$\mathbf{y}\_{\text{C}} = \mathbf{Z}\_{\text{CC}}(\mathbf{x})\,\mathfrak{u}\_{\text{C}} - \mathbf{Z}\_{\text{CR}}(\mathbf{x})\,\Phi(\mathbf{y}\_{\text{R}}, \mathbf{x}, \mathbf{z}, \mathfrak{u}) - \mathbf{Z}\_{\text{CP}}(\mathbf{x})\,\mathfrak{u}\_{\text{P}}.\tag{\text{B.2O}}$$

For the second term from the right side we write

$$-\mathbf{Z\_{CR}}(\mathbf{x})\,\boldsymbol{\Phi}(\mathbf{y}\_{\mathrm{R}},\mathbf{x},\mathbf{z},\mathbf{u})\stackrel{\mathrm{(\textbf{B}.16)}}{=}\underbrace{-\mathbf{Z\_{CR}}(\mathbf{x})\,\boldsymbol{\Phi}\left(\mathbf{Z\_{CR}^{\top}(\mathbf{x})}\,\mathbf{z} - \mathbf{Z\_{CP}}(\mathbf{x})\,\mathbf{u},\mathbf{x},\mathbf{z},\mathbf{u}\right)}\_{=:\boldsymbol{\beta}(\mathbf{x},\mathbf{z},\mathbf{u})}.\tag{\textbf{B.21}}$$

By inserting (B.21) into (B.20) we obtain (B.17a):

$$\mathbf{y}\_{\text{C}} = \mathbf{Z\_{CC}}\left(\mathbf{x}\right)\mathbf{z} + \boldsymbol{\mathcal{A}}\left(\mathbf{x}, \mathbf{z}, \boldsymbol{\mu}\right) - \mathbf{Z\_{CP}}\left(\mathbf{x}\right)\boldsymbol{\mu}\_{\text{P}}$$

$$\stackrel{\text{(B.15)}}{\Leftrightarrow}-\dot{\mathbf{x}} = \mathbf{Z\_{CC}}\left(\mathbf{x}\right)\mathbf{z} + \boldsymbol{\mathcal{A}}\left(\mathbf{x}, \mathbf{z}, \boldsymbol{\mu}\right) - \mathbf{Z\_{CP}}\left(\mathbf{x}\right)\boldsymbol{\mu}\_{\text{P}}$$

$$\Leftrightarrow \qquad \mathbf{t} = \underbrace{-\mathbf{Z\_{CC}}\left(\mathbf{x}\right)\mathbf{z}}\_{=\mathbf{J}\left(\mathbf{x}\right)}\mathbf{z} - \boldsymbol{\mathcal{A}}\left(\mathbf{x}, \mathbf{z}, \boldsymbol{\mu}\right) + \underbrace{\mathbf{Z\_{CP}}\left(\mathbf{x}\right)\mathbf{u\_{P}}}\_{=\mathbf{G}\left(\mathbf{x}\right)}\mathbf{u\_{P}}.\tag{B.22}$$

Now for the output equation. From the third line of the equation system in (B.14) and with *u* = *u*P, *y* = *y*<sup>P</sup> we obtain

$$\mathbf{y} = \underbrace{\mathbf{Z\_{CP}^{\top}}(\mathbf{x})}\_{=\mathbf{G^{\top}}(\mathbf{x})} \mathbf{z} + \mathbf{Z\_{RP}^{\top}}(\mathbf{x})\,\boldsymbol{\upmu\_{\mathbb{R}}} + \underbrace{\mathbf{Z\_{PP}^{\top}}(\mathbf{x})}\_{=\mathbf{M(x)}} \boldsymbol{\upmu\_{\mathbb{R}}}.\tag{\mathbb{B}.23}$$

For the second term from the right side we write

$$\begin{split} \mathbf{Z}\_{\mathrm{RP}}^{\top}(\mathbf{x}) \,\boldsymbol{\mu}\_{\mathrm{R}} \stackrel{\{\textbf{B}.16\}}{=} \mathbf{Z}\_{\mathrm{RP}}^{\top}(\mathbf{x}) \,\boldsymbol{\Phi}\left(\mathbf{y}\_{\mathrm{R}},\mathbf{z},\mathbf{z},\boldsymbol{\mu}\right) \\ \stackrel{\{\textbf{B}.14\}}{=} \underbrace{\mathbf{Z}\_{\mathrm{RP}}^{\top}(\mathbf{x}) \,\boldsymbol{\Phi}\left(\mathbf{Z}\_{\mathrm{CR}}^{\top}(\mathbf{x}) \,\mathbf{z} - \mathbf{Z}\_{\mathrm{CP}}(\mathbf{x}) \,\mathbf{u},\mathbf{x},\mathbf{z},\boldsymbol{\mu}\right)}\_{=\boldsymbol{\beta}^{\prime}(\mathbf{x},\mathbf{z},\boldsymbol{\mu})}. \end{split} \tag{\mathsf{B.24}}$$

Inserting (B.24) into (B.23) yields (B.17b).

Next, we show that (B.18) holds. By multiplying (B.17a) from the right side with *z* <sup>⊤</sup> we obtain

$$\mathbf{z}^{\top}\dot{\mathbf{x}} = -\mathbf{z}^{\top}\mathcal{A}\left(\mathbf{x}, \mathbf{z}, \mathbf{u}\right) + \mathbf{z}^{\top}\mathbf{G}\left(\mathbf{x}\right)\mathbf{u}.\tag{\mathbb{B}.25}$$

On the other hand, by the power balance of the Dirac structure (B.14) we have

$$\mathbf{z}^{\top}\dot{\mathbf{x}}^{\prime} \stackrel{\text{(B.15)}}{=} -\boldsymbol{\mu}\_{\text{C}}^{\top}\mathbf{y}\_{\text{C}} \stackrel{\text{(2.9)}}{=} \boldsymbol{\mu}\_{\text{R}}^{\top}\mathbf{y}\_{\text{R}} + \boldsymbol{\mu}\_{\text{P}}^{\top}\mathbf{y}\_{\text{P}}.\tag{\mathsf{B.26}}$$

Equating (B.25) and (B.26) yields

$$-\mathbf{z}^{\top}\mathcal{\boldsymbol{\mathcal{H}}}\left(\mathbf{x},\mathbf{z},\mathbf{u}\right) + \mathbf{z}^{\top}\mathbf{G}\left(\mathbf{x}\right)\mathbf{u} = \mathbf{u}\_{\mathrm{R}}^{\top}\mathbf{y}\_{\mathrm{R}} + \mathbf{u}\_{\mathrm{P}}^{\top}\mathbf{y}\_{\mathrm{P}}.\tag{\mathsf{B.27}}$$

The last term reads

*u* ⊤ <sup>P</sup> *y*<sup>P</sup> (B.14) = *u* ⊤ P *Z* ⊤ CP(*x*)*u*<sup>C</sup> +*Z* ⊤ RP(*x*)*u*<sup>R</sup> +*Z*PP (*x*)*u*<sup>P</sup> = *u* ⊤ <sup>P</sup> *Z* ⊤ CP(*x*)*u*<sup>C</sup> +*u* ⊤ <sup>P</sup> *Z* ⊤ RP(*x*)*u*<sup>R</sup> (B.16) = *u* ⊤ <sup>P</sup> *Z* ⊤ CP(*x*)*u*<sup>C</sup> +*u* ⊤ <sup>P</sup> *Z* ⊤ RP(*x*)Φ(*y*R, *x*,*z*,*u*) (B.14) = *u* ⊤ <sup>P</sup> *Z* ⊤ CP(*x*)*u*<sup>C</sup> +*u* ⊤ <sup>P</sup> *Z* ⊤ RP(*x*)Φ *Z* ⊤ CR(*x*)*z* −*Z*CP (*x*)*u*, *x*,*z*,*u* . (B.28)

With (B.19a) and *u* = *u*P, *y* = *y*<sup>P</sup> we write (B.28) as

$$\boldsymbol{\mathfrak{u}}\_{\rm P}^{\top}\mathbf{y}\_{\rm P} = \boldsymbol{\mathfrak{u}}^{\top}\underbrace{\mathbf{Z}\_{\rm CP}^{\top}(\mathbf{x})}\_{=\mathbf{G}^{\top}(\mathbf{x})}\mathbf{z} + \boldsymbol{\mathfrak{u}}^{\top}\boldsymbol{\mathcal{P}}^{\parallel}(\mathbf{x}, \mathbf{z}, \boldsymbol{\mathfrak{u}})\,. \tag{\mathsf{B.29}}$$

By inserting (B.29) into (B.27) we prove (B.18):

$$-\mathbf{z}^{\top}\mathcal{R}\left(\mathbf{x},\mathbf{z},\mathbf{u}\right) + \mathbf{z}^{\top}\mathbf{G}\left(\mathbf{x}\right)\mathbf{\widetilde{u}} = \mathbf{u}\_{\mathrm{R}}^{\top}\mathbf{y}\_{\mathrm{R}} + \underline{\mathbf{u}}^{\top}\mathbf{G}^{\top}(\mathbf{x})^{\top}\mathbf{\widetilde{z}} + \mathbf{u}^{\top}\boldsymbol{\mathcal{P}}^{\boldsymbol{\rho}}(\mathbf{x},\mathbf{z},\mathbf{u})$$

$$\Leftrightarrow \quad -\mathbf{z}^{\top}\,\boldsymbol{\mathcal{R}}\left(\mathbf{x},\mathbf{z},\mathbf{u}\right) - \mathbf{u}^{\top}\,\boldsymbol{\mathcal{P}}\left(\mathbf{x},\mathbf{z},\mathbf{u}\right) = \mathbf{u}\_{\mathrm{R}}^{\top}\mathbf{y}\_{\mathrm{R}} \leq \,\,\mathbf{0}.\tag{\mathsf{B.30}}$$

To the best of our knowledge, the explicit PHS (B.17) has not been presented in the literature so far. The next proposition shows that this PHS is passive.

**Proposition B.7 (Passivity of a PHS with nonlinear dissipation)** *The explicit port-Hamiltonian model from* (B.17) *is passive.*

#### Proof:

Recall that *z* = ∂*V* ∂ *x* (*x*) where *V* (*x*) is a storage function that is bounded from below. We always find a constant *<sup>c</sup>* <sup>∈</sup> <sup>R</sup>≥<sup>0</sup> such that *<sup>V</sup>*˜ (*x*) = *<sup>V</sup>* (*x*) + *<sup>c</sup>* is a non-negative function. The derivative of *V*˜ (*x*) with respect to time reads

$$\begin{split} \dot{\boldsymbol{V}} \left( \mathbf{x} \right) = \left( \frac{\partial \boldsymbol{\mathcal{V}}}{\partial \mathbf{x}} \left( \mathbf{x} \right) \right)^{\top} \dot{\mathbf{x}} = \left( \frac{\partial \boldsymbol{V}}{\partial \mathbf{x}} \left( \mathbf{x} \right) \right)^{\top} \dot{\mathbf{x}} \\ = \mathbf{z}^{\top} \left( \mathbf{J} \left( \mathbf{x} \right) \mathbf{z} - \mathcal{R} \left( \mathbf{x}, \mathbf{z}, \mathbf{u} \right) + \mathbf{G} \left( \mathbf{x} \right) \mathbf{u} \right) \\ = -\mathbf{z}^{\top} \mathcal{R} \left( \mathbf{x}, \mathbf{z}, \mathbf{u} \right) + \mathbf{z}^{\top} \mathbf{G} \left( \mathbf{x} \right) \mathbf{u} . \end{split} \tag{\mathbf{B.31}}$$

Transposing (B.17b) and multiplying with *u* from the right gives

$$\mathbf{y}^{\top}\boldsymbol{\mathfrak{u}} = \mathbf{z}^{\top}\mathbf{G}\left(\mathbf{x}\right)\boldsymbol{\mathfrak{u}} + \boldsymbol{\mathcal{O}}^{\boldsymbol{\mathcal{P}}^{\top}}\left(\mathbf{x}, \mathbf{z}, \boldsymbol{\mathfrak{u}}\right)\boldsymbol{\mathfrak{u}}$$

$$\Leftrightarrow \quad \mathbf{z}^{\top}\mathbf{G}\left(\mathbf{x}\right)\boldsymbol{\mathfrak{u}} = \mathbf{y}^{\top}\boldsymbol{\mathfrak{u}} - \mathbf{u}^{\top}\boldsymbol{\mathcal{O}}^{\boldsymbol{\mathcal{P}}}\left(\mathbf{x}, \mathbf{z}, \boldsymbol{\mathfrak{u}}\right). \tag{\mathsf{B.32}}$$

Inserting (B.32) into (B.31) then yields

$$\begin{split} \mathring{\boldsymbol{V}} \left( \mathbf{x} \right) &= -\mathbf{z}^{\top} \boldsymbol{\mathcal{A}} \left( \mathbf{x}, \mathbf{z}, \boldsymbol{\mathfrak{u}} \right) + \mathbf{y}^{\top} \boldsymbol{\mathfrak{u}} - \mathbf{u}^{\top} \boldsymbol{\mathcal{P}} \left( \mathbf{x}, \mathbf{z}, \boldsymbol{\mathfrak{u}} \right) \\ &= \mathbf{y}^{\top} \boldsymbol{\mathfrak{u}} - \underbrace{\begin{pmatrix} \mathbf{z} \\ \mathbf{u} \end{pmatrix}^{\top} \begin{pmatrix} \boldsymbol{\mathcal{A}} \left( \mathbf{x}, \mathbf{z}, \mathbf{u} \right) & \mathbf{0} \\ \boldsymbol{0} & \boldsymbol{\mathcal{P}} \left( \mathbf{x}, \mathbf{z}, \mathbf{u} \right) \end{pmatrix}}\_{\geq 0} \leq \mathbf{y}^{\top} \boldsymbol{\mathfrak{u}}. \end{split} \tag{\mathsf{B.33}}$$

For the case of no feedthrough we obtain from Proposition B.6 the "inputstate-output PHS with nonlinear resistive structure" introduced by van der Schaft [2017, Def. 6.1.4]. This special case is outlined in the subsequent corollary.

#### **Corollary B.8 (PHS with nonlinear dissipation from van der Schaft [2017])**

*Given an explicit Dirac structure* (B.14) *which satisfies Assumption B.5. Let <sup>Z</sup>*RP (*x*) = <sup>0</sup> *and <sup>Z</sup>*PP (*x*) = <sup>0</sup> *for all <sup>x</sup>* <sup>∈</sup> <sup>X</sup>*. Equations* (B.14)*,* (B.15)*, and* (B.16) *can be written as explicit input-state-output PHS of the form*

$$\mathbf{x} = \mathbf{J}\left(\mathbf{x}\right)\mathbf{z} - \mathcal{R}\left(\mathbf{x}, \mathbf{z}, \mathbf{u}\right) + \mathbf{G}\left(\mathbf{x}\right)\mathbf{u},\tag{\mathsf{B.34s}}$$

$$\mathbf{y} = \mathbf{G}^{\top}(\mathbf{x})\,\mathbf{z},\tag{\text{B.34b}}$$

*where <sup>J</sup>* (*x*) = <sup>−</sup>*<sup>J</sup>* ⊤(*x*) *and z* <sup>⊤</sup><sup>R</sup> (*x*,*z*,*u*) <sup>≥</sup> <sup>0</sup> *for all <sup>x</sup>* <sup>∈</sup> <sup>X</sup>*, <sup>z</sup>* <sup>∈</sup> <sup>R</sup> *n , u* ∈ U*.*

#### Proof:

The proof follows from Proposition B.6 under *Z*RP (*x*) = 0 and *Z*PP (*x*) = 0.

## B.5 Notes to Section 3.3

The following notes provide some additional information to the discussion from Section 3.3, especially with regard to the related literature:

*Theorems 3.35 and 3.47 are the first to give rigorous existence conditions for the complete transfer from a bond graph to an explicit PHS.* In the literature, there exist some existence conditions for intermediate steps of this transfer. Golo et al. [2000] and Golo et al. [2003] show that the junction structure of a bond graph can always be related to a Dirac structure in implicit form. This is in line with our findings from Theorem 3.35.Donaire and Junco [2009] provide sufficient conditions for the transfer from a Dirac structure in explicit form to a non-feedthrough PHS. Theorems 3.35 and 3.47 put the conditions of Golo et al. [2000], Golo et al. [2003], and Donaire and Junco [2009] into the perspective of an explicit port-Hamiltonian formulation of bond graphs. It turns out, that the most crucial step for such a formulation is the transfer of the Dirac structure from an implicit to an explicit representation. Concerning this transfer, Theorem 3.35 is the first to provide necessary and sufficient conditions.

*The sufficient existence condition from Theorem 3.35 makes the well-known conditions for the derivation of an explicit PHS mathematically traceable.* In the literature, there exist three well-known prerequisites under which a system can be formulated as an explicit PHS, see, e.g., van der Schaft [2009, p. 70] or van der Schaft and Jeltsema [2014, p. 53]. The class of explicit input-state-output

PHS occurs if "(1) the external port variables can be split into input and output variables, (2) there are no algebraic constraints between the state variables, and (3) the resistive structure is linear and of input-output form"<sup>1</sup> [van der Schaft and Jeltsema, 2014, p. 53]. These conditions are formulated only verbally which makes them mathematically untraceable and hampers their practical evaluation. For the particular case of bond graph systems, Theorem 3.35 provides remedy as it gives mathematically traceable representations of the three conditions (1), (2), and (3), viz. assumptions 3.22, 3.27, and 3.30, respectively. Based on these assumptions, computer algebra systems can evaluate if an explicit PHS exists or not.

*The existence conditions from Theorem 3.35 are related to the existence condition for an implicit port-Hamiltonian formulation of a bond graph.* Golo et al. [2003] shows that each well-posed bond graph<sup>2</sup> permits an implicit port-Hamiltonian formulation. Assumption 3.22 (i.e., the independence of sources) is a necessary condition for a bond graph to be well-posed. Moreover, Assumption 3.27 (i.e., the independence of sources and the independence of storages) is sufficient for the well-posedness. In consequence, each explicit PHS obtained from Theorem 3.35 permits an implicit representation. This is intuitive as the class of implicit PHSs is more general than the class of explicit PHSs. Lopes [2016] gives conditions under which an implicit PHS can be transferred into an explicit PHS [Lopes, 2016, Propriété 6]. However, the results from Theorem 3.35 show that the conditions from Lopes [2016] are unnecessarily strict.

*Assumptions 3.22 and 3.27 can be interpreted by means of bond graph causality.* The transfer of the Dirac structure from an implicit to an explicit form can be interpreted as the causalization of the bond graph.<sup>3</sup> A first indication of this interpretation has already been given by Lopes [2016]. A causality-based interpretation of assumptions 3.22 and 3.27 reads "in the causal bond graph, all sources have proper causality" and "in the causal bond graph, all sources have proper causality and all storages are in preferred (integral) causality", respectively.

*Theorem 3.47 generalizes the results from previous literature on state-space models of systems with dependent storages.* In bond graph theory, dependent storages are well-known to lead in general to models in the form of DAEs (cf. Borutzky [2010, pp. 142–143]). Nevertheless, Theorem 3.47 states that

<sup>1</sup>Compared to the original texts, the points (1) and (2) have been switched in the order.

<sup>2</sup>For the well-posedness of a bond graph the reader is asked to refer to Golo et al. [2003, Def. 2].

<sup>3</sup>For the concept of bond graph causality refer to Borutzky [2010, pp. 92ff.].

(under the given conditions) we can obtain a PHS in the form of an ODE. This insight is in line with some previous results from the literature. For linear systems, Wellstead [1979] has shown that if Assumption 3.37 is satisfied we can always obtain an explicit state-space model in spite of the presence of dependent storages. Theorem 3.47 generalizes the results from Wellstead [1979] to nonlinearities in the junction structure. Moreover, the insights from Theorem 3.47 are in line with the findings of Donaire and Junco [2009]. Compared to Donaire and Junco [2009], however, Theorem 3.47 is more general as it allows for systems that possibly contain feedthrough. Najnudel et al. [2018] stated conditions under which the dependent storages can be expressed by independent storages. However, the work of Najnudel et al. [2018] is restricted to dependent storages that occur from the parallel or serial interconnection of storage elements. Theorem 3.47 generalizes these results to more subtle structures which lead to the dependence between storage elements.

*Algorithms 3.36 and 3.48 are the first to enable a fully automated generation of explicit port-Hamiltonian models.* In the literature, there exists various algorithms that are related to algorithms 3.36 and 3.48. Golo et al. [2000] present an algorithm which determines a Dirac structure in explicit form based on a bond graph [Golo et al., 2000, Algorithm 3]. The algorithm is based on graphical manipulations. Dai [2016] provides an algorithm for the generation of a Dirac structure in implicit form [Dai, 2016, Algorithm 1]. Moreover, the author provides an algorithm for transferring a Dirac structure from an implicit to an explicit form [Dai, 2016, Algorithm 4].Donaire and Junco [2009] derive calculation rules for the matrices of a PHS based on a Dirac structure in explicit form [Donaire and Junco, 2009, Theorem 1]. An algorithm for the determination of an implicit PHS from an analog circuit was proposed by Falaize and Hélie [2016]. The algorithm is implemented in a Python program package named PyPHS, see Falaize and Hélie [2019]. As can be seen, different aspects concerning an automated generation of explicit port-Hamiltonian models have been addressed in the literature. However, algorithms 3.36 and 3.48 are the first to fully automate the derivation of an explicit PHS.

# Appendix C

## Appendices for Chapter 4

## C.1 Detectability, Strong Detectability, and Strong∗ Detectability

This section gives a brief introduction into the concepts of detectability, strong detectability, and strong<sup>∗</sup> detectability. The latter is of particular importance for the observer design in Subsection 4.2.1.

Consider a linear state-space system in standard form:

$$
\dot{\mathbf{x}} = \mathbf{A}\mathbf{x} + \mathbf{B}\boldsymbol{u}, \quad \left.\mathbf{x}\right|\_{t=0} = \mathbf{x}\_0,\tag{\mathsf{C.1a}}
$$

$$\mathbf{y} = \mathbf{C}\mathbf{x} + \mathbf{D}\mathbf{u}.\tag{\mathsf{C.1b}}$$

The following definition is inspired by Sontag [1998, p. 329]:

**Definition C.1 (Detectability)** *The system* (C.1) *is detectable if in the autonomous system <sup>y</sup>* <sup>≡</sup> <sup>0</sup> *implies* lim *t*→∞ *<sup>x</sup>* <sup>→</sup> <sup>0</sup>*, for all <sup>x</sup>*0*.*

In Definition C.1, we assume the input *u* of the system to be known. Hence, the restriction to the autonomous system (i.e., the case where *<sup>u</sup>* <sup>≡</sup> 0) is without loss of generality (cf. Ludyk [1995, p. 7]). In the following, the concept of detectability is extended to systems with unknown inputs. This leads us to the definitions of *strong detectability*, and *strong*<sup>∗</sup> *detectability* as introduced by Hautus [1983].

**Definition C.2 (Strong detectability)**

*The system* (C.1) *is strong detectable if <sup>y</sup>* <sup>≡</sup> <sup>0</sup> *implies* lim *t*→∞ *<sup>x</sup>* <sup>→</sup> <sup>0</sup>*, for all <sup>x</sup>*<sup>0</sup> *and u.*

#### **Definition C.3 (Strong**<sup>∗</sup> **detectability)** *The system* (C.1) *is strong*<sup>∗</sup> *detectable if* lim *t*→∞ *y* → 0 *implies* lim *t*→∞ *x* → 0*.*

Note that strong<sup>∗</sup> detectability implies strong detectability.

## C.2 Specification of the Eigenvalues for the Error Dynamics Matrix

The state reconstruction error dynamics of the observer proposed in Theorem 4.8 obey ε˙ = *N*ε (i.e., (4.13) under (4.14)). The design of the observer is conducted with Algorithm 4.10. In code line 21 of Algorithm 4.10, we have to specify the eigenvalues of the matrix *N*. Here, an automatable procedure for this is proposed.

Recall (4.18), i.e,

$$\mathbf{N} = \mathbf{K}\mathbf{A} - \mathbf{Z}\bar{\mathbf{C}} \tag{\mathbb{C}.2}$$

and define *A*¯ := *KA*. Let Assumption 4.7 hold. Then the pair *A*¯ ,*C*¯ is detectable (cf. Darouach et al. [1994, Theorem 2] and Hautus [1983, Theorem 1.5]).

First, we apply a Kalman decomposition with respect to observability to *A*¯ ,*C*¯ . Let *<sup>O</sup>* <sup>∈</sup> <sup>R</sup> *qn*¯ <sup>×</sup>*<sup>n</sup>* denote the observability matrix of *A*¯ ,*C*¯ with *<sup>r</sup>* <sup>=</sup> rank(*O*)(<sup>≤</sup> *<sup>n</sup>*). Collect *<sup>r</sup>* linear independent rows of *<sup>O</sup>* in a matrix *<sup>T</sup>* <sup>1</sup> <sup>∈</sup> <sup>R</sup> *r*×*n* . The rows of *T* <sup>1</sup> span the observable subspace. Collect the vectors of a basis of ker(*O*) in a matrix *<sup>T</sup>* <sup>2</sup> <sup>∈</sup> <sup>R</sup> (*n*−*r*)×*n* . The rows of *T* <sup>2</sup> span the orthogonal complement of the observable subspace.

Conjugating (C.2) with *T* := *T* ⊤ <sup>1</sup> *T* ⊤ 2 ⊤ gives

$$\underbrace{\mathbf{T}\mathbf{M}\mathbf{T}^{-1}}\_{=:\mathbf{A}^{\dagger}} = \underbrace{\mathbf{T}\bar{\mathbf{A}}\mathbf{T}^{-1}}\_{=:\mathbf{A}^{\dagger}} - \underbrace{\mathbf{T}\mathbf{Z}}\_{=:\mathbf{C}^{\dagger}}\underbrace{\mathbf{C}\mathbf{T}^{-1}}\_{=:\mathbf{C}^{\dagger}}\tag{\mathsf{C.3}}$$

where

$$
\bar{\mathbf{A}}^{\dagger} = \begin{pmatrix} \bar{\mathbf{A}}\_{11}^{\dagger} & \mathbf{0} \\ \bar{\mathbf{A}}\_{21}^{\dagger} & \bar{\mathbf{A}}\_{22}^{\dagger} \end{pmatrix}, \quad \bar{\mathbf{C}}^{\dagger} = \begin{pmatrix} \bar{\mathbf{C}}\_{1}^{\dagger} & \mathbf{0} \end{pmatrix}, \tag{\text{C.4}}
$$

with *A*¯ † <sup>11</sup> ∈ R *r*×*r* , *A*¯ † <sup>21</sup> ∈ R (*n*−*r*)×*r* , *A*¯ † <sup>22</sup> ∈ R (*n*−*r*)×(*n*−*r*) , and *C*¯ † <sup>1</sup> ∈ R *q*¯×*r* . Note that the eigenvalues are invariant under conjugation, i.e., the eigenvalues of *N* † are equal to the eigenvalues of *N*. Moreover, as *A*¯ ,*C*¯ is detectable, *A*¯ † <sup>22</sup> is a Hurwitz matrix.

Now we have everything prepared to specify the eigenvalues of *N*. The first *r* eigenvalues λ*i*(*N*) are placed at

$$\mathcal{A}\_{i}(\mathbf{N}) = \min \left\{ \text{Re}\left(\mathcal{A}\_{i}(\bar{\mathbf{A}}\_{11}^{\dagger})\right) - \beta, \gamma \right\},\tag{\text{C.5}}$$

where <sup>β</sup> <sup>∈</sup> <sup>R</sup>≥0, <sup>γ</sup> <sup>∈</sup> <sup>R</sup><<sup>0</sup>, and <sup>λ</sup>*i*(*A*¯ † <sup>11</sup>) the *<sup>i</sup>*-th eigenvalue of the matrix *<sup>A</sup>*¯ † 11 (*<sup>i</sup>* <sup>=</sup> <sup>1</sup>,...,*r*). The remaining *<sup>n</sup>*−*<sup>r</sup>* eigenvalues are set to

$$
\lambda\_{i+r}(\mathbf{N}) = \lambda\_i(\bar{\mathbf{A}}\_{22}^\dagger),
\tag{\mathsf{C.6}}
$$

where λ*i*(*A*¯ † <sup>22</sup>) is the *<sup>i</sup>*-th eigenvalue of the matrix *<sup>A</sup>*¯ † <sup>22</sup> (*<sup>i</sup>* <sup>=</sup> <sup>1</sup>,...,*<sup>n</sup>* <sup>−</sup> *<sup>r</sup>*). This choice is motivated by (C.3) and (C.4) which reveal the (stable) eigenvalues of *A*¯ † <sup>22</sup> are also eigenvalues of *N* † and therewith of *N*.

With the chosen eigenvalues for *N* † and (C.3) we can calculate the matrix *Z* † by using well-established pole placement techniques. Finally, by *Z* = *T* <sup>−</sup>1*Z* † we obtain the matrix *Z* in the original coordinates.

## C.3 Additional Statements for the Proof of Lemma 4.16

In the proof of Lemma 4.16, we applied Lyapunov's direct method to prove 0 to be a globally exponentially stable equilibrium point of an error system. In this proof, we made use of the following two propositions:

**Proposition C.4 (***V*˙ **for an autonomous system)** *Consider the autonomous system*

$$
\dot{\mathbf{x}} = \mathbf{A}(\mathbf{s}) \mathbf{Q} \mathbf{x},\tag{\mathsf{C} \ \mathsf{T}}.\tag{\mathsf{C} \ \mathsf{T}}.
$$

*where x* ∈ R *n , A*(*s*) ∈ R *n*×*n , and <sup>Q</sup>* <sup>∈</sup> <sup>R</sup> *<sup>n</sup>*×*<sup>n</sup> with Q* = *Q* <sup>⊤</sup> <sup>≻</sup> <sup>0</sup> *for some parameter <sup>s</sup>* <sup>∈</sup> <sup>S</sup>*. In order to analyze the stability of the equilibrium <sup>x</sup>* <sup>≡</sup> <sup>0</sup> *suppose the Lyapunov function candidate*

$$V\left(\mathbf{x}\right) = \frac{1}{2}\mathbf{x}^\top \mathbf{Q} \mathbf{x}.\tag{\text{C.8}}$$

*The derivative of* (C.8) *with respect to time can be expressed as*

$$\dot{V}\left(\mathbf{x}\right) = \mathbf{x}^\top \mathbf{Q} \left(\frac{1}{2}\left(\mathbf{A}(\mathbf{s}) + \mathbf{A}^\top(\mathbf{s})\right)\right) \mathbf{Q} \mathbf{x}.\tag{\mathsf{C.9}}$$

*Equation* (C.9) *depends only on the symmetric part of the matrix A*(*s*)*, i.e., V*˙ (*x*) *it is independent of the skew-symmetric part of A*(*s*)*.*

#### Proof:

The derivative of (C.8) reads

$$\begin{split} \dot{V}(\mathbf{x}) &= \frac{1}{2} \dot{\mathbf{x}}^{\top} \boldsymbol{\mathfrak{Q}} \mathbf{x} + \frac{1}{2} \mathbf{x}^{\top} \boldsymbol{\mathfrak{Q}} \dot{\mathbf{x}} \\ &\stackrel{(\mathbf{C.7})}{=} \frac{1}{2} (\mathbf{A}(\mathbf{s}) \boldsymbol{\mathfrak{Q}} \mathbf{x})^{\top} \boldsymbol{\mathfrak{Q}} \mathbf{x} + \frac{1}{2} \mathbf{x}^{\top} \boldsymbol{\mathfrak{Q}} \mathbf{A}(\mathbf{s}) \boldsymbol{\mathfrak{Q}} \mathbf{x} \\ &= \frac{1}{2} \mathbf{x}^{\top} \boldsymbol{\mathfrak{Q}} \mathbf{A}^{\top}(\mathbf{s}) \boldsymbol{\mathfrak{Q}} \mathbf{x} + \frac{1}{2} \mathbf{x}^{\top} \boldsymbol{\mathfrak{Q}} \mathbf{A}(\mathbf{s}) \boldsymbol{\mathfrak{Q}} \mathbf{x} \\ &= \mathbf{x}^{\top} \boldsymbol{\mathfrak{Q}} \left( \frac{1}{2} \left( \mathbf{A}(\mathbf{s}) + \mathbf{A}^{\top}(\mathbf{s}) \right) \right) \boldsymbol{\mathfrak{Q}} \mathbf{x}. \end{split} \tag{\mathsf{C.10}}$$

#### **Proposition C.5 (Lower and upper bound)**

*Given a vector <sup>x</sup>* <sup>∈</sup> <sup>R</sup> *<sup>n</sup> and a family of symmetric, positive-definite matricies D*(*s*) ∈ R *<sup>n</sup>*×*<sup>n</sup> depending continuously on some parameter <sup>s</sup>* <sup>∈</sup> <sup>S</sup> *with* <sup>S</sup> *compact. Then, there exist positive constants <sup>k</sup>*1, *<sup>k</sup>*<sup>2</sup> <sup>∈</sup> <sup>R</sup>><sup>0</sup> *such that*

$$\frac{k\_1 \left\lVert \mathbf{x} \right\rVert^2 \le \mathbf{x}^\top \mathbf{D}(\mathbf{s}) \mathbf{x} \le k\_2 \left\lVert \mathbf{x} \right\rVert^2, \quad \forall \mathbf{s} \in \mathbb{S}, \forall \mathbf{x} \in \mathbb{R}^n. \tag{\mathsf{C.11}}$$

#### Proof:

We first show that, without loss of generality, *D*(*s*) can be assumed to be diagonal.

As *D*(*s*) is symmetric there exists a continuous family of orthogonal matrices *T* (*s*) such that

$$\mathbf{x}^{\top} \mathbf{D}(\mathbf{s}) \mathbf{x} = \mathbf{x}^{\top} \mathbf{T}^{\top}(\mathbf{s}) \underbrace{\mathbf{T}(\mathbf{s}) \mathbf{D}(\mathbf{s}) \mathbf{T}^{\top}(\mathbf{s})}\_{=: \mathbf{\tilde{D}}(\mathbf{s})} \mathbf{T}(\mathbf{s}) \mathbf{x}, \tag{\mathsf{C.12}}$$

for all *<sup>s</sup>* <sup>∈</sup> <sup>S</sup> and for all *<sup>x</sup>* <sup>∈</sup> <sup>R</sup> *<sup>n</sup>* where *D*˜ (*s*) is a diagonal matrix with the (positive) eigenvalues of *D*(*s*) on its diagonal. By defining *y* := *T* (*s*)*x* we may rewrite (C.11) as

$$k\_1 \|\mathbf{y}\|^2 \le \mathbf{y}^\top \tilde{\mathbf{D}}(\mathbf{s}) \mathbf{y} \le k\_2 \|\mathbf{y}\|^2, \quad \forall \mathbf{s} \in \mathbb{S}, \forall \mathbf{y} \in \mathbb{R}^n. \tag{\mathsf{C.13}}$$

In (C.13), we use that

$$\|\|\mathbf{y}\|\|^2 = \|\mathbf{T}(\mathbf{s})\mathbf{x}\|\|^2 = \langle \mathbf{T}(\mathbf{s})\mathbf{x}, \mathbf{T}(\mathbf{s})\mathbf{x} \rangle = \langle \mathbf{x}, \mathbf{T}^\top(\mathbf{s})\mathbf{T}(\mathbf{s})\mathbf{x} \rangle = \|\mathbf{x}\|^2,\tag{\text{C.14}}$$

for all *<sup>s</sup>* <sup>∈</sup> <sup>S</sup>, i.e., the invariance of the Euclidean norm under orthogonal transformations. Equation (C.13) shows that, without loss of generality, we may assume *D*(*s*) to be diagonal.

Now for the claim from the proposition. Let *D*(*s*) be a positive-definite and diagonal matrix for all *<sup>s</sup>* <sup>∈</sup> <sup>S</sup>. Recall that *<sup>D</sup>*(*s*) depends continuously on *<sup>s</sup>*. Hence, the eigenvalues λ*i*(*s*) of *D*(*s*) are also continuous in *s* for *i* = 1,...,*n*. From the positive definiteness of *D*(*s*) and the compactness of S we conclude that all eigenvalues λ*i*(*s*) are contained in a compact subset of R><sup>0</sup>. Thus, there exist

positive constants *<sup>k</sup>*1, *<sup>k</sup>*<sup>2</sup> <sup>∈</sup> <sup>R</sup>><sup>0</sup> with *<sup>k</sup>*<sup>1</sup> <sup>≤</sup> <sup>λ</sup>*i*(*s*) <sup>≤</sup> *<sup>k</sup>*<sup>2</sup> for all *<sup>s</sup>* <sup>∈</sup> <sup>S</sup> and *<sup>i</sup>* <sup>=</sup> <sup>1</sup>,...,*n*. Such constants then fulfill (C.11) as

$$k\_1 \mathbf{x}^\top \mathbf{I} \mathbf{x} \le \mathbf{x}^\top \mathbf{D}(\mathbf{s}) \mathbf{x} \le k\_2 \mathbf{x}^\top \mathbf{I} \mathbf{x}, \quad \forall \mathbf{s} \in \mathbb{S}, \forall \mathbf{x} \in \mathbb{R}^n. \tag{\mathsf{C.15}}$$

## C.4 Automated Design of a Feedback Controller

Subsection 4.2.2 aims at the design of observers. The resulting methods, however, can also be used for the design of controllers. In the following proposition, we use Lemma 4.17 for the automated design of an asymptotically stabilizing feedback controller for nonlinear PHSs without feedthrough:

**Proposition C.6 (Automated design of a feedback controller)** *Consider the nonlinear PHS without feedthrough from Definition 2.24:*

$$
\dot{\mathbf{x}} = \left( \mathbf{J}(\mathbf{x}) - \mathbf{R}(\mathbf{x}) \right) \frac{\partial H}{\partial \mathbf{x}} \left( \mathbf{x} \right) + \mathbf{G}(\mathbf{x}) \boldsymbol{\mu}, \tag{\text{C.1.6a}}
$$

$$\mathbf{y} = \mathbf{G}^{\top}(\mathbf{x}) \frac{\partial H}{\partial \mathbf{x}}(\mathbf{x}). \tag{\text{C.16b}}$$

*Suppose a feedback controller of the form*

$$
\mu = -\mathbf{K}\left(\mathbf{x}\right) \frac{\partial H}{\partial \mathbf{x}}\left(\mathbf{x}\right). \tag{\text{C.17}}
$$

*The condition*

$$\mathbf{R}(\mathbf{x}) + \mathbf{G}(\mathbf{x})\,\mathbf{K}(\mathbf{x}) \succ 0, \quad \forall \mathbf{x} \in \mathbb{X}, \tag{\mathsf{C.18}}$$

*is a sufficient condition for <sup>x</sup>* <sup>≡</sup> <sup>0</sup> *being an asymptotically stable equilibrium of the closed-loop system. Moreover,* (C.18) *can be fulfilled if and only if it is*

$$\begin{aligned} \text{fullfield for } \mathbf{K} \left( \mathbf{x} \right) &= \mathbf{G}^{\top} \left( \mathbf{x} \right) \text{, that is the output feedback:}\\ \mathbf{u} &= -\mathbf{G}^{\top} \left( \mathbf{x} \right) \frac{\partial H}{\partial \mathbf{x}} \left( \mathbf{x} \right) = -\mathbf{y}. \end{aligned} \tag{\text{C.19}}$$

#### Proof:

Inserting (C.17) into (C.16a) gives the closed-loop dynamics:

$$\mathbf{x} = \left( \mathbf{J}\left(\mathbf{x}\right) - \mathbf{R}\left(\mathbf{x}\right) - \mathbf{G}\left(\mathbf{x}\right) \mathbf{K}\left(\mathbf{x}\right) \right) \frac{\partial H}{\partial \mathbf{x}}\left(\mathbf{x}\right). \tag{\mathsf{C.20}}$$

As *<sup>H</sup>* (*x*) is bounded from below, we always find a constant *<sup>c</sup>* <sup>∈</sup> <sup>R</sup>≥<sup>0</sup> such that *H*˜ (*x*) = *H* (*x*) +*c* is a positive definite function. Let us apply *H*˜ (*x*) as Lyapunov function candidate to analyze the stability of the equilibrium *<sup>x</sup>* <sup>≡</sup> 0. The derivative of *H*˜ (*x*) with respect to time reads:

$$\begin{split} \dot{\boldsymbol{H}} \left( \mathbf{x} \right) &= \left( \frac{\partial \tilde{H}}{\partial \mathbf{x}} \left( \mathbf{x} \right) \right)^{\top} \mathbf{x} = \left( \frac{\partial H}{\partial \mathbf{x}} \left( \mathbf{x} \right) \right)^{\top} \mathbf{x} \\ &\stackrel{\text{(C.20)}}{=} \left( \frac{\partial H}{\partial \mathbf{x}} \left( \mathbf{x} \right) \right)^{\top} \left( \mathbf{J} \left( \mathbf{x} \right) - \mathbf{R} \left( \mathbf{x} \right) - \mathbf{G} \left( \mathbf{x} \right) \mathbf{K} \left( \mathbf{x} \right) \right) \frac{\partial H}{\partial \mathbf{x}} \left( \mathbf{x} \right) \\ &= - \left( \frac{\partial H}{\partial \mathbf{x}} \left( \mathbf{x} \right) \right)^{\top} \left( \mathbf{R} \left( \mathbf{x} \right) + \mathbf{G} \left( \mathbf{x} \right) \mathbf{K} \left( \mathbf{x} \right) \right) \frac{\partial H}{\partial \mathbf{x}} \left( \mathbf{x} \right) . \end{split} \tag{C.21}$$

Let (C.18) hold. Then, we have ˙*H*˜ <sup>&</sup>lt; <sup>0</sup> for all *<sup>x</sup>* ̸<sup>=</sup> <sup>0</sup> and ˙*H*˜ <sup>=</sup> <sup>0</sup> for *<sup>x</sup>* <sup>=</sup> 0. Hence, (C.18) is a sufficient condition for *<sup>x</sup>* <sup>≡</sup> <sup>0</sup> being asymptotically stable. The rest follows from Lemma 4.17.

# Appendix D

## Appendices for Chapter 5

## D.1 Design of a WLS Estimator for Section 5.2

Section 5.2 addresses the observation of the IEEE 33 Bus System. We compare the performance of an observer generated with AMOTO with the performance of a WLS estimator. Here, it is illustated that this WLS estimator can also be generated with AMOTO.

Initially, we revise the bond graph model of the IEEE 33 Bus System from Section 5.2 under the assumption that the system is in quasi-steady state. From the resulting static bond graph model a static PHS is generated by using AMOTO. Moreover, we apply AMOTO to calculate a measurement equation for the static model. Based on the static PHS and the measurement equation we then derive a WLS estimator.

#### D.1.1Static Bond Graph Model

In the bond graph model from Section 5.2, the elements *<sup>i</sup>* <sup>∈</sup> <sup>V</sup>I, *<sup>i</sup>* <sup>∈</sup> <sup>V</sup>B, and *<sup>j</sup>* <sup>∈</sup> <sup>B</sup><sup>B</sup> are already described with static submodels. Hence, it suffices to reconsider the submodel of the lines *<sup>j</sup>* <sup>∈</sup> <sup>B</sup>I.

Let the system be in quasi-steady state. For the lines *<sup>j</sup>* <sup>∈</sup> <sup>B</sup>I, the <sup>π</sup>-equivalent circuit from Figure 5.4 then translates into the circuit in Figure D.1. The impedances from Figure D.1 can be collected in an impedence matrix:

$$\mathbf{Z}\_{j} = \begin{pmatrix} \mathbf{Z}\_{j,A,A} & \mathbf{Z}\_{jA,B} & \mathbf{Z}\_{j,A,C} \\ \mathbf{Z}\_{j,A,B} & \mathbf{Z}\_{j,B,B} & \mathbf{Z}\_{j,B,C} \\ \mathbf{Z}\_{j,A,C} & \mathbf{Z}\_{j,B,C} & \mathbf{Z}\_{j,C,C} \end{pmatrix}, \quad j \in \mathbb{B}\_{\mathrm{I}}.\tag{\mathsf{D}.\,\mathbf{1}}$$

**Figure D.1:** Quasi-steady state π-section equivalent circuit of a three-phase distribution line

The impedance matrix for the line *<sup>j</sup>* <sup>∈</sup> <sup>B</sup><sup>I</sup> is calculated from the resistance and inductance matrices from (5.1):

$$\mathbf{Z}\_{j} = \begin{pmatrix} R\_{j,A} & 0 & 0 \\ 0 & R\_{j,B} & 0 \\ 0 & 0 & R\_{j,C} \end{pmatrix} + \mathrm{i}\, 2\pi f \begin{pmatrix} L\_{jA,A} & L\_{jA,B} & L\_{jA,C} \\ L\_{jA,B} & L\_{jB,B} & L\_{jB,C} \\ L\_{jA,C} & L\_{jB,C} & L\_{jC,C} \end{pmatrix},\tag{\text{D.2}}$$

where i is the imaginary unit and *f* = 50Hz is the system frequency.

A bond graph representation of Figure D.1 is shown in Figure D.2. As can be seen, from a bond graph point of view the impedance *Z <sup>j</sup>* is a resistive element. Hence, the line model from Figure D.2 is static. Therewith, all subsystem models are static. For the IEEE 33 Bus System, a static bond graph model is given by Figure 5.6 by replacing each line model L*<sup>j</sup>* with the bond graph from Figure D.2 (*j* ∈ BI).

**Figure D.2:** Bond graph representation of the π-section model from Figure D.1

#### D.1.2Automated Model Generation

The static bond graph model of the IEEE 33 Bus System is entered into AMOTO and the automated model generation is executed. AMOTO calculates a static port-Hamiltonian model consisting only of an output equation:

$$\mathbf{y} = \mathbf{S}\mathbf{u},\tag{\mathsf{D}.3}$$

where *u*, *y* ∈ C <sup>99</sup> and *<sup>S</sup>* <sup>∈</sup> <sup>C</sup> <sup>99</sup>×<sup>99</sup> with *S* = *S* <sup>⊤</sup>. As for the dynamic model (5.2), the input vector and the output vector from (D.3) contain the bus voltages and currents, respectively. However, in the static model these quantities are not in the time-domain but in the phasor domain. The matrix *S* reflects the system topology. Moreover, we can identify the inverses of the impedance matrices (D.1) in the non-zero matrix blocks of *S*.

#### D.1.3Estimator Design

For the estimator design, we assume the same measured variables as for the observer design in Section 5.2. The measured variables are collected in a vector *m* ∈ C <sup>99</sup>. With AMOTO we calculate a measurement equation which relates the measurements to the inputs and outputs of (D.3):

$$
\mathfrak{m} = \mathbf{C}\_{\mathfrak{u}} \mathfrak{u} + \mathbf{C}\_{\mathfrak{Y}} \mathfrak{y}, \tag{\mathsf{D}.4}
$$

where *<sup>C</sup>u*,*C<sup>y</sup>* ∈ {−1,0,1} <sup>99</sup>×<sup>99</sup>. Inserting the static model (D.3) into (D.4) yields

$$\mathfrak{m} = \underbrace{(\mathbf{C}\_{\mathfrak{u}} + \mathbf{C}\_{\mathfrak{y}}\mathbf{S})}\_{=\mathbf{C}}\mathfrak{u}.\tag{\mathsf{D}.5}$$

The matrix *<sup>C</sup>* <sup>∈</sup> <sup>C</sup> <sup>99</sup>×<sup>99</sup> is quadratic and of full rank. Hence, a static input-output estimator for the IEEE 33 Bus System can be easily calculated to

$$
\hat{\mathfrak{u}} = \mathbf{C}^{-1} \mathbf{m},
\tag{\mathsf{D.6}}
$$

$$
\hat{\mathbf{y}} = \mathbf{S}\hat{\mathbf{u}},
\tag{\mathsf{D}.\mathsf{T}},
$$

where *u*ˆ ∈ C <sup>99</sup> and *<sup>y</sup>*<sup>ˆ</sup> <sup>∈</sup> <sup>C</sup> <sup>99</sup> are reconstructions of *u* and *y*, respectively.

*Remark* D.1 (WLS estimator)*.* In general, the matrix *C* is a rectangular matrix with more rows than columns. Hence, from (D.5) we in general obtain

$$
\hat{\mathfrak{u}} = \left(\boldsymbol{\mathsf{C}}^{\top}\boldsymbol{\mathsf{C}}\right)^{-1}\boldsymbol{\mathsf{C}}^{\top}\boldsymbol{\mathsf{m}}.\tag{\mathsf{D}.\mathsf{B}}.\tag{\mathsf{D}.\mathsf{B}}.
$$

This is the well known WLS estimator from the power systems literature under unit covariance.

## D.2 Definition of the Relative Error Signal Power

In Subsection 5.2.7, we use the relative error signal power (RESP) as a measure for similarity of a signal to a benchmark signal. In this section, the RESP is formally introduced.

Consider a benchmark time-signal *<sup>s</sup>*bm : [0,*T*] <sup>→</sup> <sup>R</sup>, *<sup>t</sup>* 7→ *<sup>s</sup>*bm(*t*). The mean power of the signal *s*bm(*t*) is

$$p\_{\rm bm} = \frac{1}{T} \int\_0^T s\_{\rm bm}^2(t) \mathbf{d}t. \tag{\Box. 9}$$

Furthermore, consider a second signal *<sup>s</sup>*ap(*t*): [0,*T*] <sup>→</sup> <sup>R</sup>, *<sup>t</sup>* 7→ *<sup>s</sup>*ap(*t*) which represents an approximation of the signal *s*bm(*t*). This approximation may stem, e.g., from a model or an observer. We define the *error signal* as <sup>ε</sup>(*t*) :<sup>=</sup> *<sup>s</sup>*bm(*t*)−*s*ap(*t*). The (mean) *error signal power* is defined as

$$p\_{\varepsilon} := \frac{1}{T} \int\_{0}^{T} \mathfrak{e}(t)^{2} \mathrm{d}t = \frac{1}{T} \int\_{0}^{T} \left(\mathrm{s\_{bm}}(t) - \mathrm{s\_{ap}}(t)\right)^{2} \mathrm{d}t. \tag{\mathsf{D.10}}$$

The RESP is defined as the quotient of (D.9) and (D.10):

$$r\_{\mathfrak{E}} := \frac{p\_{\mathfrak{E}}}{P^{\mathfrak{b}\mathfrak{m}}}.\tag{\mathsf{D}.\mathbf{11}}$$

## D.3 Numeric Data for the Simulation Results from Section 5.2

This section provides the numeric data from the simulation results in Subsection 5.2.7. Tables D.1 and D.2 display the numeric values for the RESP of the bus currents for the model (5.2) and the observer (5.4), respectively. For the model and the observer, the data underlying Figure 5.7 are given in the last column of the respective table. Likewise, Table D.3 and Table D.4 show the RESP values of the bus voltages for the observer (5.4) and the WLS estimator (D.8), respectively.


**Table D.1:** RESP of the bus currents computed from the model (5.2) in %


**Table D.2:** RESP of the bus currents computed from the observer (5.4) in %


**Table D.3:** RESP of the bus voltages computed from the observer (5.4) in %


**Table D.4:** RESP of the bus voltages computed from the WLS estimator (D.8) in %

## D.4 Numeric System Parameters for the Simulation in Section 5.3

In Section 5.3, we consider a large-scale nonlinear interconnected system depending on some symmetric, positive-definite (4×4) matrices *<sup>D</sup>*1, *<sup>j</sup>*, *<sup>D</sup>*2, *<sup>j</sup>*, *<sup>Q</sup>*1, *<sup>j</sup>* , and *Q*1, *<sup>j</sup>* (*<sup>j</sup>* <sup>∈</sup> <sup>V</sup>*<sup>s</sup>* <sup>=</sup> {1,...,15}). For the simulation of the system, we have to specify these matrices numerically. To this end, the matrices *D*1, *<sup>j</sup>*, *D*2, *<sup>j</sup>*, *Q*1, *<sup>j</sup>* , and *Q*1, *<sup>j</sup>* were chosen as diagonal matrices. The diagonal entries were specified by random numbers between 0.1 and 10. The obtained matrices are as follows:



## D.5 Numeric Data for the Simulation Results from Section 5.3

In Section 5.3, we use the time *t*δ,*<sup>i</sup>* as a measure for the convergence of a reconstruction towards the variable to reconstruct. Table D.5 depicts the values of *t*δ,*<sup>i</sup>* with δ = 0.01 for the reconstructions obtained from the centralized observer (5.12) and the distributed observer (5.14) for the 120 states of the nonlinear system (5.7).


**Table D.5:** Time *t*0.01,*<sup>i</sup>* for the centralized observer (5.12) and the distributed observer (5.14)

## D.6 Noise Study for the Observers from Section 5.3

At the end of Section 5.3, it was commented on the behavior of the centralized observer (5.12) and the distributed observer (5.14) in the presence of measurement noise. The section at hand provides the simulation details that build the basis for the comments from Section 5.3.

To analyze the behavior of the observers under measurement noise, the measurement equations (5.11) and (5.13) are extended by Gaussian random processes. The extended measurement equations for the centralized observer (5.12) and the distributed observer (5.14) read

$$
\mathfrak{m} = \mathbf{C} \lrcorner \mathbf{Q} \; \mathfrak{x} + \mathfrak{s} \; \mathfrak{z} \; , \tag{\text{D.42a}}
$$

$$\mathbf{m}\_{j} = \mathbf{C}\_{j}\mathbf{Q}\_{j}\mathbf{x}\_{j} + \mathbf{c}\_{j}, \quad \forall j \in \mathbb{V}\_{s}, \tag{D.42b}$$

respectively. In (D.42), ε and ε *<sup>j</sup>* are vector-valued Gaussian random processes with zero mean and covariance matrices σ*I* <sup>60</sup> and σ*I* <sup>4</sup>, respectively, where <sup>σ</sup> <sup>∈</sup> <sup>R</sup>≥<sup>0</sup>. The simulations of the centralized observer (5.12) and the distributed observer (5.14) are then rerun on the basis of the noisy measurements (D.42). Thereby, the noise variance is set to σ <sup>2</sup> = 10−<sup>4</sup> which leads to a mean SNR over all measurement signals of 51.8 dB. To ensure comparability, the same realization of the noise process is applied to the centralized and distributed observer. The results of the simulations under noise are presented in the sequel.

The bar diagram in Figure D.3 depicts the number of states with *<sup>t</sup>*δ,*<sup>i</sup>* <sup>≤</sup> 10s for different values of the tolerance δ. The red and brown bars correspond the centralized and the distributed observer, respectively.

For the centralized observer, there are no states with *<sup>t</sup>*δ,*<sup>i</sup>* <sup>≤</sup> 10s if <sup>δ</sup> <sup>≤</sup> <sup>10</sup>−<sup>3</sup> . For δ = 10−<sup>2</sup> and δ = 10−<sup>1</sup> , we have 24 and 108 states with *<sup>t</sup>*δ,*<sup>i</sup>* <sup>≤</sup> 10s, respectively. Only for δ = 10<sup>0</sup> , all states achieve a *<sup>t</sup>*δ,*<sup>i</sup>* <sup>≤</sup> 10s. For the distributed observer, there are 59 states with *<sup>t</sup>*δ,*<sup>i</sup>* <sup>≤</sup> 10s for <sup>δ</sup> <sup>∈</sup> [10−<sup>4</sup> ,10−<sup>3</sup> ]. For δ = 10−<sup>2</sup> , 119 states have a time *<sup>t</sup>*δ,*<sup>i</sup>* <sup>≤</sup> 10s;<sup>1</sup> for <sup>δ</sup> <sup>≥</sup> <sup>10</sup>−<sup>1</sup> all 120 states have a *<sup>t</sup>*δ,*<sup>i</sup>* <sup>≤</sup> 10s.

Figure D.3 reveals the centralized observer to be negatively influenced by the measurement noise. Thereby, the noise deteriorates the convergence behavior of

<sup>1</sup>Note that in the absence of noise there is also one state in the distributed observer which has a *t*δ,*<sup>i</sup>* > 10s for δ = 10−<sup>2</sup> , see Figure 5.14.

δ

, (D.42a)

, (D.42b)

σ

∈ R≥0. The simulations

<sup>2</sup> = 10−<sup>4</sup> which

,*<sup>i</sup>* ≤ 10 s for different

166 Appendix D. Appendices for Chapter 5

At the end of Section 5.3, it was commented on the behavior of the centralized observer (5.12) and the distributed observer (5.14) in the presence of measurement noise. The section at hand provides the simulation details that build the basis for the comments from Section 5.3. To analyze the behavior of the observers under measurement noise, the measurement equations (5.11) and (5.13) are extended by Gaussian random processes. The extended measurement equations for the centralized observer (5.12) and the distributed observer (5.14)

ε

ε

of the centralized observer (5.12) and the distributed observer (5.14) are then rerun on the basis

leads to a mean SNR over all measurement signals of 51.8 dB. To ensure comparability, the same realization of the noise process is applied to the centralized and distributed observer.

*<sup>j</sup>*, ∀ *j* ∈ V*<sup>s</sup>*

*I* <sup>4</sup>, respectively, where

*<sup>j</sup>* are vector-valued Gaussian random processes with zero

. The red and brown bars correspond the centralized and the

σ

D.6 Noise Study for the Observers from

*m* = *C Q x* +

*m <sup>j</sup>* = *C <sup>j</sup>Q <sup>j</sup>x <sup>j</sup>* +

of the noisy measurements (D.42). Thereby, the noise variance is set to

The results of the simulations under noise are presented in the sequel. The bar diagram in Figure D.3 depicts the number of states with *t*

Section 5.3

**Figure D.3:** Number of observer states with *t*δ,*<sup>i</sup>* ≤ 10 s for different values of δ for the centralized observer (5.12) and the distributed observer (5.14) in the presence of measurement noise **Figure D.3:** Number of observer states with *<sup>t</sup>*δ,*<sup>i</sup>* <sup>≤</sup> 10s for different values of <sup>δ</sup> for the centralized observer (5.12) and the distributed observer (5.14) in the presence of noise

all reconstructions. In the noise-free case, each of the 120 states has a *<sup>t</sup>*δ,*<sup>i</sup>* <sup>≤</sup> 10s for δ = 10−<sup>2</sup> (cf. Figure 5.14). In contrast, under noisy measurements this number reduces to 24 states. On the other hand, the figure shows that for *<sup>t</sup>* <sup>≥</sup> 10s all reconstructions remain in a tolerance band of width δ = 10<sup>0</sup> around the values of the true states.

For the distributed observer, the situation is different. Half of all reconstructions remain unaffected by the measurement noise. The explanation of this can be found in the subsystem observer dynamics (5.14a) and the structure of the matrices *R <sup>j</sup>* in (5.10a). The error injection, and therewith the noise, acts on the first four elements of the state vector of each subsystem state. The corresponding reconstructions converge to and remain in a tolerance band of width δ = 10−<sup>1</sup> around the value to be observed. In contrast, the last four elements of the observer state converge due to a natural damping contained in the matrix *R <sup>j</sup>*. Thereby, the matrix *<sup>R</sup> <sup>j</sup>* is a <sup>4</sup> <sup>×</sup> <sup>4</sup> block diagonal matrix. Hence, there is no coupling from the first four to the second four observer states (and vice versa) and the latter remain unaffected by the noise.

In conclusion, the above results show that those observer states converging only due to the natural damping of the system remain unaffected by the measurement noise. In contrast, in observer states influenced by the error injection the property of asymptotic convergence reduces to the convergence into a tolerance band around the value to be observed. The width δ of this tolerance band depends on the noise level.

read

respectively. In (D.42),

values of the tolerance

mean and covariance matrices

ε and ε

δ

σ*I* <sup>60</sup> and σ

## **Abbreviations**


## **List of Figures**



## **List of Tables**


## **References**


## **List of Publications and Supervised Theses**

## Journal Articles


## Refereed Conference Articles


<sup>2</sup>First four authors contributed equally to the paper and were listed in alphabetical order.

*stabilization in DC microgrids*, 4th IEEE Conference on Control Technology and Applications (CCTA), 2020, Montréal, Canada


## Invited Talks


<sup>3</sup>Authors were listed in alphabetical order.

## Supervised Student Theses


• Pol Jané-Soneira, *Dynamic modelling of variable frequency synchronous generator wind power plants*, Bachelor's thesis, Institute of Control Systems (IRS), Karlsruhe Institute of Technology (KIT), 2016

## **Thanks**

To Prof. Hohmann for being an inspiring teacher.

To Prof. Kugi for taking the time to assess this work.

To the IRS, the AES research group, to Jairo and Mathias. To Felicitas, Steven, and Frederik. To Sven for his dedication in lecturing the problem classes "Lineare Algebra II für die Fachrichtung Informatik". To Silja and Charles for excellent coding.

To Stefan, Felix, and Relax for a fruitful friendship and a critical review of this thesis.

To Umberto Eco for his book "How to Write a Thesis".

To Lena and Zoé for setting up my writing room.

#### **Karlsruher Beiträge zur Regelungs- und Steuerungstechnik (ISSN 2511-6312) Institut für Regelungs- und Steuerungssysteme**



Interconnected systems are composed of multiple subsystems interacting over a physical network through an exchange of energy. Well-known examples are power systems, district heating networks, automotive power networks, and interconnected industrial systems. The complexity of such systems brings the conventional way of developing models and observers to its limits. In consequence, models and observers are developed under severe simplifications of the systems' physics which leads to a poor applicability and underperformance.

This work provides remedy. The idea is to automate the processes of a physics-based model derivation and a model-based observer design. To this end, automatable modeling and observation methods are developed in the framework of port-Hamiltonian systems (PHSs).

The first contribution of this work is a set of methods for an automated derivation of ODE models. Starting point of these methods is a bond graph representation of the system. The main results are (i) necessary and sufficient conditions on the systems' physics to formulate a state space model and (ii) algorithms which allow for an automated ODE formulation of a bond graph system. Based hereon, the second contribution of this work is a set of methods for an automated design of observers for different classes of linear and nonlinear PHSs.

The methods and algorithms are implemented in a software prototype. The prototype is demonstrated for two exemplary systems. Symbolic models and observers with hundred and more states, inputs, and outputs are automatically generated within seconds. Numerical simulations verify the validity of the obtained models and observers. Therewith, this work is the first to consistently automate the processes of a physics-based model derivation and a model-based observer design for a wide class of interconnected systems.

Automated Model Generation and Observer Design for Interconnected Systems

ISSN 2511-6312 ISBN 978-3-7315-1135-9