If \(A\)  is PD and \(\tilde{A}=-\tilde{A}^ is skew-symmetric, then \) A+A\( is PD.\)
Lemma D.3  
Let \((B,B^{\prime })\)  with \(B,B^{\prime }\in \mathbb {R}^{n\times n}\)  be a PDMP (resp. NDMP). Then
[(i)]
\((B^{\prime },B)\)  is a PDMP (resp. NDMP);

\(B\)  and \(B^{\prime }\)  are nonsingular and \(-B^{-1}B^{\prime }\) , \(-{B^{\prime }}^{-1}B\)  are PD (resp. \(B^{-1}B^{\prime }\) , \({B^{\prime }}^{-1}B\)  are PD);

\((PBQ,PB^{\prime }Q)\)  is a PDMP (resp. NDMP) for \(P,Q\in \mathbb {R}^{n\times n}\)  with \(P\)  nonsingular, \(Q\)  orthogonal.

\([C,C^{\prime }] = [B,B^{\prime }]\;P\)  is a PDMP (resp. NDMP), where \(P\)  is a permutation matrix as in (REF ), i.e., \((C,C^{\prime })\)  results from swapping any given set of columns of \(B\)  with the corresponding columns of \(B^{\prime }\) .
We prove the results for PDMP \((B,B^{\prime })\) .
[(i)]

Follows immediately from \({y^{\prime }}^y̰=y^y̰^{\prime }\) .

Suppose \(B\)  is singular, so there exists \(y\ne 0\)  with \(By=0\) . Setting \(y^{\prime }=0\)  gives \(By+B^{\prime }y^{\prime }=0\)  with \(y,y^{\prime }\)  not both 0, but \(y^y̰^{\prime }=0\) , contradicting the definition of a PDMP.
For the second part let \(A=-B^{-1}B^{\prime }\) . For any \(y^{\prime }\ne 0\) , set \(y=-B^{-1}B^{\prime }y^{\prime }\) .
Then \(y,y^{\prime }\)  are not both 0 and \(By+B^{\prime }y^{\prime }=0\)  so \(0<{y^{\prime }}^y̰ = -{y^{\prime }}^B̰^{-1}B^{\prime }y^{\prime } = {y^{\prime }}^A̰y^{\prime }\) . Hence \(A\)  is PD.

Let \((C,C^{\prime })=(PBQ,PB^{\prime }Q)\)  with \(P,Q\)  be as stated.
For any \(y,y^{\prime }\) , not both 0, suppose that \(0 = Cy+C^{\prime }y^{\prime } = P(Bz + B^{\prime }z^{\prime })\)  where \(z=Qy\) , \(z^{\prime }=Qy^{\prime }\) . Since \(P\)  and \(Q\)  are nonsingular, \(z,z^{\prime }\)  are not both 0 and \(Bz + B^{\prime }z^{\prime }=0\) .
As \((B,B^{\prime })\)  is a PDMP, we have \(0<z^z̰^{\prime } = y^Q̰^Q̰y^{\prime }=y^y̰^{\prime }\)  since \(Q\)  is orthogonal.
Since \(y,y^{\prime }\)  were arbitrary this shows \((C,C^{\prime })\)  that is a PDMP.

Let \(y,y^{\prime }\in \mathbb {R}^n\) , not both 0, satisfy \(Cy+Cy^{\prime }=0\) .
Defining \([w;w^{\prime }]=P_\beta [y;y^{\prime }]\) , we have \(Bw+B^{\prime }w^{\prime } = Cy+C^{\prime }y^{\prime }=0\) , with \(w,w^{\prime }\)  not both 0. So \(w^w̰^{\prime }>0\)  as \((B,B^{\prime })\)  is a PDMP.
By (REF ) it holds that \(w^w̰^{\prime }=y^y̰^{\prime }\)  (as \(w_jw_j^{\prime }\)  is replaced by \(w_j^{\prime }w_j\)  for each \(j\)  where a swap was done, but the sum stays the same).
Hence \(y^y̰^{\prime }>0\) , which proves \((C,C^{\prime })\)  is a PDMP.
Lemma D.4 
Let \(B,B^{\prime }\in \mathbb {R}^{n\times n}\) .
If \(B\)  is nonsingular and \(B^{-1}B^{\prime }\)  is PD then \((B,B^{\prime })\)  is a NDMP. In particular \(A\in \mathbb {R}^{n\times n}\)  is PD if and only if \((I,A)\)  is a NDMP.

