## 4 Solving the Non-Linear System  
In this section we will focus on the case of the Irish gas network of 13 nodes and 14 branches, see Figure 2. This model consists of two sets of equations. The first set includes the equations for pressure drop in (13) which are non-linear. Analytically in the case of the under study model, these non-linear equations are given by (A1). The second set describes the connectivity of the network in Figure 2 and consists of the linear equations (A2). These two sets of linear and non-linear equations can be written in the following matrix form:  
\[AX=B+F(X). \tag{16}\]  
where: \(X=\left[ \begin{array}{c}X_{p}\\ X_{q}\end{array} \right]\), \(B=\left[ \begin{array}{c}b_{p}\\ b_{q}\end{array} \right]\) with:\[X_{p}=\left[ \begin{array}{c}P_{4}^{2}\\ P_{5}^{2}\\ P_{6}^{2}\\ P_{7}^{2}\\ P_{8}^{2}\\ P_{9}^{2}\\ P_{10}^{2}\\ P_{11}^{2}\\ P_{12}^{2}\\ P_{13}^{2}\\ Q_{1,4}\\ Q_{1,10}\\ Q_{2,4}\\ Q_{3,5}\end{array} \right]\in\mathbb{R}^{14\times 1},\quad X_{q}=\left[ \begin{array}{c}Q_{4,5}\\ Q_{5,6}\\ Q_{5,11}\\ Q_{6,7}\\ Q_{7,8}\\ Q_{8,9}\\ Q_{9,10}\\ Q_{11,12}\\ Q_{11,13}\end{array} \right]\in\mathbb{R}^{10\times 1},\]  
\[b_{p}=\left[ \begin{array}{c}(1-b_{1,4})P_{1}^{2}\\ (1-b_{1,10})P_{1}^{2}\\ 0\\ 0\\ 0\\ 0\\ 0\\ 0\\ 0\\ 0\\ 0\end{array} \right],\in\mathbb{R}^{14\times 1}\quad b_{q}=\left[ \begin{array}{c}L_{4 }\\ L_{5}\\ L_{6}\\ L_{7}\\ L_{8}\\ L_{9}\\ L_{10}\\ L_{11}\\ L_{12}\\ L_{13}\end{array} \right]\in\mathbb{R}^{10\times 1}.\]  
Furthermore, \(F(X)=\left[ \begin{array}{c}f(X)\\ 0_{10,1}\end{array} \right]\), with:  
\[f(X)=\left[ \begin{array}{c}-a_{1,4}|Q_{1,4}|Q_{1,4}-2b_{1,4}P_{1}P_{4}\\ -a_{1,10}|Q_{1,10}|Q_{1,10}-2b_{1,10}P_{1}P_{10}\\ a_{9,10}|Q_{9,10}|Q_{9,10}+2b_{9,10}P_{9}P_{10}\\ a_{6,9}|Q_{6,9}|Q_{6,9}+2b_{6,9}P_{6}P_{9}\\ a_{6,7}|Q_{6,7}|Q_{6,7}+2b_{6,7}P_{6}P_{7}\\ a_{7,8}|Q_{7,8}|Q_{7,8}+2b_{7,8}P_{7}P_{8}\\ a_{8,9}|Q_{8,9}|Q_{8,9}+2b_{8,9}P_{6}P_{9}\\ -a_{3,5}|Q_{3,5}|Q_{3,5}-2b_{3,5}P_{3}P_{5}\\ a_{5,6}|Q_{5,6}|Q_{5,6}+2b_{5,6}P_{5}P_{6}\\ a_{5,11}|Q_{5,11}|Q_{5,11}+2b_{5,11}P_{5}P_{11}\\ a_{4,5}|Q_{4,5}|Q_{4,5}+2b_{4,5}P_{4}P_{5}\\ -a_{2,4}|Q_{2,4}|Q_{2,4}-2b_{2,4}P_{2}P_{4}\\ a_{11,12}|Q_{11,12}|Q_{11,12}+2b_{11,12}P_{11}P_{2}\\ a_{11,13}|Q_{11,13}|Q_{11,13}+2b_{11,13}P_{11}P_{3}\end{array} \right]\in \mathbb{R}^{14\times 1},\]and: \(A=\left[ \begin{array}{cc}A_{11}&0_{14,10}\\ A_{21}&A_{22}\end{array} \right]\), with:  
\[A_{11}=\left[ \begin{array}{cc}\tilde{A}_{11}&0_{14,4}\\ \end{array} \right]\in\mathbb{R}^{14\times 14},\quad A_{21}=\left[ \begin{array}{ cc}0_{10,10}&\tilde{A}_{21}\\ \end{array} \right]\in\mathbb{R}^{10\times 14},\quad A_{22}=\in\mathbb{R}^{10 \times 10},\]  
and:  
\[\tilde{A}_{11}=\left[ \begin{array}{ccccccccc}1&0&0&0&0&0&0&0&0\\ 0&0&0&0&0&1&0&0&0\\ 0&0&0&0&0&1&1&0&0&0\\ 0&0&1&0&0&-1&0&0&0&0\\ 0&0&1&-1&0&0&0&0&0\\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