## 2 Model Derivation
### Transfer Matrix  
Transfer matrices determine the transfer of the state vector from the coordinate \(x=0\) to any coordinate \(x\) on the pipe axis. Equations (15) and (20) can be written in matrix form:  
\[\left(\begin{array}{cc}0&A\\ C&0\end{array}\right)\cdot\frac{\partial}{\partial x}\left(\begin{array}{c} \bar{Q}\\ \bar{p}\end{array}\right)+\left(\begin{array}{cc}B&0\\ 0&s\end{array}\right)\cdot\left(\begin{array}{c}\bar{Q}\\ \bar{p}\end{array}\right)=\left(\begin{array}{c}0\\ 0\end{array}\right), \tag{21}\]  
where:  
\[A = \frac{S}{\rho}+\frac{2\cdot\eta+\eta_{2}}{\rho^{2}}\cdot\frac{S \cdot s}{a_{c}^{2}}, \tag{22}\] \[B = s-\frac{s\cdot\mathrm{J}_{1}\left(\frac{D}{2}\cdot\mathrm{i} \cdot\sqrt{\frac{s\cdot\rho}{\eta}}\right)}{s\cdot\mathrm{J}_{1}\left(\frac{ D}{2}\cdot\mathrm{i}\cdot\sqrt{\frac{s\cdot\rho}{\eta}}\right)-\frac{D}{4}\cdot \mathrm{i}\cdot\sqrt{\frac{s\cdot\rho}{\eta}}\cdot\mathrm{J}_{0}\left(\frac{D} {2}\cdot\mathrm{i}\cdot\sqrt{\frac{s\cdot\rho}{\eta}}\right)},\] (23) \[C = \frac{a_{c}^{2}\cdot\rho}{S}. \tag{24}\]  
\(\mathrm{J}_{0}\) and \(\mathrm{J}_{1}\) are Bessel functions. The coefficient \(B\) includes the Laplace transform of the function \(W\):  
\[\bar{W}=\left(\frac{D^{2}\cdot\rho}{4\cdot\eta}\right)^{2}\cdot\frac{s\cdot \mathrm{J}_{1}\left(\frac{D}{2}\cdot\mathrm{i}\cdot\sqrt{\frac{s\cdot\rho}{ \eta}}\right)}{s\cdot\mathrm{J}_{1}\left(\frac{D}{2}\cdot\mathrm{i}\cdot\sqrt{ \frac{s\cdot\rho}{\eta}}\right)-\frac{D}{4}\cdot\mathrm{i}\cdot\sqrt{\frac{s \cdot\rho}{\eta}}\cdot\mathrm{J}_{0}\left(\frac{D}{2}\cdot\mathrm{i}\cdot \sqrt{\frac{s\cdot\rho}{\eta}}\right)}. \tag{25}\]  
Equation (21) can be rearranged:  
\[\frac{\partial}{\partial x}\left(\begin{array}{c}\bar{Q}\\ \bar{p}\end{array}\right)+\left(\begin{array}{cc}0&\frac{\bar{c}}{\bar{c}}\\ \frac{B}{\bar{A}}&0\end{array}\right)\cdot\left(\begin{array}{c}\bar{Q}\\ \bar{p}\end{array}\right)=\left(\begin{array}{c}0\\ 0\end{array}\right), \tag{26}\]  
Now, the Laplace transform with respect to \(x\) is applied to Equation (26), and after rearranging and applying the inverse Laplace transform, Equation (27) is obtained.  
\[\left(\begin{array}{c}\bar{Q}\\ \bar{p}\end{array}\right)=\mathcal{L}^{-1}\left\{\left[\left(\begin{array}{ cc}s^{*}&0\\ 0&s^{*}\end{array}\right)+\left(\begin{array}{cc}0&\frac{\bar{s}}{\bar{c}}\\ \frac{B}{\bar{A}}&0\end{array}\right)\right]^{-1}\right\}\cdot\left(\begin{array} []{c}\bar{Q}\\ \bar{p}\end{array}\right)_{x=0}, \tag{27}\]  
where \(s^{*}\) is the parameter of the Laplace transform with respect to \(x\). The transfer matrix \(\mathbf{P}\) appears after computing the inverse matrix and executing the inverse Laplace transform in Equation (27):  
\[\mathbf{P_{f}}\left(x,s\right)=\left(\begin{array}{cc}\cosh\left(\sqrt{ \frac{s\cdot B}{A\cdot C}}\cdot x\right)&-\sqrt{\frac{s\cdot A}{B\cdot C}} \cdot\sinh\left(\sqrt{\frac{s\cdot B}{A\cdot C}}\cdot x\right)\\ -\sqrt{\frac{B\cdot C}{s\cdot A}}\cdot\sinh\left(\sqrt{\frac{s\cdot B}{A \cdot C}}\cdot x\right)&\cosh\left(\sqrt{\frac{s\cdot B}{A\cdot C}}\cdot x \right)\end{array}\right) \tag{28}\]  
Thus, Equation (27) can be written in the final form:\[\bar{\mathbf{u}}\left(x,s\right)=\mathbf{P_{f}}\left(x,s\right)\cdot\bar{\mathbf{u}} \left(0,s\right), \tag{29}\]  
where \(\bar{\mathbf{u}}\) represents the state vector:  
\[\bar{\mathbf{u}}=\left(\begin{array}{c}\bar{Q}\\ \bar{p}\end{array}\right). \tag{30}\]  
When the pressure and flow rate at the beginning of the pipe are known, it is possible to compute the pressure and flow rate in any place along the pipe using Equation (29). All information about the pipe and liquid is included in the transfer matrix \(\mathbf{P_{f}}\).