Follows directly from the previous lemma.
Lemma D.5 
If \(M = \begin{bmatrix}M_{11} &M_{12} \\M_{21} &M_{22}\end{bmatrix}\begin{matrix}\mbox{\footnotesize $n$}_1 \\\mbox{\footnotesize $n$}_2\end{matrix}\)  is PD, then
\( P = \begin{bmatrix}M_{11} - N^M̰_{21}, &M_{12} - N^M̰_{22} \\N, &I\end{bmatrix} \) 

is nonsingular for an arbitrary \(n_2\times n_1\)  matrix \(N\) .

Take any \(w = [u;v]\)  and suppose \(Pw=0\) , so
\(0 &= (M_{11} - N^M̰_{21})u + (M_{12} - N^M̰_{22})v,\qquad 0 = Nu + v{Premultiply the first equation by u^ and substitute -Nu = v given by the second equation:}0 &= u^M̰_{11}u - u^N̰^M̰_{21}u + u^M̰_{12}v - u^N̰^M̰_{22}v \\&= u^M̰_{11}u + v^M̰_{21}u + u^M̰_{12}v + v^M̰_{22}v \qquad = w^M̰ w,\) 

so \(w=0\)  by the PD assumption, proving \(P\)  is nonsingular.
Lemma D.6 
Let \(C,C^{\prime },S\in \mathbb {R}^{n\times n}\) . If \((C,C^{\prime })\)  is a PDMP and \(S=-S^, then \) M =I S
C C'\( is nonsingular.\) 

Suppose \(z = \begin{bmatrix}x\\y\end{bmatrix}\)  with \(Mz = 0\) .
So \(x + Sy = 0\) , hence \(y^x̰ = y^-Sy)) = -y^S̰y = 0\)  since \(S\)  is skew-symmetric.
Also \(Cx + C^{\prime }y = 0\) , so as \((C,C^{\prime })\)  is a PDMP we have \(x = y = 0\) , i.e. \(z = 0\) . Hence \(M\)  is nonsingular.
Passivity results
There are various notions of passivity used in the literature. For a discussion of different definitions we refer to [1]}.
Most generally, a system is passive if it can either absorb or store energy, but cannot create energy within itself.
Passivity can be characterized by a dissipation inequality [2]}.
For port-Hamiltonian systems, passivity directly follows from the power-balance.
A port-Hamiltonian system is called passive (with respect to the port variables \(\mathpzc {f}\hspace{-1.0pt}_\mathcal {P},\mathpzc {e}\hspace{0.5pt}_\mathcal {P}\)  and storage function \(\mathcal {H}\) ) if
\(\mathcal {H}(z(t_1))-\mathcal {H}(z(t_0))\le \int _{t_0}^{t_1} \mathpzc {e}\hspace{0.5pt}_\mathcal {P}^_\mathcal {P}\, dt\) 
for all time instants \(t_0\le t_1\) .
Hence, a passive system cannot store more energy in its storage function \(\mathcal {H}\)  than it is supplied with.
We also need the concept of passivity for the dissipative structure \(\mathcal {R}\)  described by a relation \(r(\iota _{\hspace{0.2pt}{\hspace{0.2pt}\texttt {D}}},\nu _{\hspace{0.2pt}{\hspace{0.2pt}\texttt {D}}})=0\) .
Definition D.7 [3]}
The resistive structure \(\mathcal {R}\)  is called passive [strictly passive] if \(\iota _{\hspace{0.2pt}{\hspace{0.2pt}\texttt {D}}}\mathop {\cdot }\nu _{\hspace{0.2pt}{\hspace{0.2pt}\texttt {D}}} \ge 0\)  [resp. \(\iota _{\hspace{0.2pt}{\hspace{0.2pt}\texttt {D}}}\mathop {\cdot }\nu _{\hspace{0.2pt}{\hspace{0.2pt}\texttt {D}}} > 0\) , except at the origin] for all consistent \((\iota _{\hspace{0.2pt}{\hspace{0.2pt}\texttt {D}}}, \nu _{\hspace{0.2pt}{\hspace{0.2pt}\texttt {D}}})\) .

