1 Introduction

We consider nonlinear differential-algebraic equations (DAEs) of the form;

$$\begin{aligned} \mathbf{E}\mathbf{x}'&=\mathbf{A}\mathbf{x}+\mathbf{f}(\mathbf{E}\mathbf{x})+\mathbf{B}\mathbf{u},\quad {\mathbf {E}}{\mathbf {x}}(0)={\mathbf {E}}{\mathbf {x}}_0, \end{aligned}$$
(1a)
$$\begin{aligned} \mathbf{y}&= \mathbf{C}\mathbf{x}, \end{aligned}$$
(1b)

where \(\mathbf{f}(\mathbf{E}\mathbf{x})\in {\mathbb {R}}^{n}\) and \(\mathbf{E}\) is a singular matrix, \({\mathbf {A}}\in {\mathbb {R}}^{n\times n},\, {\mathbf {B}} \in {\mathbb {R}}^{n\times m},\, {\mathbf {C}}\in {\mathbb {R}}^{\ell \times n}\). The symbol \('\) denote time differentiation. \(\mathbf{x}\in {\mathbb {R}}^{n}\) and \({\mathbf {y}}\in {\mathbb {R}}^{\ell }\) are the state and output vectors, respectively. The input function \({\mathbf{u}}\in {\mathbb {R}}^{m}\) must be smooth enough, with the smoothness requirements depending on the index of the DAE. DAEs are known to be difficult to simulate and the level of difficulty is measured using index concepts such as differential index, tractability index, etc. The higher the index, the more difficult to simulate the DAE. Moreover, in practice, often such descriptor systems have very large n,  compared to the number m of inputs and the number \(\ell \) of outputs, which are typically small. Despite the ever increasing computational power, dynamic simulation using the system (1) is costly, see [1,2,3]. We are interested in a fast and stable prediction of the dynamics of DAE models, and therefore the application of model-order reduction (MOR) is vital. MOR aims to reduce the computational burden by generating reduced-order models (ROMs) that have lower computational cost to simulate, yet accurately represent the original large-scale system behavior. MOR replaces (1) by a ROM

$$\begin{aligned} {\mathbf {E}}_r{\mathbf {x}}_r'&={\mathbf {A}}_r{\mathbf {x}}_r+{\mathbf {f}}_r(\mathbf{E}_r{\mathbf {x}}_r)+{\mathbf {B}}_r{\mathbf {u}},\quad {\mathbf {E}}_r{\mathbf {x}}_r(0)={\mathbf {E}}_r{\mathbf {x}}_{r_0}, \end{aligned}$$
(2a)
$$\begin{aligned} {\mathbf {y}}_r&={\mathbf {C}}_r{\mathbf {x}}_r, \end{aligned}$$
(2b)

where \({\mathbf {E}}_r,{\mathbf {A}}_r\in {\mathbb {R}}^{r\times r},\, {\mathbf {f}}_r(\mathbf{E}_r{\mathbf {x}}_r)\in {\mathbb {R}}^{r},{\mathbf {B}}_r\in {\mathbb {R}}^{r\times m}\) and \({\mathbf {y}}_r\in {\mathbb {R}}^{\ell }, {\mathbf {C}}_r\in {\mathbb {R}}^{\ell \times r},\) such that the reduced-order of the state vector \({\mathbf {x}}_r\in {\mathbb {R}}^{r}\) is \(r\ll n.\) A good ROM should have small approximation error \(\Vert {\mathbf {y}}-{\mathbf {y}}_r\Vert \) in a suitable norm \(\Vert .\Vert \) for a desired range of inputs \({\mathbf {u}}.\) There are many MOR methods for nonlinear systems such as proper orthogonal decomposition (POD), POD in conjunction with the discrete empirical interpolation method (POD-DEIM), see [3,4,5]. However, applying these MOR methods directly to DAEs leads to ROMs which are inaccurate or very difficult to simulate and sometimes have no solution, see [1, 6]. It is a common practice to first convert nonlinear DAEs to ordinary differential equations (ODEs) by using index reduction (reformulation) techniques in order to be able to apply standard MOR methods for nonlinear systems such as POD. However, this index reduction may lead to drift-off effects or instabilities in the numerical solutions and may also depend on the structure of the nonlinear DAE. In [7], index-aware MOR (IMOR) methods were proposed to eliminate the index problem to allow employing standard techniques with ease. However, these methods were dedicated to linear DAEs. We propose an IMOR method for nonlinear DAEs of the form (1) which does not involve any kind of linearization. The starting point is a generalization of the index concept to this special class of nonlinear DAEs. The proposed generalization relies heavily on its linear counterpart together with some structural assumptions on the nonlinear term, and is consistent with the accepted definition of tractability index of nonlinear DAEs (see for instance [8]). The proposed IMOR approach is realized in two steps. The first step involves automatically decoupling the nonlinear DAEs into nonlinear differential and algebraic parts. Then, each part can be reduced separately using standard MOR techniques. The decoupled system generated from the first step can be used for numerical simulations by applying numerical integration on the ODE part and then solving the algebraic part.

The IMOR procedure can be applied to nonlinear DAEs of the form (1) with arbitrary index. Here we concentrate on index-1 systems, which can be used for a first assessment of the procedure. Nevertheless, we observe that index-1 DAEs can be found in relevant applications, such as in the description of gas transport networks.

The paper is organized as follows. In Sect. 2, we discuss the background of decoupling of DAEs and the tractability index. In Sect. 3, we propose the automatic decoupling of nonlinear DAEs of the form (1) using special projectors. In Sect. 4, we discuss the proposed IMOR method for nonlinear DAEs. In Sect. 5, we apply the proposed IMOR method to the nonlinear DAEs arising from gas transport networks. In the final section, we present some numerical examples illustrating the performance of the proposed method.

2 Decoupling of Linear Constant Coefficient DAEs

In this section, we repeat the procedure of decoupling linear DAEs and the theory it is based on, as this is the basis for the nonlinear decoupling.

2.1 Weierstraß Canonical Form

Our decoupling strategy was initially used to understand the underlying structure of linear constant coefficient DAEs via the Weierstraß canonical form [8, 9]. Assuming \(\mathbf{f}(\mathbf{E}\mathbf{x})=0\) and that the matrix pencil \((\mathbf{E},\mathbf{A})\) is regular, (1) can be written as a Weierstraß-Kronecker canonical form which leads to an equivalent decoupled system

$$\begin{aligned} {\tilde{\mathbf{x}}}'_1&= \mathbf{J}{\tilde{\mathbf{x}}}_1 + {\tilde{\mathbf{B}}}_1\mathbf{u}, \quad {\tilde{\mathbf{x}}}_1(0)= {\tilde{\mathbf{x}}}_{1_0}, \end{aligned}$$
(3a)
$$\begin{aligned} {\tilde{\mathbf{x}}}_2&= - \sum _{i=0}^{\mu -1}\mathbf{N}^i {\tilde{\mathbf{B}}}_2\mathbf{u}^{(i)}, \end{aligned}$$
(3b)

where \(\mathbf{J}\in {{{\mathbb {R}}}}^{k \times k}\) and \(\mathbf{N}\in {{{\mathbb {R}}}}^{(n-k)\times (n-k) }\) is a nilpotent matrix with index \(\mu .\) The vector \(\displaystyle \mathbf{u}^{(i)}=\frac{\mathrm {d}^i}{\mathrm {d}t^{i}}\mathbf{u}\in {{{\mathbb {R}}}}^m\) is the i-th derivative of the input data. The control input matrices are \({\tilde{\mathbf{B}}}_1\in {{{\mathbb {R}}}}^{k\times m}\) and \({\tilde{\mathbf{B}}}_2\in {{{\mathbb {R}}}}^{(n-k)\times {m}}.\) Subsystems (3a) and (3b) represent the inherited ODE and algebraic part, respectively, and the solutions of (1) can be obtained using \(\mathbf{x}=\mathbf{W}{\tilde{\mathbf{x}}}\) where \(\mathbf{W}^{n\times n}\) is a nonsingular matrix and \(\displaystyle {\tilde{\mathbf{x}}}=\left( {\tilde{\mathbf{x}}}_1^\mathrm {T}, {\tilde{\mathbf{x}}}_2^\mathrm {T}\right) ^\mathrm {T}. \) The vectors \( {\tilde{\mathbf{x}}}_1 \in {{{\mathbb {R}}}}^{k}\) and \( {\tilde{\mathbf{x}}}_2^{n-k}\) are commonly known as the slow and fast parts of the solution, respectively. In [9], only complex-valued matrix pencils are considered and even for a real-valued pencil the matrix \(\mathbf{J}\) in (3a) will be complex-valued in general, since in the Weierstraß canonical form \(\mathbf{J}\) contains the (possibly complex) eigenvalues of the ODE part of the pencil. This can be circumvented by using the quasi-Weierstraß form introduced in [10]. This form guarantees that \(\mathbf{J}\) and \(\mathbf{N}\) have entries in the same field as those of \((\mathbf{E},\mathbf{A})\).

An index concept was introduced to classify different types of DAEs with respect to the difficulty arising in the theoretical and numerical treatment of a given DAE. “Index” is a notion used in the theory of DAEs for measuring the distance from a DAE to its related ODE. There are several definitions of a DAE index. The index \(\mu \) in (3) is known as the Kronecker (nilpotency, differentiability) index. An equivalent decoupled system (3) shows the dependence of the solution of a linear DAE on the derivatives of the input function. In (3b), we can observe that the input function has to be at least \(\mu -1\) times differentiable. The higher the index the more differentiations of the input data are involved. Since numerical differentiation is an unstable process, the index \(\mu \) is a measure of numerical difficulty when solving the DAE. We can also observe that the initial condition \({\tilde{\mathbf{x}}}_1(0)\) of the differential part can be chosen arbitrary while \({\tilde{\mathbf{x}}}_2(0)\) has to satisfy hidden constraint

$$\begin{aligned} {\tilde{\mathbf{x}}}_2(0) = - \sum _{i=0}^{\mu -1}\mathbf{N}^i {\tilde{\mathbf{B}}}_2\mathbf{u}^{(i)}(0). \end{aligned}$$

Thus, DAE (1) has a unique classical solutions if \(\mathbf{x}(0)=\mathbf{x}_0\) is consistent. The index problem affects the choice of numerical integration schemes strongly if standard numerical integration schemes are applied to DAEs directly without decoupling. This lead to the development of numerical integration schemes which were specifically designed for DAEs, see [8, 11, 12]. Hence, a promising way to solve and apply MOR to DAEs is to first split them into differential and algebraic parts, see [6]. According to [11], transforming linear DAEs into a Kronecker canonical form is numerically infeasible and it is restricted to linear DAEs. Due to this drawback other index concepts, such as the tractability index, differentiation index, etc, see [13], were proposed with each of them stressing different aspects of the DAE. It is worth mentioning that there are other techniques, such as the staircase form [14], which avoids the computation of eigenvalues and provides a numerically stable algorithm for the decoupling of matrix pencils. We also mention the quasi-Weierstraß form from [10], which makes use of so called Wong sequences and does not require the computation of eigenvalues.

2.2 Tractability Index

In this paper, we consider the tractability index introduced in [15] and its generalization in [16] defined as in Definition 1. For a thorough discussion of this concept we refer to [8].

Definition 1

(Tractability index) Given a regular matrix pair \((\mathbf{E},\mathbf{A})\), we can define a matrix and projector chain by setting \(\mathbf{E}_{0} :=\mathbf{E}\) and \(\mathbf{A}_{0}:=\mathbf{A}\), and

$$\begin{aligned} \mathbf{E}_{j+1}&:= \mathbf{E}_{j}-\mathbf{A}_{j}{} \mathbf{Q}_{j},\quad \mathbf{A}_{j+1}:=\mathbf{A}_{j}{} \mathbf{P}_{j},\quad \text{ for }\, j\ge 0, \end{aligned}$$
(4)

where \(\mathbf{Q}_{j}\) are projectors onto \({{\mathrm {Ker} }}\, \mathbf{E}_{j}\) and \(\mathbf{P}_{j}=\mathrm {I}-\mathbf{Q}_{j}\). Then, if there exists an index \(\gamma \) such that \(\mathbf{E}_{j}\) is singular for all \(0\le j \le \gamma -1\), while \(\mathbf{E}_{\gamma }\) is non-singular, we say that \(\gamma \) is the tractability index of \((\mathbf{E},\mathbf{A})\).

It is possible to prove that such an index \(\gamma \) exists for any regular matrix pair [8]. This index criterion does not depend on the special choice of the projector functions \(\mathbf{Q}_j\), see [17]. The tractability index has gained a lot of attention since it can be calculated without the use of derivative arrays [18]. Hence, it is numerically feasible to compute the tractability index compared to computing the Kronecker index. This is the main tool that we chose in the decoupling of linear DAEs into their differential and algebraic parts, since it allows automatic decoupling procedures, see [7, 13, 16]. In order to decouple linear DAEs with index higher than one, so-called canonical projectors were introduced in [19] with additional constraints

$$\begin{aligned} {\mathbf {Q}}_j{\mathbf {Q}}_i&=0, \quad \text{ for } \quad j\>i. \end{aligned}$$
(5)

Based on these projectors, special projector bases were introduced leading to a decoupled system of the same dimension as the original, see [7]. A key step in forming the projectors in (4) is to find the initial projectors \({\mathbf {Q}}_j\) spanning the nullspaces of the usually sparse \({\mathbf {E}}_j\). Standard ways of identifying the nullspace include the singular value decomposition (SVD) or alike, which does not utilize matrix patterns and can be expensive for large-size matrices. One feasible way is to employ the sparse LU decomposition-based routine, called LUQ, see [20]. This routine was also used to construct the projector bases efficiently. This motivated the development of the index-aware MOR methods in [7]. In [7], equivalent explicit and implicit decoupling methods were proposed which are discussed in the following. According to [7], if we also assume \(\mathbf{f}({\mathbf{E}}\mathbf{x})=0\) and that the matrix pencil \((\mathbf{E},\mathbf{A})\) is regular, using the special projectors proposed in [19] and projector bases introduced in [21], DAE (1) can be rewritten into an equivalent explicit decoupled system given by

$$\begin{aligned} \xi _{p}'&={\mathbf {A}}_{p}\xi _{p}+{\mathbf {B}}_{p}{\mathbf {u}},\quad \xi _p(0)=\xi _{p_0}, \end{aligned}$$
(6a)
$$\begin{aligned} \xi _{q}&=\sum _{j=0}^{\gamma -1}{\mathscr {L}}^{j}\left( {\mathbf {A}}_{q}\xi _{p}^{(j)}+{\mathbf {B}}_{q}\mathbf{u}^{(j)} \right) \end{aligned}$$
(6b)
$$\begin{aligned} {\mathbf {y}}&={\mathbf {C}}_{p}\xi _{p}+{\mathbf {C}}_{q}\xi _{q}, \end{aligned}$$
(6c)

where \({\mathscr {L}}\in {\mathbb {R}}^{n_q\times n_q}\) is a nilpotent matrix with index \(\gamma .\) \(\mathbf{u}^{(j)}\) and \(\xi _{p}^{(j)}\) are the j-th derivatives with respect to t. The subsystems (6a) and (6b) correspond to the differential and algebraic parts of system (1). \(\xi _{p}\in {\mathbb {R}}^{n_p}\) and \(\xi _{q} \in {\mathbb {R}}^{n_q}\) are the differential and algebraic variables. The dimension of the decoupled system is given by \(n=n_p+n_q\). The original variable \(\mathbf{x}\) can be reconstructed by

$$\begin{aligned} \mathbf{x}={\mathscr {M}}_{p}\xi _{p}+{\mathscr {M}}_{q}\xi _{q}, \end{aligned}$$
(7)

where \({\mathscr {M}}_{p}\in {\mathbb {R}}^{n\times n_p}\), \({\mathscr {M}}_{q}\in {\mathbb {R}}^{n\times n_q}\), and the overall matrix \(({\mathscr {M}}_{p},{\mathscr {M}}_q)\) is invertible. Both \({\mathscr {M}}_{p}\) and \({\mathscr {M}}_{q}\) are constructed iteratively using a finite number of steps, and depend on the projector chain which leads to the index definition. We can observe that decoupled systems (3) and (6) are equivalent if \({\mathbf {A}}_{q}=0.\) Decoupled system (6) can be constructed automatically, and thus is numerically feasible. However, according to [7] the decoupling procedure of (6) involves the inversion of the non-singular matrix \(\mathbf{E}_{\gamma }\) which is costly for large-scale systems. Then, the implicit version of (6) was also proposed in [7] which does not involve the inversion of non-singular matrix \(\mathbf{E}_{\gamma }\). Using this decoupling procedure, DAE (1) can be re-written into an equivalent implicit decoupled system given by

$$\begin{aligned} {\mathbf {E}}_p\xi _{p}'&={\mathbf {A}}_{p}\xi _{p}+{\mathbf {B}}_{p}{\mathbf {u}},\quad \xi _p(0)=\xi _{p_0}, \end{aligned}$$
(8a)
$$\begin{aligned} {\mathscr {L}}_q\xi _{q}&=\sum _{j=0}^{\gamma -1}{\mathbf {N}}_q^{j}\left( {\mathbf {A}}_{q}\xi _{p}^{(j)}+{\mathbf {B}}_{q}\mathbf{u}^{(j)} \right) , \end{aligned}$$
(8b)
$$\begin{aligned} {\mathbf {y}}&={\mathbf {C}}_{p}\xi _{p}+{\mathbf {C}}_{q}\xi _{q}, \end{aligned}$$
(8c)

where \({\mathbf {N}}_q={\mathscr {L}}{\mathscr {L}}_q^{-1}\) is also a nilpotent matrix with the same index \(\gamma \) as \({\mathscr {L}}.\) The matrices \({\mathscr {L}}_q\in {\mathbb {R}}^{n_q\times n_q}\) and \({\mathbf {E}}_p\in {\mathbb {R}}^{n_p\times n_p}\) are always non-singular, see [21]. The subsystems (8a) and (8b) correspond to the differential and algebraic parts of system (1). \(\xi _{p}\in {\mathbb {R}}^{n_p}\) and \(\xi _{q} \in {\mathbb {R}}^{n_q}\) are the differential and algebraic variables. We can observe that the inherited ODEs (6a) and (8a) of the explicit and implicit decoupled systems can be simulated using standard ODE integration schemes. After obtaining the solutions of (8a), the algebraic part (8b) can be solved using numerical solvers such as LU decomposition-based routines. It is not straightforward to extend this to nonlinear DAEs. However, specific classes of nonlinear DAEs have been studied, usually those appearing in practice, namely DAEs with quadratic nonlinearity [22].

3 Decoupling of Nonlinear DAEs

In this section, we propose the decoupling of a class of nonlinear DAEs of the form (1a). This decoupling strategy is an extension of the decoupling strategy for linear DAEs proposed in [19]. A more general extension to nonlinear DAEs can be found in [8]. Here we adopt a simplified approach, which is feasible thanks to the special structure of the DAEs we are considering.

3.1 Decoupling Using Projectors

The tractability index of (1a) is independent of the nonlinearity if we assume the condition

$$\begin{aligned} \mathbf{E}{\mathscr {M}}_{q}=0. \end{aligned}$$
(9)

This implies that, after we apply the decoupling procedure for the linear part, the nonlinear term

$$\begin{aligned} \mathbf{f}(\mathbf{E}\mathbf{x})=\mathbf{f}(\mathbf{E}{\mathscr {M}}_{p}\xi _{p}) \end{aligned}$$
(10)

depends only on the differential variables. In [7], it was shown that (6) can be rewritten in the compact form

$$\begin{aligned} \xi _{p}'&={\mathbf {A}}_{p}\xi _{p}+{\mathbf {B}}_{p}{\mathbf {u}},\quad \xi _p(0)=\xi _{p_0}, \end{aligned}$$
(11a)
$$\begin{aligned} -{\mathscr {L}}\xi _{q}'&= {\mathbf {A}}_{q}\xi _{p}- \xi _{q}+{\mathbf {B}}_{q}\mathbf{u}, \end{aligned}$$
(11b)
$$\begin{aligned} {\mathbf {y}}&={\mathbf {C}}_{p}\xi _{p}+{\mathbf {C}}_{q}\xi _{q}, \end{aligned}$$
(11c)

Then using (11), we arrive at the explicit nonlinear decoupled system,

$$\begin{aligned} \xi _{p}'&={\mathbf {A}}_{p}\xi _{p}+{\mathbf {f}}_{p}(\xi _{p})+{\mathbf {B}}_{p}{\mathbf {u}},\quad \xi _p(0)=\xi _{p_0}, \end{aligned}$$
(12a)
$$\begin{aligned} -{\mathscr {L}}\xi _{q}'&= {\mathbf {A}}_{q}\xi _{p}- \xi _{q}+{\mathbf {f}}_{q}(\xi _{p})+{\mathbf {B}}_{q}\mathbf{u}, \end{aligned}$$
(12b)
$$\begin{aligned} {\mathbf {y}}&={\mathbf {C}}_{p}\xi _{p}+{\mathbf {C}}_{q}\xi _{q}. \end{aligned}$$
(12c)

The linear coefficients of the above system can be constructed in following the procedure in [7]. The nonlinear functions are defined as

$$\begin{aligned} {\mathbf {f}}_{p}(\xi _{p})&= {\mathbf {A}}_{pf}\mathbf{f}(\mathbf{E}{\mathscr {M}}_{p}\xi _{p})\in {\mathbb {R}}^{n_p} \end{aligned}$$
(13)

and

$$\begin{aligned} {\mathbf {f}}_{q}(\xi _{p})&= {\mathbf {A}}_{qf}\mathbf{f}(\mathbf{E}{\mathscr {M}}_{p}\xi _{p})\in {\mathbb {R}}^{n_q}. \end{aligned}$$
(14)

The matrix coefficients \({\mathbf {A}}_{pf} \in {\mathbb {R}}^{n_p\times n}\) and \({\mathbf {A}}_{qf} \in {\mathbb {R}}^{n_q\times n}\) can also be constructed iteratively from projector bases proposed in [7]. This procedure can be applied to systems of arbitrary index. Here, we concentrate on index-1 systems, showing the explicit form of the additional condition (9).

Setting \(\mathbf{E}_0=\mathbf{E},\quad \mathbf{A}_0=\mathbf{A},\) (1a) can be written as

$$\begin{aligned} \mathbf{E}_0\mathbf{x}'&=\mathbf{A}_0\mathbf{x}+\mathbf{f}(\mathbf{E}_0\mathbf{x})+\mathbf{B}\mathbf{u}. \end{aligned}$$
(15)

We choose a projector \(\mathbf{Q}_0\) such that \({{\mathrm {Im} }}\mathbf{Q}_0={{\mathrm {Ker} }}\mathbf{E}_0 \) and its complementary projector \(\mathbf{P}_0=\mathrm {I}-\mathbf{Q}_0.\) Using (4),

$$\begin{aligned} \mathbf{E}_1&=\mathbf{E}_0-\mathbf{A}_0\mathbf{Q}_0, \quad \mathbf{A}_1= \mathbf{A}_0\mathbf{P}_0, \end{aligned}$$

which satisfy the identities:

$$\begin{aligned} \mathbf{E}_1\mathbf{P}_0&=\mathbf{E}_0,\quad \mathbf{A}_1-\mathbf{E}_1\mathbf{Q}_0=\mathbf{A}_0. \end{aligned}$$
(16)

Substituting the above identities into (15) and simplifying leads to

$$\begin{aligned} \mathbf{E}_1\big [ \mathbf{P}_0\mathbf{x}'+\mathbf{Q}_0\mathbf{x}\big ]&= \mathbf{A}_1\mathbf{x}+\mathbf{f}(\mathbf{E}_1\mathbf{P}_0\mathbf{x})+\mathbf{B}\mathbf{u}. \end{aligned}$$
(17)

If we assume \(\mathbf{E}_1\) to be nonsingular, then (17) can be written as

$$\begin{aligned} \mathbf{P}_0\mathbf{x}'+\mathbf{Q}_0\mathbf{x}&= \mathbf{E}_1^{-1}\big [\mathbf{A}_1\mathbf{x}+\mathbf{f}(\mathbf{E}_1\mathbf{P}_0\mathbf{x})+\mathbf{B}\mathbf{u}\big ]. \end{aligned}$$
(18)

Since \(\mathbf{E}_1\) is nonsingular, then we say that the nonlinear DAE (1) is of tractability index 1. Left multiplying (18) by projectors \(\mathbf{P}_0\) and \(\mathbf{Q}_0\) separately, we obtain the differential and algebraic subsystems, respectively, of (1) given by

$$\begin{aligned} \mathbf{x}_P'&=\mathbf{P}_0 \mathbf{E}_1^{-1}\mathbf{A}_0\mathbf{x}_P+ \mathbf{P}_0 \mathbf{E}_1^{-1}\mathbf{f}(\mathbf{E}_1\mathbf{x}_P) +\mathbf{P}_0 \mathbf{E}_1^{-1}\mathbf{B}\mathbf{u}, \nonumber \\&\mathbf{x}_P(0)=\mathbf{P}_0\mathbf{x}(0), \end{aligned}$$
(19a)
$$\begin{aligned} \mathbf{x}_Q&=\mathbf{Q}_0\mathbf{E}_1^{-1}\mathbf{A}_0\mathbf{x}_P+ \mathbf{Q}_0 \mathbf{E}_1^{-1}\mathbf{f}(\mathbf{E}_1\mathbf{x}_P) +\mathbf{Q}_0 \mathbf{E}_1^{-1}\mathbf{B}\mathbf{u}, \end{aligned}$$
(19b)
$$\begin{aligned} \mathbf{y}&= \mathbf{C}\mathbf{x}_P+\mathbf{C}\mathbf{x}_Q, \end{aligned}$$
(19c)

where \(\mathbf{x}_P=\mathbf{P}_0\mathbf{x}\) and \(\mathbf{x}_Q=\mathbf{Q}_0\mathbf{x}\). It is immediate to see that condition (9) is equivalent to \(\mathbf{E}\mathbf{Q}_0=0\) in the index-1 case, which holds by construction. This procedure can be extended to higher index if projectors, constructed with the additional condition (5), are used. Then the original variable \(\mathbf{x}\) can be decomposed as [7]

$$\begin{aligned} \mathbf{x}=\mathbf{x}_P +\mathbf{x}_Q, \end{aligned}$$

with differential component \(\mathbf{x}_P=\Pi _{\gamma -1}\mathbf{x}\) and algebraic component \(\displaystyle \mathbf{x}_Q=\sum _{j=0}^{\gamma -2}\Pi _{j}\mathbf{Q}_{j+1}\mathbf{x}+\mathbf{Q}_0\mathbf{x}\), with \(\Pi _j=\mathbf{P}_0\mathbf{P}_1\ldots \mathbf{P}_j\). In order to ensure that the nonlinear term in (1a) depends only on the differential variable, that is,

$$\begin{aligned} \mathbf{f}(\mathbf{E}\mathbf{x})&=\mathbf{f}(\mathbf{E}\mathbf{x}_P+\mathbf{E}\mathbf{x}_Q)=\mathbf{f}(\mathbf{E}\mathbf{x}_p), \end{aligned}$$

we need to enforce the following condition:

$$\begin{aligned} \mathbf{E}\left( \sum _{j=0}^{\gamma -2}\Pi _{j}\mathbf{Q}_{j+1}+\mathbf{Q}_0\right) =0, \end{aligned}$$
(20)

which is equivalent to condition (9). A detailed discussion of condition (20) can be found in [23].

We can see that the decoupled system (19) is of dimension 2n while the DAE (1) is of dimension n. This implies that decoupling using projectors does not preserve the dimension of the original DAE. In the next section, we discuss how to derive a decoupled system which preserves the dimension of the nonlinear DAE (1).

3.2 Explicit Decoupling Using Bases

Projector bases can be applied to (19) as follows.

Let \(n_q=\mathrm {dim}(\mathrm {Ker}\,\mathbf{E}_0)\) and \(n_{{p}}=n-n_{{q}}.\) If, we also let \(\mathbf{q}_0 \in {{\mathrm {Im} }}\, \mathbf{Q}_0 \) and \(\mathbf{p}_0\in {{\mathrm {Im} }}\, \mathbf{P}_0{,}\) then, we can expand \({\varvec{x}}\) with respect to the bases, obtaining

$$\begin{aligned} {\varvec{x}}=\mathbf{q}_0\xi _q+\mathbf{p}_0\xi _p, \end{aligned}$$
(21)

where \(\xi _q\in {\mathbb {R}}^{n_q}, \, \xi _p\in {\mathbb {R}}^{n_p},\) which implies that \( {\varvec{x}}_P=\mathbf{p}_0\xi _p\) and \({\varvec{x}}_Q=\mathbf{q}_0\xi _q\) in (19). The left inverses of matrices \(\mathbf{q}_0\in {{{\mathbb {R}}}}^{n\times n_q}\) and \(\mathbf{p}_0\in {{{\mathbb {R}}}}^{n\times n_p}\) are denoted by \(\mathbf{q}_0^{*\mathrm {T}} \in {\mathbb {R}}^{n_q \times n}\) and \(\mathbf{p}_0^{*\mathrm {T}} \in {\mathbb {R}}^{n_p \times n},\) respectively. Substituting \({\varvec{x}}_P=\mathbf{p}_0\xi _p \, \text{ and }\) \({\varvec{x}}_Q=\mathbf{q}_0\xi _q\) into (19) leads to a decoupled system which can be left multiplied by the left inverses \(\mathbf{p}_0^{*\mathrm {T}}\) and \(\mathbf{q}_0^{*\mathrm {T}},\) respectively. This yields a decoupled system in compact form:

$$\begin{aligned} \xi _p'&= \mathbf{A}_{p}\xi _p+\mathbf{f}_p(\xi _p)+\mathbf{B}_{p}{\varvec{u}}, \quad \xi _p(0)=\mathbf{p}_0^{*\mathrm {T}}{\varvec{x}}(0), \end{aligned}$$
(22a)
$$\begin{aligned} \xi _q&= \mathbf{A}_{q} \xi _p+\mathbf{f}_q(\xi _p)+\mathbf{B}_{q} {\varvec{u}}, \end{aligned}$$
(22b)
$$\begin{aligned} \mathbf{y}&= \mathbf{C}_p\xi _p+\mathbf{C}_q\xi _q, \end{aligned}$$
(22c)

where

$$\begin{aligned} \mathbf{A}_{p}&=\mathbf{p}_0^{*\mathrm {T}}{} \mathbf{E}_1^{-1}{} \mathbf{A}_{0}\mathbf{p}_0\in {{{\mathbb {R}}}}^{n_p \times n_p},\, \mathbf{B}_{p}=\mathbf{p}_0^{*\mathrm {T}}{} \mathbf{E}_1^{-1}{} \mathbf{B}\in {{{\mathbb {R}}}}^{n_p \times m},\\ \mathbf{C}_p&=\mathbf{C}\mathbf{p}_0 \in {{{\mathbb {R}}}}^{\ell \times n_p},\, \mathbf{C}_q=\mathbf{C}\mathbf{q}_0 \in {{{\mathbb {R}}}}^{\ell \times n_q},\\ \mathbf{A}_{q}&=\mathbf{q}_0^{*\mathrm {T}}{} \mathbf{E}_1^{-1}{} \mathbf{A}_{0}\mathbf{p}_0\in {{{\mathbb {R}}}}^{n_q \times n_p} ,\, \mathbf{B}_{q}=\mathbf{q}_0^{*\mathrm {T}}{} \mathbf{E}_1^{-1}{} \mathbf{B}\in {{{\mathbb {R}}}}^{n_q \times m}. \end{aligned}$$

and

$$\begin{aligned} \mathbf{f}_p(\xi _p)&=\mathbf{p}_0^{*\mathrm {T}} \mathbf{E}_1^{-1}\mathbf{f}(\mathbf{E}_1\mathbf{p}_0\xi _p) \in {{{\mathbb {R}}}}^{n_p},\\ \mathbf{f}_q(\xi _p)&=\mathbf{q}_0^{*\mathrm {T}} \mathbf{E}_1^{-1}\mathbf{f}(\mathbf{E}_1\mathbf{p}_0\xi _p)\in {{{\mathbb {R}}}}^{n_q}. \end{aligned}$$

Using the modified decoupling procedure, we can identify the matrices in (7) with \({\mathscr {M}}_{p}=\mathbf{p}_0\), \({\mathscr {M}}_{q}=\mathbf{q}_0\), so that condition (9) is equivalent to \(\mathbf{E}\mathbf{q}_0=0\), which is satisfied by construction. We can observe that system (22) has the same structure as system (12) with matrix coefficients given by \({\mathscr {L}}=0,\quad \mathbf{A}_{pf}=\mathbf{p}_0^{*\mathrm {T}} \mathbf{E}_1^{-1}\in {{{\mathbb {R}}}}^{n_p\times n},\) and \( \mathbf{A}_{qf}=\mathbf{q}_0^{*\mathrm {T}} \mathbf{E}_1^{-1}\in {{{\mathbb {R}}}}^{n_q\times n}. \) It is clear that \(\mathbf{f}(\mathbf{E}_1\mathbf{p}_0\xi _p)=\mathbf{f}(\mathbf{E}\mathbf{p}_0\xi _p)\), in accordance with (10).

We can now observe that the total dimension of the decoupled system is \(n=n_p+n_q\), which is equal to the dimension of the nonlinear DAE (1). Instead of solving the coupled nonlinear DAE (1) we can now solve the decoupled nonlinear system (22). We obtain the solution \(\xi _p\) by applying standard integration schemes to (22a) and the solutions of \(\xi _q\) can be computed by post-processing using (22b). Then, the desired output solution can be obtained using (22c). However, we can observe that the coefficients of (22) involve computing the inverse of \(\mathbf{E}_1\) which is computationally expensive and requires large storage for large scale systems. Moreover, it also leads to dense matrix coefficients of the decoupled system (22).

3.3 Implicit Decoupling

In this subsection, we discuss a decoupling strategy which does not involve inversion of matrix \(\mathbf{E}_1\). In [7], it was shown that (8) can be rewritten in the compact form

$$\begin{aligned} {\mathbf {E}}_p\xi _{p}'&={\mathbf {A}}_{p}\xi _{p}+{\mathbf {B}}_{p}{\mathbf {u}},\quad \xi _p(0)=\xi _{p_0}, \end{aligned}$$
(23a)
$$\begin{aligned} -{\mathscr {L}}\xi _{q}'&= {\mathbf {A}}_{q}\xi _{p}- {\mathscr {L}}_q\xi _{q}+{\mathbf {B}}_{q}\mathbf{u}, \end{aligned}$$
(23b)
$$\begin{aligned} {\mathbf {y}}&={\mathbf {C}}_{p}\xi _{p}+{\mathbf {C}}_{q}\xi _{q}, \end{aligned}$$
(23c)

where \({\mathscr {L}}_q\) and \({\mathscr {L}}\) are as defined in (8). Then using the above system we can deduce the implicit nonlinear decoupled system of (1) with condition (9) given by

$$\begin{aligned} {\mathbf {E}}_p\xi _{p}'&={\mathbf {A}}_{p}\xi _{p}+\mathbf{f}_p(\xi _p)+{\mathbf {B}}_{p}{\mathbf {u}},\quad \xi _p(0)=\xi _{p_0}, \end{aligned}$$
(24a)
$$\begin{aligned} -{\mathscr {L}}\xi _{q}'&= {\mathbf {A}}_{q}\xi _{p}- {\mathscr {L}}_q\xi _{q}+\mathbf{f}_q(\xi _p)+{\mathbf {B}}_{q}\mathbf{u}, \end{aligned}$$
(24b)
$$\begin{aligned} {\mathbf {y}}&={\mathbf {C}}_{p}\xi _{p}+{\mathbf {C}}_{q}\xi _{q}, \end{aligned}$$
(24c)

where nonlinear functions \(\mathbf{f}_p(\xi _p) \in {\mathbb {R}}^{n_p}\) and \(\mathbf{f}_q(\xi _p) \in {\mathbb {R}}^{n_q}\) are defined as in (13) and (14). The construction of the matrix coefficients of system (24) can be done using the same procedure as for the case of linear DAEs in [7] for index greater than one. For simplicity, we discuss the index-1 systems.

This is done as follows. Substituting (21) into (17) leads to

$$\begin{aligned} \begin{pmatrix} \mathbf{E}_1\mathbf{p}_0&0 \end{pmatrix}\begin{pmatrix} \xi _p\\ \xi _q \end{pmatrix}'&=\begin{pmatrix} \mathbf{A}_0\mathbf{p}_0&-\mathbf{E}_1\mathbf{q}_0 \end{pmatrix}\begin{pmatrix} \xi _p\\ \xi _q \end{pmatrix}+\mathbf{f}(\mathbf{E}_1\mathbf{p}_0\xi _p)+\mathbf{B}\mathbf{u}. \end{aligned}$$
(25)

Instead of inverting matrix \(\mathbf{E}_1,\) we can decouple (25) into differential and algebraic parts using matrices \({\hat{\mathbf{p}}}_0\in {\mathbb {R}}^{n\times n_p}\) and \({\hat{\mathbf{q}}}_0 \in {\mathbb {R}}^{n\times n_{q}}\) proposed in [7] which are defined as via \({\hat{\mathbf{p}}}_0\in \mathrm {Ker} \, \mathbf{q}_0^{\mathrm {T}}\mathbf{E}_1^{\mathrm {T}}\) and \({\hat{\mathbf{q}}}_0\in \mathrm {Ker} \, \mathbf{p}_0^{\mathrm {T}}\mathbf{E}_1^{\mathrm {T}}\). Left multiplying (25) by \(\big ( {\hat{\mathbf{p}}}_0^{\mathrm {T}}\quad {\hat{\mathbf{q}}}_0^{\mathrm {T}} \big )^{\mathrm {T}}\) leads to

$$\begin{aligned} \begin{pmatrix} {\hat{\mathbf{p}}}_0^{\mathrm {T}}\mathbf{E}_1\mathbf{p}_0 &{} 0\\ 0 &{} 0 \end{pmatrix}\begin{pmatrix} \xi _p\\ \xi _q \end{pmatrix}'= & {} \begin{pmatrix} {\hat{\mathbf{p}}}_0^{\mathrm {T}}\mathbf{A}_0\mathbf{p}_0 &{} 0\\ {\hat{\mathbf{q}}}_0^{\mathrm {T}}\mathbf{A}_0\mathbf{p}_0 &{} - {\hat{\mathbf{q}}}_0^{\mathrm {T}}\mathbf{E}_1\mathbf{q}_0 \end{pmatrix}\begin{pmatrix} \xi _p\\ \xi _q \end{pmatrix}\nonumber \\&+\begin{pmatrix} {\hat{\mathbf{p}}}_0^{\mathrm {T}} \mathbf{f}(\mathbf{E}_1\mathbf{p}_0\xi _p)\\ {\hat{\mathbf{q}}}_0^{\mathrm {T}}\mathbf{f}(\mathbf{E}_1\mathbf{p}_0\xi _p) \end{pmatrix} +\begin{pmatrix} {\hat{\mathbf{p}}}_0^{\mathrm {T}} \mathbf{B}\\ {\hat{\mathbf{q}}}_0^{\mathrm {T}} \mathbf{B}\end{pmatrix}\mathbf{u}. \end{aligned}$$
(26)

The system (26) can be reduced to a nonlinear decoupled system given by

$$\begin{aligned} \mathbf{E}_p\xi '_p&=\mathbf{A}_p\xi _p+\mathbf{f}_p(\xi _p)+\mathbf{B}_p{\varvec{u}},\quad \xi _p(0)=\mathbf{p}_0^{*\mathrm {T}}{\varvec{x}}(0), \end{aligned}$$
(27a)
$$\begin{aligned} \mathbf{E}_q\xi _q&=\mathbf{A}_q\xi _p+\mathbf{f}_q(\xi _p)+\mathbf{B}_q{\varvec{u}}, \end{aligned}$$
(27b)
$$\begin{aligned} \mathbf{y}&= \mathbf{C}_p\xi _p+\mathbf{C}_q\xi _q, \end{aligned}$$
(27c)

where

$$\begin{aligned} \mathbf{E}_p&={\hat{\mathbf{p}}}_0^{\mathrm {T}}{} \mathbf{E}_0\mathbf{p}_0\in {{{\mathbb {R}}}}^{n_p\times n_p}, \quad \mathbf{A}_p={\hat{\mathbf{p}}}_0^{\mathrm {T}}{} \mathbf{A}_0\mathbf{p}_0\in {{{\mathbb {R}}}}^{n_p\times n_p},\\ \mathbf{B}_p&={\hat{\mathbf{p}}}_0^{\mathrm {T}}{} \mathbf{B}\in {{{\mathbb {R}}}}^{n_p \times m}, \qquad \quad \; \mathbf{E}_q=-{\hat{\mathbf{q}}}_0^{\mathrm {T}}{} \mathbf{A}_0\mathbf{q}_0\in {{{\mathbb {R}}}}^{n_q \times n_q}, \\ \mathbf{A}_q&={\hat{\mathbf{q}}}_0^{\mathrm {T}}{} \mathbf{A}_0\mathbf{p}_0\in {{{\mathbb {R}}}}^{n_p \times n_q}, \quad \mathbf{B}_q={\hat{\mathbf{q}}}_0^{\mathrm {T}}\mathbf{B}\in {{{\mathbb {R}}}}^{n_q \times m}. \end{aligned}$$

The nonlinear terms are defined as: \(\mathbf{f}_p(\xi _p)={\hat{\mathbf{p}}}_0^{\mathrm {T}}{\tilde{\mathbf{f}}}(\xi _p) \in {{{\mathbb {R}}}}^{n_p},\) \(\mathbf{f}_q(\xi _p)={\hat{\mathbf{q}}}_0^{\mathrm {T}}{\tilde{\mathbf{f}}}(\xi _p)\in {{{\mathbb {R}}}}^{n_q}\) where \({\tilde{\mathbf{f}}}(\xi _p)=\mathbf{f}(\mathbf{E}_1\mathbf{p}_0\xi _p)\in {{{\mathbb {R}}}}^n.\) We note that matrices \(\mathbf{E}_p\) and \(\mathbf{E}_q\) are always nonsingular. As expected, system (27) is equivalent to system (24) with matrix coefficients given by \({\mathscr {L}}=0,\,{\mathscr {L}}_q=\mathbf{E}_q\, \mathbf{A}_{pf}={\hat{\mathbf{p}}}_0^{\mathrm {T}}\in {{{\mathbb {R}}}}^{n_p\times n},\) and \( \mathbf{A}_{qf}={\hat{\mathbf{q}}}_0^{\mathrm {T}}\in {{{\mathbb {R}}}}^{n_q\times n}. \) It is also clear that \(\mathbf{f}(\mathbf{E}_1\mathbf{p}_0\xi _p)=\mathbf{f}(\mathbf{E}\mathbf{p}_0\xi _p)\), in accordance with (10). We can observe that (27) does not involve any matrix inversions. It is an implicit version of the decoupled system (22) and their output solutions must coincide. However, in practice it is computationally cheaper to construct the coefficients of (27) than those in (22). Both decoupled systems preserve the dimension and the stability of the nonlinear DAE (1). If (1) is of tractability index 1, then it can be automatically decoupled into either (27) or (22). Thus, instead of simulating (1), we can simulate its equivalent nonlinear decoupled system (27) easily using standard numerical integration and solvers. Decoupled systems (22) and (27) can be constructed in efficient way by employing the sparse LU decomposition-based routine, called LUQ, see [20], to construct the projectors and their respective bases. In the next section, we discuss how to apply MOR to (27).

4 Index-Aware MOR for Nonlinear DAEs

Here, we consider the equivalent nonlinear decoupled system (24) corresponding to the nonlinear DAE (1), but the same strategy can be applied to (12). Given such a nonlinear decoupled system, our goal is to reduce the order of differential and algebraic parts separately.

4.1 MOR for the Nonlinear Differential Subsystem

We consider the nonlinear differential subsystem of the nonlinear decoupled system (24) given by

$$\begin{aligned} \mathbf{E}_p\xi '_p&=\mathbf{A}_p\xi _p+\mathbf{f}_p(\xi _p)+\mathbf{B}_p{\varvec{u}},\quad \xi _p(0)=\mathbf{p}_0^{*\mathrm {T}}{\varvec{x}}(0), \end{aligned}$$
(28a)
$$\begin{aligned} \mathbf{y}_p&= \mathbf{C}_p\xi _p, \end{aligned}$$
(28b)

where \(\mathbf{y}_p\in {{{\mathbb {R}}}}^{\ell }\) is the output solution of the differential part. Our goal is reduction by projection of system (28). This means we want to find a linear subspace in which the solution trajectory lies approximately. This subspace is defined by its basis matrix \(\mathbf{V}_p\in {{{\mathbb {R}}}}^{n_p\times r_p}\) where \(r_p\ll n_p.\) We are interested in finding a solution \(\xi _{p_r}\in {\mathbb {R}}^{r_p}\) such that \(\xi _p\approx \mathbf{V}_p \xi _{p_r}.\) We can then project system (28) onto that subspace by Galerkin projection resulting in the reduced differential subsystem

$$\begin{aligned} \mathbf{E}_{p_r}\xi '_{p_r}&=\mathbf{A}_{p_r}\xi _{p_r}+\mathbf{f}_{p_r}(\xi _{p_r})+\mathbf{B}_{p_r}{\varvec{u}}, \end{aligned}$$
(29a)
$$\begin{aligned} \mathbf{y}_{p_r}&= \mathbf{C}_{p_r}\xi _{p_r}, \end{aligned}$$
(29b)

where \(\mathbf{E}_{p_r}=\mathbf{V}_p^{\mathrm {T}} \mathbf{E}_p \mathbf{V}_p\in {\mathbb {R}}^{r_p\times r_p},\,\mathbf{A}_{p_r}=\mathbf{V}_p^{\mathrm {T}} {\mathbf{A}}_p \mathbf{V}_p\in {\mathbb {R}}^{r_p\times r_p},\) \( \mathbf{B}_{p_r}=\mathbf{V}_p^{\mathrm {T}} \mathbf{B}_p\in {\mathbb {R}}^{r_p\times m},\, \mathbf{f}_{p_r}(\xi _{p_r})=\mathbf{V}_p^{\mathrm {T}} \mathbf{f}_p(\mathbf{V}_p \xi _{p_r})\in {\mathbb {R}}^{r_p}\) and \( \mathbf{C}_{p_r}= \mathbf{C}_p\mathbf{V}_p\in {\mathbb {R}}^{\ell \times r_p}.\) Projection matrix \(\mathbf{V}_p\) can be computed using standard MOR techniques for nonlinear systems such as POD [24]. However, if we employ model order reduction via POD by using (29a) to compute the snapshots, the nonlinearity \(\mathbf{f}_{p_r}(\xi _{p_r})=\mathbf{V}_p^{\mathrm {T}} \mathbf{f}_p(\mathbf{V}_p \xi _{p_r})\) requires computation of \(\mathbf{f}_p(\mathbf{V}_p \xi _{p_r})\) which has a complexity in the system dimension. Therefore, the discrete empirical interpolation method (DEIM) [5, 25] is often used to create a truly low-dimensional function approximating \(\mathbf{V}_p^{\mathrm {T}} \mathbf{f}_p(\mathbf{V}_p \xi _{p_r}).\) In this paper we do not consider DEIM or other hyperreduction methods.

4.2 Reduction of Algebraic Subsystem

After reducing the differential subsystem using, for example, POD, the nonlinear term in the algebraic subsystem (24b) is also affected leading to

$$\begin{aligned} { -{\mathscr {L}}\xi _{q}'}&{=} \mathbf{A}_{q}\mathbf{V}_p \xi _{p_r}{- {\mathscr {L}}_{q}\xi _{q}}+\mathbf{f}_q(\mathbf{V}_p \xi _{p_r})+\mathbf{B}_{q}{\varvec{u}}, \end{aligned}$$
(30a)
$$\begin{aligned} \mathbf{y}_q&{=} \mathbf{C}_{q}\xi _{q}, \end{aligned}$$
(30b)

where \(\mathbf{y}_q\in {{{\mathbb {R}}}}^{\ell }\) is the output solution of the algebraic part after reducing the differential subsystem. Here, we intend to reduce the size of the algebraic variables \(\xi _q\) by constructing another matrix \(\mathbf{V}_q\in {{{\mathbb {R}}}}^{n_q\times r_q}\) where \(r_q\ll n_q. \) That is, we replace (30) by a reduced algebraic subsystem given by

$$\begin{aligned} {-{\mathscr {L}}_r\xi _{q_r}'}&{=} \mathbf{A}_{q_r}\xi _{p_r}{- {\mathscr {L}}_{q_r}\xi _{q_r}}+\mathbf{f}_{q_r}(\xi _{p_r})+\mathbf{B}_{q_r}{\varvec{u}}, \end{aligned}$$
(31a)
$$\begin{aligned} \mathbf{y}_{q_r}&= \mathbf{C}_{q_r}\xi _{q_r}, \end{aligned}$$
(31b)

where \({ {\mathscr {L}}_{q_r}}= \mathbf{V}_q^\mathrm {T}{{\mathscr {L}}_q}\mathbf{V}_q\in {{{\mathbb {R}}}}^{r_q\times r_q},\, {{\mathscr {L}}_{r}=\mathbf{V}_q^\mathrm {T}{\mathscr {L}}\mathbf{V}_q \in {{{\mathbb {R}}}}^{r_q\times r_q}}, \) \( \mathbf{A}_{q_r}= \mathbf{V}_q^{\mathrm {T}} \mathbf{A}_{q}\mathbf{V}_p \in {{{\mathbb {R}}}}^{r_q\times r_p}, \, \mathbf{B}_{q_r}\in {{{\mathbb {R}}}}^{r_q\times m},\, \mathbf{C}_{q_r}= \mathbf{C}_{q} \mathbf{V}_q \in {{{\mathbb {R}}}}^{\ell \times r_q}\) and \(\mathbf{f}_{q_r}(\xi _{p_r})= \mathbf{V}_q^{\mathrm {T}}\mathbf{f}_q(\mathbf{V}_p \xi _{p_r}) \in {\mathbb {R}}^{r_q}.\) Reduction matrix \(\mathbf{V}_q\) can also be computed using the POD by taking the algebraic solutions of (24b) obtained by solving the linear system

$$\begin{aligned} {\mathscr {L}}_q\xi _{q}&=\sum _{j=0}^{\gamma -1}{\mathbf {N}}_q^{j}\left( {\mathbf {A}}_{q}\xi _{p}^{(j)}+\mathbf{f}_q^{(j)}(\xi _p)+{\mathbf {B}}_{q}\mathbf{u}^{(j)} \right) , \end{aligned}$$
(32)

where \({\mathbf {N}}_q\) is as defined in (8).

Combining (29) and (31), we obtain an index-aware reduced order model (I-ROM) of (1) given by

$$\begin{aligned} \begin{aligned} \mathbf{E}_{p_r}\xi '_{p_r}&=\mathbf{A}_{p_r}\xi _{p_r}+\mathbf{f}_{p_r}(\xi _{p_r})+\mathbf{B}_{p_r}{\varvec{u}}, \quad \xi _{p_r}(0)=\xi _{p_{r_0}},\\ { -{\mathscr {L}}_r\xi _{q_r}'}&= \mathbf{A}_{q_r}\xi _{p_r}{- {\mathscr {L}}_{q_r}\xi _{q_r}}+\mathbf{f}_{q_r}(\xi _{p_r})+\mathbf{B}_{q_r}{\varvec{u}},\\ \mathbf{y}_{r}&= \mathbf{C}_{p_r}\xi _{p_r} + \mathbf{C}_{q_r}\xi _{q_r}, \end{aligned} \end{aligned}$$
(33)

where the reduced dimension is given by \(r=r_p+r_q\ll n.\) Thus, we replace (1) with (33) instead of (2).

5 Nonlinear DAEs Arising from Gas Networks

In this section, we apply the implicit decoupling strategy proposed in Sect. 3.3 to nonlinear DAEs arising from gas flow in pipeline networks.

5.1 Index Reduction of DAEs Arising from Gas Networks

We consider a spatial discretization approach of one dimensional isothermal Euler equations arising from gas flow pipe networks proposed in [1, 26], leading to a nonlinear DAE given by

$$\begin{aligned} \vert {\mathscr {A}}_S^\mathrm {T}\vert \mathbf{p}_s' +\vert {\mathscr {A}}_0^\mathrm {T}\vert \mathbf{p}'_d&=-\mathbf{M}_L^{-1}\mathbf{q}_{-}, \end{aligned}$$
(34a)
$$\begin{aligned} \mathbf{q}'_+&=\mathbf{M}_{A}({\mathscr {A}}_S^\mathrm {T}\mathbf{p}_s+{\mathscr {A}}_0^{\mathrm {T}}\mathbf{p}_d)+\mathbf{g}(\mathbf{q}_+,\mathbf{p}_s,\mathbf{p}_d), \end{aligned}$$
(34b)
$$\begin{aligned} 0&= {\mathscr {A}}_0\mathbf{q}_+ +\vert {\mathscr {A}}_0\vert \mathbf{q}_{-}-{\mathbf {B}}_d\mathbf{d}(t), \end{aligned}$$
(34c)
$$\begin{aligned} 0&=\mathbf{p}_s-\mathbf{s}(t). \end{aligned}$$
(34d)

The unknowns are described by the pressure at the supply nodes \({\mathbf {p}}_s\in {\mathbb {R}}^{n_s}\), the pressure at all other nodes \({\mathbf {p}}_d\in {\mathbb {R}}^{n_d+n_0},\) the difference of flux over a pipe segment \({\mathbf {q}}_-\in {\mathbb {R}}^{n_E}\) and the average of the mass flux over a pipe segment \({\mathbf {q}}_+\in {\mathbb {R}}^{n_E}\), modelled over a graph with \(n_E\) edge segments, that correspond to the size of the discretization, \(n_s\) supply nodes, \(n_d\) demand nodes and \(n_0\) interior nodes. The diagonal matrices \({\mathbf {M}}_L\in {\mathbb {R}}^{n_E\times n_E}\) and \({\mathbf {M}}_A\in {\mathbb {R}}^{n_E\times n_E}\) encode parameters such as length, radius of the pipe segments as well as constants coming from the gas equation. The matrix \({\mathbf {B}}_d\in {\mathbb {R}}^{(n_d+n_0)\times n_d}\) is a matrix of ones and zeros making sure that the demand of the demand node is put at the right place in the mass flux equation. The matrix \({\mathscr {A}}_0 \in {\mathbb {R}}^{n_d\times n_{E}}\) is extracted from the incidence matrix of the graph representing the refined gas transportation network and removing the rows corresponding to the supply nodes, while \({\mathscr {A}}_S \in {\mathbb {R}}^{n_s \times n_E}\) is the matrix extracted from the incidence matrix by only taking rows corresponding to the supply nodes.The absolute value sign around the matrices \(\vert {\mathscr {A}}_0 \vert \) and \(\vert {\mathscr {A}}_S \vert \) mean that component-wise absolute values are taken to form the matrix, see [1]. The input functions \(\mathbf{d}(t)=(\ldots ,d_i(t),\ldots )^\mathrm {T}\in {\mathbb {R}}^{m_d} \) and \(\mathbf{s}(t)=(\ldots ,s_i(t),\ldots )^\mathrm {T}\in {\mathbb {R}}^{m_s}\) are vectors for flux (mass flow) at demand nodes and pressure at supply nodes, respectively. The nonlinear term

$$\begin{aligned} \mathbf{g}( \mathbf{q}_+, \mathbf{p}_d, \mathbf{p}_s)&=(\ldots ,g_k( \mathbf{q}_+, \mathbf{p}_d, \mathbf{p}_s),\ldots )^\mathrm {T}\in {\mathbb {R}}^{n_E}, \end{aligned}$$

is the vector involving friction and gravitation effects with

$$\begin{aligned} g_k( \mathbf{q}_+, \mathbf{p}_d, \mathbf{p}_s)&=-\frac{gA_k}{2\gamma _0}\psi _k(\mathbf{p}_d,\mathbf{p}_s)\frac{\Delta h_k}{L_k}-\frac{\lambda _k\gamma _0}{4 D_k A_k}\frac{\mathbf{q}_{+}^k\vert \mathbf{q}_{+}^k \vert }{\psi _k (\mathbf{p}_d,\mathbf{p}_s)}, \end{aligned}$$
(35)

where \(\psi _k (\mathbf{p}_d,\mathbf{p}_s)\) is the k-th entry of the vector-valued function:

$$\begin{aligned} \psi (\mathbf{p}_d,\mathbf{p}_s)&= \vert {\mathscr {A}}_S^\mathrm {T}\vert \mathbf{p}_s +\vert {\mathscr {A}}_0^\mathrm {T}\vert \mathbf{p}_d \in {\mathbb {R}}^{n_E}. \end{aligned}$$

The scalars \(\lambda _k, D_k, L_k\) and \(A_k\) denote friction, diameter, length and area of the pipe’s k-th segment. The scalar \(\Delta h_k\) denotes the height difference of the pipe segment. These scalar parameters in the system and those defined earlier are known at least within some range of uncertainty. System (34) can be rewritten in the form (1) leading to a system of nonlinear DAEs with dimension \(n=2n_E+n_d+n_0+n_s.\) The desired outputs in \({\mathbb {R}}^{n_s+n_d}\) can be obtained using the output equation

$$\begin{aligned} {\mathbf {y}}&=\begin{pmatrix} {\mathbf {y}}_q\\ {\mathbf {y}}_p \end{pmatrix}= \begin{pmatrix} 0 &{} \vert \mathscr {{A}}_S\vert &{} 0 &{}0\\ 0&{} 0&{} {\mathbf {B}}_d^T&{}0 \end{pmatrix}\begin{pmatrix} {\mathbf {q}}_-\\ {\mathbf {q}}_+\\ {\mathbf {p}}_d\\ {\mathbf {p}}_s\\ \end{pmatrix}, \end{aligned}$$
(36)

where \({\mathbf {y}}_q=\vert {\mathscr {A}}_S\vert {\mathbf {q}}_+\) is the mass flow at the supply nodes and \({\mathbf {y}}_p={\mathbf {B}}_d^T{\mathbf {p}}_d\) is the pressure at demand nodes. We can observe that the initial condition has to be consistent with the hidden constraints in (34). Efficient simulation of (34) has numerical integration challenges since the solutions of hyperbolic balance laws can blow-up in finite time, due to both the stiffness and index problem. In [26], an index reduction strategy was proposed to eliminate the index problem. This was done by reformulating (34) into an implicit nonlinear ODE given by

$$\begin{aligned} \begin{pmatrix} \vert {\mathscr {A}}_0\vert {\mathbf {M}}_L \vert {\mathscr {A}}_0^\mathrm {T}\vert &{}&{} 0\\ 0 &{}&{} \mathrm {I} \end{pmatrix}\begin{pmatrix} {\mathbf {p}}'_d\\ {\mathbf {q}}'_+ \end{pmatrix}= & {} \begin{pmatrix} 0 &{}&{} {\mathscr {A}}_0\\ {\mathbf {M}}_A {\mathscr {A}}_0^{T} &{}&{} 0 \end{pmatrix}\begin{pmatrix} {\mathbf {p}}_d\\ {\mathbf {q}}_+ \end{pmatrix}\nonumber \\&+\begin{pmatrix} \vert {\mathscr {A}}_0\vert {\mathbf {M}}_L \vert {\mathscr {A}}_S^\mathrm {T}\vert {\mathbf {s}}'(t)\\ {\mathbf {g}}({\mathbf {q}}_+,{\mathbf {s}}(t),{\mathbf {p}}_d) \end{pmatrix}+\begin{pmatrix} 0 &{}&{} -{\mathbf {B}}_d\\ {\mathbf {M}}_A {\mathscr {A}}_S^{T} &{}&{} 0 \end{pmatrix}\begin{pmatrix} {\mathbf {s}}(t)\\ {\mathbf {d}}(t) \end{pmatrix}.\qquad \quad \end{aligned}$$
(37)

Since from (36) we are just interested in the solutions of \( {\mathbf {q}}_+\) and \( {\mathbf {p}}_q{,}\) the dimension of the nonlinear DAE (34) can be reduced to \({\tilde{n}}= n_d+n_0+n_E\) with output equation

$$\begin{aligned} {\mathbf {y}}&={\begin{pmatrix} {\mathbf {y}}_q\\ {\mathbf {y}}_p \end{pmatrix}}= \begin{pmatrix} 0&{} \vert \mathscr {{A}}_S\vert \\ {\mathbf {B}}_d^T&{}0 \end{pmatrix}\begin{pmatrix} {\mathbf {p}}_d\\ {\mathbf {q}}_+ \end{pmatrix}. \end{aligned}$$

The generated ODE can be reduced further using standard MOR methods for nonlinear systems, such as POD, POD-DEIM, etc, applied to (37), see [1]. However, the index reduction approach presented depends on the spatial discretization approach used.

In the next section, we propose an alternative model which preserves the DAE structure independent of the spatial discretization method.

5.2 Decoupled Model of Gas Transport Networks

Here, we discuss the decoupling analysis of nonlinear DAE (34) arising from the gas transportation networks. We can observe that (34) can be re-written into the form (1) where

$$\begin{aligned} \mathbf{E}&=\begin{pmatrix} 0&{} 0&{}\vert {\mathscr {A}}_0^\mathrm {T}\vert &{} \vert {\mathscr {A}}_S^\mathrm {T}\vert \\ 0&{}\mathrm {I}&{}0&{}0\\ 0 &{} 0&{} 0&{} 0\\ 0&{} 0&{} 0 &{} 0 \end{pmatrix},\, \mathbf{A}=\begin{pmatrix} -\mathbf{M}_L^{-1} &{}0&{}0&{}0\\ 0&{}0&{}\mathbf{M}_{A}{\mathscr {A}}_0^\mathrm {T}&{} \mathbf{M}_{A}{\mathscr {A}}_S^\mathrm {T}\\ \vert {\mathscr {A}}_0\vert &{} {\mathscr {A}}_0 &{} 0&{} 0 \\ 0&{} 0&{}0&{} \mathrm {I} \end{pmatrix},\nonumber \\ \mathbf{B}&=-\begin{pmatrix} 0&{} 0\\ 0&{} 0\\ 0&{}{\mathbf {B}}_d\\ \mathrm {I}&{}0 \end{pmatrix},\, \mathbf{C}=\begin{pmatrix} 0 &{} \vert {\mathscr {A}}_S\vert &{} 0 &{}0\\ 0&{} 0&{} {\mathbf {B}}_d^\mathrm {T}&{}0 \end{pmatrix},\quad \mathbf{f}(\mathbf{E}\mathbf{x})= \begin{pmatrix} 0\\ {\tilde{\mathbf{g}}}(\mathbf{E}\mathbf{x})\\ 0\\ 0 \end{pmatrix}. \end{aligned}$$
(38)

The unknown vector \(\mathbf{x}\) and input vector \(\mathbf{u}\) are given by \(\mathbf{x}=\begin{pmatrix} \mathbf{q}_-^\mathrm {T}&\mathbf{q}_+^\mathrm {T}&\mathbf{p}_d^\mathrm {T}&\mathbf{p}_s^\mathrm {T}\end{pmatrix}^\mathrm {T}\) and \( \mathbf{u}= \begin{pmatrix} \mathbf{s}(t)^\mathrm {T}&\mathbf{d}(t)^\mathrm {T}\end{pmatrix}^\mathrm {T}, \) respectively. \({\tilde{\mathbf{g}}}(\mathbf{E}\mathbf{x})={{\tilde{\mathbf{g}}}(\psi _k(\mathbf{p}_d,\mathbf{p}_s), \mathbf{q}_+)=}(\ldots ,{\tilde{g}}_k(\psi _k(\mathbf{p}_d,\mathbf{p}_s), \mathbf{q}_+),\ldots )^\mathrm {T},\) where

$$\begin{aligned} {\tilde{g}}_k(\psi _k(\mathbf{p}_d,\mathbf{p}_s), \mathbf{q}_+)&=-\frac{gA_k}{2\mu _0}\psi _k(\mathbf{p}_d,\mathbf{p}_s)\frac{\Delta h_k}{L_k}-\frac{\lambda _k\mu _0}{4 D_k A_k}\frac{\mathbf{q}_{+}\vert \mathbf{q}_{+} \vert }{\psi _k (\mathbf{p}_d,\mathbf{p}_s)}. \end{aligned}$$

Since the gas transport model can be rewritten in the form (1), we can decoupled it into either the form (12) or (23). In our discussion, we shall use the implicit decoupling strategy proposed in Sect. 3.3 leading to an implicit decoupled system (23). For convenience, we can partition (38) into a block form leading to

$$\begin{aligned} \begin{pmatrix} 0&{} 0&{} \mathbf{E}_{13}\\ 0&{}\mathrm {I}&{} 0\\ 0&{} 0&{}0 \end{pmatrix}\begin{pmatrix} \mathbf{x}_1\\ \mathbf{x}_2\\ \mathbf{x}_3 \end{pmatrix}'&=\begin{pmatrix} \mathbf{A}_{11}&{} 0 &{} 0\\ 0&{}0&{}\mathbf{A}_{23}\\ \mathbf{A}_{31}&{}\mathbf{A}_{32}&{}\mathbf{A}_{33} \end{pmatrix}\begin{pmatrix} \mathbf{x}_1\\ \mathbf{x}_2\\ \mathbf{x}_3 \end{pmatrix}\nonumber \\&\quad + \begin{pmatrix} 0\\ {\tilde{\mathbf{g}}}(\mathbf{E}\mathbf{x})\\ 0 \end{pmatrix} +\begin{pmatrix} 0\\ 0\\ \mathbf{B}_3 \end{pmatrix}\begin{pmatrix} \mathbf{s}(t)\\ \mathbf{d}(t) \end{pmatrix}, \end{aligned}$$
(39a)
$$\begin{aligned} \mathbf{y}&=\begin{pmatrix} 0&\mathbf{C}_2&\mathbf{C}_3 \end{pmatrix}\begin{pmatrix} \mathbf{x}_1\\ \mathbf{x}_2\\ \mathbf{x}_3 \end{pmatrix}, \end{aligned}$$
(39b)

where \(\mathbf{E}_{13}=\begin{pmatrix} \vert {\mathscr {A}}_0^\mathrm {T}\vert&\vert {\mathscr {A}}_S^\mathrm {T}\vert \end{pmatrix}\in {\mathbb {R}}^{n_E\times n_v},\, \mathbf{A}_{11}= -\mathbf{M}_L^{-1}\in {\mathbb {R}}^{n_E\times n_E},\) \( \mathbf{A}_{23}=\begin{pmatrix} \mathbf{M}_{A}{\mathscr {A}}_0^\mathrm {T}&\mathbf{M}_{A}{\mathscr {A}}_S^\mathrm {T}\end{pmatrix} \in {\mathbb {R}}^{n_E\times n_v},\, \mathbf{A}_{31}=\begin{pmatrix} \vert {\mathscr {A}}_0\vert \\ 0 \end{pmatrix}\in {\mathbb {R}}^{n_v \times n_E},\) \( \mathbf{A}_{32}=\begin{pmatrix} {\mathscr {A}}_0\\ 0 \end{pmatrix}\in {\mathbb {R}}^{n_v\times n_E},\, \mathbf{A}_{33}=\begin{pmatrix} 0 &{} 0\\ 0&{} \mathrm {I} \end{pmatrix}\in {\mathbb {R}}^{n_v\times n_v}, \) \(\mathbf{B}_3=-\begin{pmatrix} 0&{}{\mathbf{B}_d}\\ \mathrm {I}&{}0 \end{pmatrix} \in {\mathbb {R}}^{n_v\times m},\, \mathbf{C}_2=\begin{pmatrix} \vert {\mathscr {A}}_S\vert \\ 0 \end{pmatrix}\in {\mathbb {R}}^{\ell \times n_E},\) \( \mathbf{C}_3=\begin{pmatrix} 0 &{}0\\ {\mathbf {B}}_d^T&{}0 \end{pmatrix}\in {\mathbb {R}}^{\ell \times n_v},\, \mathbf{x}_1=\mathbf{q}_{-} \in {\mathbb {R}}^{n_E},\, \mathbf{x}_2=\mathbf{q}_{+}\in {\mathbb {R}}^{n_E}, \)

\( \mathbf{x}_3=\begin{pmatrix} \mathbf{p}_d\\ \mathbf{p}_s \end{pmatrix}\in {\mathbb {R}}^{ n_v},\, \) \(n_v=n_d+n_s+n_0.\) The nonlinear term is defined as

$$\begin{aligned} {\tilde{\mathbf{g}}}(\mathbf{E}\mathbf{x})&={\tilde{\mathbf{g}}}(\mathbf{E}_{13}\mathbf{x}_3,\mathbf{x}_2,0,0)\\&=\tilde{ {\tilde{\mathbf{g}}}}(\mathbf{x}_3,\mathbf{x}_2)=(\ldots , \tilde{{\tilde{g}}}_k(\mathbf{x}_3^k,\mathbf{x}_2^k),\ldots )^\mathrm {T}\in {\mathbb {R}}^{n_E}, \end{aligned}$$

with

$$\begin{aligned} \tilde{{\tilde{g}}}_k(\mathbf{x}_3^k,\mathbf{x}_2^k)&=-\frac{gA_k}{2\gamma _0}\mathbf{E}_{13}\mathbf{x}_3^k\frac{\Delta h_k}{L_k}-\frac{\lambda _k\gamma _0}{4 D_k A_k}\frac{\mathbf{x}_2^k\vert \mathbf{x}_2^k \vert }{\mathbf{E}_{13}\mathbf{x}_3^k}. \end{aligned}$$
(40)

From the above expression, we can observe that the nonlinear function in (39a) only depends on the differential variables, by noting that the algebraic variables \(p_s\) in \(x_3\) are not included in the definition of \({\tilde{g}}\). This implies that the tractability index of this system is independent of the nonlinearity which satisfies condition (9). Hence we can apply our proposed decoupling procedure in Sect. 3. In order to decouple (39), we need to first find the tractability index of (39) using Definition 1. Setting

$$\begin{aligned} \mathbf{E}_0&= \begin{pmatrix} 0&{} 0&{} \mathbf{E}_{13}\\ 0&{}\mathrm {I}&{} 0\\ 0&{} 0&{}0 \end{pmatrix} \quad \text{ and }\quad \mathbf{A}_0=\begin{pmatrix} \mathbf{A}_{11}&{} 0 &{} 0\\ 0&{}0 &{}\mathbf{A}_{23}\\ \mathbf{A}_{31}&{}\mathbf{A}_{32}&{}\mathbf{A}_{33} \end{pmatrix}, \end{aligned}$$
(41)

we can then construct projectors

$$\begin{aligned} \mathbf{Q}_0&=\begin{pmatrix} \mathrm {I}&{} 0&{} 0\\ 0&{}0&{} 0\\ 0&{} 0&{} \mathbf{Q}\end{pmatrix}\in {\mathbb {R}}^{n\times n} \quad \text{ and }\quad \mathbf{P}_0=\mathrm {I}-\mathbf{Q}_0=\begin{pmatrix} 0&{}0&{} 0\\ 0&{} \mathrm {I}&{} 0\\ 0&{} 0&{} \mathbf{P}\end{pmatrix}\in {\mathbb {R}}^{n\times n}, \end{aligned}$$
(42)

such that \(\mathbf{E}_0\mathbf{Q}_0=0,\) meaning \(\mathbf{E}_{13}\mathbf{Q}=0\), or \(\mathbf{Q}\in {\mathbb {R}}^{ n_v \times n_v}\) is the projector onto the nullspace of \(\mathbf{E}_{13}\) and \(\mathbf{P}\in {\mathbb {R}}^{ n_v \times n_v}\) is its complementary projector. Substituting the above matrices and projectors into (4) leads to

$$\begin{aligned} \mathbf{E}_1=\mathbf{E}_0-\mathbf{A}_0\mathbf{Q}_0=\begin{pmatrix} -\mathbf{A}_{11}&{} 0 &{} \mathbf{E}_{13}\\ 0&{}\mathrm {I}&{}-\mathbf{A}_{23}\mathbf{Q}\\ -\mathbf{A}_{31}&{}0&{}-\mathbf{A}_{33}\mathbf{Q}\end{pmatrix}. \end{aligned}$$

If \(\mathbf{E}_1\) is nonsingular, the DAE (39) is of tractability index 1. Next, we construct the values of the matrix coefficients of (27) as follows. Let \(n_p=\mathrm {rank(\mathbf{E}_0)}\) and \(n_q=n-n_p.\) Then, the columns of the matrices

$$\begin{aligned} \mathbf{q}_0&=\begin{pmatrix} \mathrm {I}&{} 0\\ 0&{} 0\\ 0&{} \mathbf{q}\end{pmatrix}\in {{{\mathbb {R}}}}^{n\times n_q}\quad \text{ and }\quad \mathbf{p}_0=\begin{pmatrix} 0&{} 0\\ \mathrm {I}&{} 0\\ 0&{} \mathbf{p}\end{pmatrix}\in {{{\mathbb {R}}}}^{n\times n_p} \end{aligned}$$
(43)

are linearly independent and span the column spaces of \(\mathbf{Q}_0\) and \(\mathbf{P}_0\) in (42), respectively. The left inverse of matrices \(\mathbf{p}_0\) and \(\mathbf{q}_0\) are given by

$$\begin{aligned} \mathbf{q}_0^{*\mathrm {T}}&=\begin{pmatrix} \mathrm {I}&{} 0 &{} 0\\ 0&{} 0&{} \mathbf{q}^{*\mathrm {T}} \end{pmatrix}\in {{{\mathbb {R}}}}^{n_q\times n}\quad \text{ and }\quad \mathbf{p}_0^{*\mathrm {T}}=\begin{pmatrix} 0&{} \mathrm {I}&{} 0 \\ 0&{} 0&{} \mathbf{p}^{*\mathrm {T}} \end{pmatrix}\in {{{\mathbb {R}}}}^{ n_p \times n}, \end{aligned}$$
(44)

respectively, where \(\mathbf{q}^{*\mathrm {T}}\) and \(\mathbf{p}^{*\mathrm {T}}\) are the left inverses of column matrices \(\mathbf{q}\) and \(\mathbf{p},\) respectively. Let \(k_q\) be the dimension of the nullspace of \(\mathbf{E}_{13},\) and \(k_p=n_v-k_q.\) The columns of \(\mathbf{q}\in {\mathbb {R}}^{n_v\times k_q} \) and \(\mathbf{p}\in {\mathbb {R}}^{n_v\times k_p}\) are linearly independent and span the column spaces of \(\mathbf{Q}\) and \(\mathbf{P}\) in (42), respectively. Finally, column matrices \({\hat{\mathbf{p}}}_0\in {\mathbb {R}}^{n\times n_p}\) and \({\hat{\mathbf{q}}}_0\in {\mathbb {R}}^{n\times n_q}\) can be constructed such that their columns are linearly independent and span the null spaces of the matrices \(\mathbf{q}_0^{\mathrm {T}}\mathbf{A}_0^{\mathrm {T}}\in {{{\mathbb {R}}}}^{n_q\times n}\) and \(\mathbf{E}_0^{\mathrm {T}}\in {{{\mathbb {R}}}}^{n\times n},\) respectively. The differential and algebraic variables are given by

$$\begin{aligned} \xi _p= \mathbf{p}_0^{*\mathrm {T}} \mathbf{P}_0\mathbf{x}=\begin{pmatrix} \mathbf{x}_2\\ \mathbf{p}^{*\mathrm {T}}\mathbf{x}_3 \end{pmatrix}\quad \text{ and }\quad \xi _q =\mathbf{q}_0^{*\mathrm {T}} \mathbf{Q}_0\mathbf{x}=\begin{pmatrix} \mathbf{x}_1\\ \mathbf{q}^{*\mathrm {T}}\mathbf{x}_3 \end{pmatrix}, \end{aligned}$$
(45)

respectively. The nonlinear term is defined as

$$\begin{aligned} {\tilde{\mathbf{f}}}(\xi _p)&= \begin{pmatrix} 0\\ \mathbf{g}_p(\xi _p)\\ 0 \end{pmatrix} \end{aligned}$$
(46)

where

$$\begin{aligned} \mathbf{g}_p(\xi _p)&={\tilde{\mathbf{g}}}(\mathbf{E}_1\mathbf{p}_0\xi _p)={\tilde{\mathbf{g}}}(\mathbf{E}_{13}\mathbf{p}\xi _{p_2}, \xi _{p_1},0)=\tilde{{\tilde{\mathbf{g}}}}(\xi _{p_1},\xi _{p_2})\\&=(\ldots , \tilde{{\tilde{g}}}_k(\xi _{p_1}^k,\xi _{p_2}^k),\ldots )^\mathrm {T}\in {\mathbb {R}}^{n_E}, \end{aligned}$$

with \( \tilde{{\tilde{g}}}_k(\xi _{p_1}^k,\xi _{p_2}^k)=-\frac{gA_k}{2\gamma _0}{\tilde{\mathbf{E}}}_{13} \xi _{p_2}^k\frac{\Delta h_k}{L_k}-\frac{\lambda _k\gamma _0}{4 D_k A_k}\frac{\xi _{p_1}^k\vert \xi _{p_1}^k \vert }{{\tilde{\mathbf{E}}}_{13} \xi _{p_2}^k}\) and \({\tilde{\mathbf{E}}}_{13}= \mathbf{E}_{13}\mathbf{p}.\) This is due to the fact that \(\mathbf{E}_{13}\mathbf{x}_3=\mathbf{E}_{13}\mathbf{p}\mathbf{p}^{*\mathrm {T}}\mathbf{x}_3=\mathbf{E}_{13}\mathbf{p}\xi _{p_2}.\) It can be proved that \(\mathbf{f}_q(\xi _p)={\hat{\mathbf{q}}}_0^{\mathrm {T}}{\tilde{\mathbf{f}}}(\xi _p)=0\in {{{\mathbb {R}}}}^{n_q}\) always due to the structure of the nonlinearity. Finally, substituting (41), (43)-(45) into (27) leads to an equivalent nonlinear decoupled system of (38) given by

$$\begin{aligned} \mathbf{E}_p\xi '_p&=\mathbf{A}_p\xi _p+\mathbf{f}_p(\xi _p)+\mathbf{B}_p{\varvec{u}},\quad \xi _p(0)=\begin{pmatrix} \mathbf{x}_2(0)\\ \mathbf{p}^{*\mathrm {T}}\mathbf{x}_3(0) \end{pmatrix}, \end{aligned}$$
(47a)
$$\begin{aligned} \mathbf{E}_q\xi _q&=\mathbf{A}_q\xi _p+\mathbf{B}_q{\varvec{u}}, \end{aligned}$$
(47b)
$$\begin{aligned} \mathbf{y}&= \mathbf{C}_p\xi _p+\mathbf{C}_q\xi _q, \end{aligned}$$
(47c)

where \(\mathbf{f}_p(\xi _p)={\hat{\mathbf{p}}}_0^{\mathrm {T}}{\tilde{\mathbf{f}}}(\xi _p)\in {{{\mathbb {R}}}}^{n_p}\) with \({\tilde{\mathbf{f}}}(\xi _p)\) as defined in (46). The system matrix coefficients are computed as defined in (27). We can observe that the nonlinear gas transport network model has been decoupled into \(n_p=n_E +k_p\) nonlinear differential equations, and \(n_q=n_E+k_q\) algebraic equations. Subsystem (47a) can be simulated using standard numerical integration, then algebraic solutions of (47b) can be obtained by using numerical solvers after post-processing. Hence, the desired output data can be obtained through (47c). We note that the decoupling enables us to treat DAEs like ODEs. However, the stiffness problem is inherited in the ODE subsystem (47a). In order to cope with the stiffness problem, we can use IMEX integration scheme [27] instead of standard integration which makes an efficient simulation of (47a) possible. We note that the values of the matrix coefficients of (47) can vary depending on the choices of projectors in (42), but the solutions will always be the same. In practice, system (47) can be constructed automatically following the implicit decoupling procedure in Sect. 3.3. Numerical experiments show that (47a) and (37) have the same dimension for the case of index 1 gas transportation networks.

6 Numerical Experiments

In this section, we illustrate the performance of the proposed decoupling and IMOR method for nonlinear DAEs with a special nonlinear term \(\mathbf{f}(\mathbf{x})=\mathbf{f}(\mathbf{E}\mathbf{x}),\) where \(\mathbf{E}\) is a singular matrix. Such nonlinear DAEs can arise from gas transportation networks as discussed in Sect. 5. Here, we consider small to large examples of gas transportation networks leading to nonlinear DAEs of tractability index 1. We compute the relative error in the format \( \mathrm {Re. error}=\Vert {\mathbf {y}}-{\mathbf {y}}_r\Vert _2/\Vert {\mathbf {y}}\Vert _2. \) The output error is defined as

$$\begin{aligned} \mathrm {max}( \mathrm {Re. error} (\text{ pressure}), \mathrm {Re. error} (\text{ mass } \text{ flow}) ).\end{aligned}$$
(48)

Simulations were done using MATLAB®Version 2012b on a Unix desktop.

6.1 Numerical Integration

We compare the output solutions (mass flow at the supply node and pressure at demand nodes) of different gas transportation models: nonlinear DAE model (34), nonlinear ODE model (37) and nonlinear decoupled model (47).

Example 1

In this example, we consider small to medium gas pipeline networks from [28, 29] with steady pressure at the supply pressure node and steady mass flow at demand nodes. We are interested in the comparison of the pressure and mass flows of different models of each gas transportation network shown in Table 1.

Table 1 Comparison of gas transportation models

In Table 1, we can observe that the index reduced ODE model has the same dimension as the differential part of the nonlinear decoupled model. We use the implicit-Euler numerical integration scheme to solve the nonlinear DAE and ODE models with a fixed time step. For the nonlinear decoupled model we use the implicit-Euler numerical integration scheme on the differential part and LU based numerical solver for the algebraic part. Figures 1, 2, 3, 4, show the mass flow at the supply node and pressure at the first demand node for each network presented in Table 1. In Fig. 1, we used steady pressure \({\mathbf {s}}(t)=650 \mathrm {bars}\) at the supply node and steady mass flow rate of \({\mathbf {d}}(t)=100 \mathrm {Kg/s}\) at the demand node.

In Fig. 2, we used steady pressure \({\mathbf {s}}(t)=700 \mathrm {bars}\) at the supply node and steady mass flow rate of \({\mathbf {d}}(t)=(60,30)^\mathrm {T}\) at the demand nodes.

In Fig. 3, we used steady pressure \({\mathbf {s}}(t)=4.55\times 10^{{3}} \mathrm {bars}\) at the supply node and steady mass flow rate of

$$\begin{aligned} {{\mathbf {d}}(t)=(0.21,34.86,0.22,2.83,1.81,1.04,2.85,1.45)^\mathrm {T}} \end{aligned}$$

at the demand nodes. In Fig. 4, we used steady pressure \({\mathbf {s}}(t)=3.45\times 10^4 \mathrm {bars}\) at the supply node and steady mass flow rate of \({\mathbf {d}}(t)=10\times \mathrm {ones} (24,1)\) at the demand nodes. In all test cases, we can observe that all models decay towards steady mass flow at the supply node and steady pressure at the demand nodes.

Fig. 1
figure 1

Gas transportation network \((n=4, m_s=1, m_d=1)\)

Fig. 2
figure 2

Gas transportation network \((n=25, m_s=1, m_d=2)\)

Fig. 3
figure 3

Gas transportation network \((n=55, m_s=1, m_d=8)\)

Fig. 4
figure 4

Gas transportation network \((n=121, m_s=1, m_d=24)\)

Example 2

In this example, we are interested in comparing the pressure and mass flow rate while applying steady pressure at supply node and transient mass flow rate at the demand node. We consider a medium size gas transport pipe network with 200 pipes, one supply node and one demand node generated using the following data. The length, diameter and average roughness of each pipe are chosen as constants given by \(18.15 \mathrm {m}, \, 1.422\mathrm {m}\) and \(1.5\times 10^{-6}\mathrm {m},\) respectively. The gas composition through the network is methane with specific gas constant \(518.26 \mathrm {J/KgK}\) at steady supply of \(84\mathrm {bar}\) and mass flow at demand as shown in the first row of Fig. 5 in the time interval \(t\in \left[ 0,1000s \right] .\)

Fig. 5
figure 5

Comparison of the output solutions

This leads to a nonlinear DAE system of dimension \(n=601\) which we decoupled into \(n_p=400\) differential equations and \(n_q=201\) algebraic equations. For comparison, we generated the ODE model (37) leading to an ODE model of dimension 400. In all models for integration, we use the implicit-Euler scheme with the same step size of 8. In the second row of Fig. 5, we can observe that the the pressure and mass flow coincide with the nonlinear DAE model for both ODE model and the decoupled model. Using the solutions of the nonlinear DAE model as reference, the solutions from the ODE model have relative errors of \(2.4\times 10^{-6}\) and \(5.2\times 10^{-8}\) in the pressure and mass flow, respectively, while the solutions from the decoupled model have relative errors of \(3.1\times 10^{-6}\) and \(4.5\times 10^{-7},\) respectively.

Example 3

In this example, we compare the matrix properties of the matrix pencils of the derived models and the values of the nonlinear term at a fixed state vector. In Figs. 6, 7, 8, we compare the sparsity of the matrix pencils of the coupled model, decoupled model and implicit ODE model. We can observe that all models are sparse, however the decoupled model is the least sparse. In Table 2, we compare the finite spectrum of the matrix pencils and the nonlinearity. For the definition of finite spectrum and singular values of a matrix pencil, see [8]. We can observe that all models have the same spectrum with purely imaginary finite eigenvalues and approximately the same values of the nonlinear function.

Fig. 6
figure 6

Sparsity of the matrix pencil \((\mathbf{E},\mathbf{A})\) of the coupled model

Fig. 7
figure 7

Sparsity of the matrix pencil \((\mathbf{E}_p,\mathbf{A}_p)\) of the decoupled model

Fig. 8
figure 8

Sparsity of the matrix pencil of the implicit ODE model

6.2 Model Order Reduction

Here, we illustrate the performance of the proposed IMOR method compared to existing MOR methods.

Example 4

We consider a large-scale gas transport pipeline network with 5, 000 pipes, 1 supply node and 1 demand node. This model was generated numerically using the following data. The length, diameter and average roughness of each pipe are chosen as \(0.726 \mathrm {m}, \, 1.422\mathrm {m}\) and \(1.0\times 10^{-6}\mathrm {m},\) respectively. The gas composition is with specific gas constant \(1530 \mathrm {J/KgK}\) at steady pressure \(50\mathrm {bar}\) at supply node and mass flow as a step function as shown in the first row of Fig. 10 at the demand node at a time interval \(t\in \left[ 0,86400 \right] .\) This leads to a nonlinear DAE (34) of dimension \(n=15,001\). It took 63.7s to automatically decouple the nonlinear DAE into \(n_p=10,000\) nonlinear differential equations and \(n_q=5,001\) algebraic equations. We also generated an index reduced ODE (37) of dimension \({\tilde{n}}=10,000.\) We reduced the decoupled system using POD on both the differential and algebraic parts.

Table 2 Comparison of the eigenvalues of the matrix pencil and the norm of the nonlinear term with that of derived nonlinear models

Then, we obtained an I-POD model with \(r_p=2\) and \(r_q=4\) leading to a total reduction of \(r=r_p+r_q=6\ll 15,001.\) The first singular values of the differential part are shown in Fig. 9.

Fig. 9
figure 9

Singular values divided by the largest singular value of the POD Snapshot Matrix of the differential part using the decoupled system

Table 3 Comparison of the ROMs, output error as in (48)
Fig. 10
figure 10

Comparison of the pressure at demand nodes and mass flow at supply node

Fig. 11
figure 11

Comparison of the pressure at demand nodes and mass flow at supply node for a different scenario in the test versus the training

Fig. 12
figure 12

Comparison of the relative error of the ROMs

We also used POD to reduce both the nonlinear DAE and ODE directly. For comparison, the size of ROMs for different MOR methods is determined by making sure that the output error is below \(10^{-4}\) and the results are presented in Table 3. All numerical integration was done using the backwards Euler method with a fixed time step \(h=250\) and the LU-based numerical solver implemented in the backslash MATLAB command was used for solving the resulting linear systems of equations in each time step. We note that using the backslash operator with a sparse matrix [30] in MATLAB, the LU-decomposition is done by UMFPACK, i.e., row and column permutations are not only applied for numerical stability but also to reduce the number of fill-ins significantly. We can observe that I-POD leads to the largest ROM and lowest speed-ups. This is due to the fact that its ROM is a DAE while the other ROMs are ODEs. The comparison of the mass flow at the supply node and the pressure at the demand node of all ROMs are shown in Figs. 10 and 11, where the training and the test scenarios are different in Fig. 11. In Fig. 12, we compare the output relative error for pressure and mass flow for different sizes of the ROMs for Fig. 10. We can observe that I-POD is the most accurate while ODE-POD is the least accurate. However, I-POD leads to a slightly bigger ROM.

7 Conclusions

We have proposed a new automatically decoupling strategy and an IMOR method for nonlinear DAEs with a special nonlinear term. This approach eliminates the index problem during simulation and MOR which allows the use of standard numerical integration methods and MOR techniques. We have derived both the implicit (12) and explicit (23) decoupled systems for arbitrary index nonlinear DAEs. We have demonstrated the accuracy of this approach by applying it to nonlinear DAEs arising from the gas transportation networks. The computational cost of this approach can be improved by applying reordering algorithms after decoupling. However, we have restricted ourselves to nonlinear DAEs arising from gas transportation networks. Future research will deal with nonlinear DAEs arising from other applications.