Definition D.8 [4]}, [5]}
Assume that there exist a disjoint union \(\alpha \stackrel{\cdot }{\smash{\cup }}\beta ={\hspace{0.2pt}{\hspace{0.2pt}\texttt {D}}}\)  such that
\(\left.\left(\left[\frac{\partial r}{\partial \iota _{\alpha }},\frac{\partial r}{\partial \nu _{\beta }}\right]\right)\right|_{(\iota _{\hspace{0.2pt}{\hspace{0.2pt}\texttt {D}}}^*,\nu _{\hspace{0.2pt}{\hspace{0.2pt}\texttt {D}}}^*)}\qquad \text{is nonsingular}\) 

at a given consistent \((\iota ^*_{\hspace{0.2pt}{\hspace{0.2pt}\texttt {D}}},\nu ^*_{\hspace{0.2pt}{\hspace{0.2pt}\texttt {D}}})\) .
The resistive structure is called strictly locally passive at \((\iota ^*_{\hspace{0.2pt}{\hspace{0.2pt}\texttt {D}}}, \nu ^*_{\hspace{0.2pt}{\hspace{0.2pt}\texttt {D}}})\) if
\(D_{\cal R}:=-\begin{bmatrix}\frac{\partial r}{\partial \nu _{\alpha }}&\frac{\partial r}{\partial \iota _{\beta }}\end{bmatrix}^{-1}\cdot \begin{bmatrix}\frac{\partial r}{\partial \iota _{\alpha }}&\frac{\partial r}{\partial \nu _{\beta }}\end{bmatrix}.\) 

is positive definite at \((\iota ^*_{\hspace{0.2pt}{\hspace{0.2pt}\texttt {D}}}, \nu ^*_{\hspace{0.2pt}{\hspace{0.2pt}\texttt {D}}})\) .
The resistive structure \(\mathcal {R}\)  is called strictly
locally passive if \(D_{\cal R}\)  is positive definite for all consistent \((\iota ^*_{\hspace{0.2pt}{\hspace{0.2pt}\texttt {D}}}, \nu ^*_{\hspace{0.2pt}{\hspace{0.2pt}\texttt {D}}})\) .

Strict local passivity implies local passivity, the converse is not true.
Also passive components need not to be strictly locally passive as the following example shows.
Example 7 
The ideal transformer can be described by the relation
\( \begin{bmatrix}\nu _1\\\iota _2\end{bmatrix}=\begin{bmatrix}0&k\\-k&0\end{bmatrix}\begin{bmatrix}\iota _1\\\nu _2\end{bmatrix},\quad \text{where $k\in \mathbb {R}$ is the turns ratio}, \) 
see e.g. [6]}.
This resistive structure is passive, since
\(\nu _{\hspace{0.2pt}{\hspace{0.2pt}\texttt {D}}}\mathop {\cdot }\iota _{\hspace{0.2pt}{\hspace{0.2pt}\texttt {D}}}=\nu _1\iota _1+\nu _2\iota _2=k\nu _2\iota _1-k\nu _2\iota _1=0,\) 
but not strictly locally passive as (A5) is not satisfied.

From [5]} it follows that the positive definiteness of \(D_{\cal R}\)  in Definition REF  does not depend on the specific subsets \(\alpha ,\beta \) . In particular, in a strictly passive circuit one can choose arbitrarily the voltages or currents in every dissipative edge as a variable for a mixed description (REF ).
Defining
\(\bar{E}:=\frac{\partial r}{\partial \iota _{\hspace{0.2pt}{\hspace{0.2pt}\texttt {D}}}}(\iota _{\hspace{0.2pt}{\hspace{0.2pt}\texttt {D}}}^*, \nu _{\hspace{0.2pt}{\hspace{0.2pt}\texttt {D}}}^*), \text{ and } \bar{D}:=\frac{\partial r}{\partial \nu _{\hspace{0.2pt}{\hspace{0.2pt}\texttt {D}}}}(\iota _{\hspace{0.2pt}{\hspace{0.2pt}\texttt {D}}}^*, \nu _{\hspace{0.2pt}{\hspace{0.2pt}\texttt {D}}}^*)\) 
strict local passivity implies that the incremental conductance and resistance matrices
\(\bar{G}:=-\bar{E}^{-1}\bar{D} \quad \text{and}\quad \bar{R}:= -\bar{D}^{-1}\bar{E}\) 

are well-defined and positive definite (cf. [5]}).
In the linear setting (A5) reads
\(D \nu _{\hspace{0.2pt}{\hspace{0.2pt}\texttt {D}}}+ E \iota _{\hspace{0.2pt}{\hspace{0.2pt}\texttt {D}}}= 0\qquad \text{for some }D,E\in \mathbb {R}^{n_{\hspace{0.2pt}{\hspace{0.2pt}\texttt {D}}}\times n_{\hspace{0.2pt}{\hspace{0.2pt}\texttt {D}}}}\) 

with positive definite pair \((D,E)\)  so that \(G=-E^{-1}D\)  (or equivalently \(R:= -D^{-1}E\) ) are positive definite.
Note that in the linear setting these properties are globally defined.
Within the port-Hamiltonian setting, the dissipative structure is defined by \(\mathcal {R}\subset \mathpzc {F}_\mathcal {R}\times \mathpzc {E}_\mathcal {R}\)  with \(\mathpzc {e}\hspace{0.5pt}_\mathcal {R}\mathop {\cdot }\mathpzc {f}\hspace{-1.0pt}_\mathcal {R}\le 0\) .
Non-negativity of the dissipative power flow \(\mathpzc {e}\hspace{0.5pt}_\mathcal {R}\mathop {\cdot }\mathpzc {f}\hspace{-1.0pt}_\mathcal {R}\)  respects the common convention that power flows from the “boundary” ports (i.e. ports related to \(\mathcal {P}\)  and \(\mathcal {R}\) ) into the system and from the internal network (the Dirac structure) into the energy storing elements \(\mathcal {S}\) , such that in the power balance equation all flows sum up to zero.
Here, it means the power flows from the energy-dissipating elements into the Dirac structure \(\mathcal {D}\)  (cf. [9]}).
By defining \(\nu _{\hspace{0.2pt}{\hspace{0.2pt}\texttt {D}}}=\mathpzc {e}\hspace{0.5pt}_\mathcal {R}\)  and \(\iota _{\hspace{0.2pt}{\hspace{0.2pt}\texttt {D}}}=-\mathpzc {f}\hspace{-1.0pt}_\mathcal {R}\)  this setting corresponds to the sign convention in circuit analysis and in the definition of strict local passivity (e.g. the positive definiteness of conductance and resistance matrices) and
\(\mathpzc {e}\hspace{0.5pt}_\mathcal {R}\mathop {\cdot } \mathpzc {f}\hspace{-1.0pt}_\mathcal {R}\le 0 \quad \Longleftrightarrow \quad \iota _{\hspace{0.2pt}{\hspace{0.2pt}\texttt {D}}}\mathop {\cdot }\nu _{\hspace{0.2pt}{\hspace{0.2pt}\texttt {D}}}\ge 0. \) 
Using e.g. the voltage-controlled representation of resistors \(\iota _{\hspace{0.2pt}{\hspace{0.2pt}\texttt {D}}}= \bar{G} \nu _{\hspace{0.2pt}{\hspace{0.2pt}\texttt {D}}}\)  this gives
\(\iota _{\hspace{0.2pt}{\hspace{0.2pt}\texttt {D}}}\mathop {\cdot }\nu _{\hspace{0.2pt}{\hspace{0.2pt}\texttt {D}}} =\nu _{\hspace{0.2pt}{\hspace{0.2pt}\texttt {D}}}\mathop {\cdot } \bar{G} \nu _{\hspace{0.2pt}{\hspace{0.2pt}\texttt {D}}}\ge 0\quad \Longleftrightarrow \quad \bar{G}\ge 0,\) 
i.e., the resistor is passive iff \(\bar{G}\)  is positive definite.

Matlab code
Below are the Matlab functions for the circuit in Example REF  and for the Diode Clipper example generated from the CpH class, both in Model 2 form. They can be used by Matlab's [basicstyle=]ode15i solver.
flexiblefalse0truesolarized@cyansolarized@bluesolarized@redsolarized@base01solarized@base2falsefalse%@trueutf8trueφ1
numbers=left]code/daefcnExample1mm.m
flexiblefalse0truesolarized@cyansolarized@bluesolarized@redsolarized@base01solarized@base2falsefalse%@trueutf8trueφ1
numbers=left]code/daefcnDiodeClippermm.m
