## 3 Implementation of the Soft Sensor in the Time Domain
### Application of the TVB Method to Obtain the Soft Sensor
As a starting point, the value of the integral evaluated up to the time \(t_{\rm n}\) will be referred to as \(Y_{0}(t_{\rm n})\):  
\[Q_{2,\rm dyn,1}(t_{\rm n})=\frac{1}{R_{\rm H}}\int_{0}^{t_{\rm n}}W_{1,\rm dyn }^{*}(t_{\rm n}-\tau)\frac{\partial\Delta p}{\partial t_{\rm n}}(\tau)d\tau= \frac{1}{R_{\rm H}}Y_{0}(t_{\rm n}). \tag{56}\]  
Next of interest is the time step coming after \(t_{\rm n}\): \((t_{\rm n}+\Delta t_{\rm n})\). Inserting into the equation gives:  
\[Q_{2,\rm dyn,1}(t_{\rm n}+\Delta t_{\rm n})=\frac{1}{R_{\rm H}}\int_{0}^{t_{ \rm n}+\Delta t_{\rm n}}W_{1,\rm dyn}^{*}(t_{\rm n}+\Delta t_{\rm n}-\tau) \frac{\partial\Delta p}{\partial t_{\rm n}}(\tau)d\tau. \tag{57}\]The complete integral will be divided into two parts: the integral from 0 to \(t_{\rm n}\), designated as \(K_{1}\), and the integral from \(t_{\rm n}\) to \(t_{\rm n}+\Delta t_{\rm n}\), referred to as \(K_{2}\). \[Q_{2,{\rm dyn},1}(t_{\rm n}+\Delta t_{\rm n})=\frac{1}{R_{\rm H}}[K_{1}+K_{2}] \tag{58}\]  
With:  
\[K_{1} =\int_{0}^{t_{\rm n}}W_{1,{\rm dyn}}^{*}(t_{\rm n}+\Delta t_{\rm n }-\tau)\frac{\partial\Delta p}{\partial t_{\rm n}}(\tau)d\tau, \tag{59}\] \[K_{2} =\int_{t_{\rm n}}^{t_{\rm n}+\Delta t_{\rm n}}W_{1,{\rm dyn}}^{*} (t_{\rm n}+\Delta t_{\rm n}-\tau)\frac{\partial\Delta p}{\partial t_{\rm n}}( \tau)d\tau. \tag{60}\]  
First, the second part of the integral, \(K_{2}\), will be evaluated. \(K_{2}\) represents the change in volumetric flow rate during the interval from the current time step to the next one, which is \(\Delta t_{\rm n}\) after the current step. Assuming a short time step, the change in the pressure gradient can be considered constant throughout the duration of \(\Delta t_{\rm n}\). Thus, it follows that \(\frac{\partial\Delta p}{\partial t_{\rm n}}(\tau)=\) constant for the entire period of \(\Delta t_{\rm n}\). This allows the gradient to be factored out of the integral as a constant. The constant value of the pressure difference gradient is determined by averaging over the time step, which involves taking the difference between the starting and ending values during the interval \(\Delta t\). Therefore:  
\[\Delta\dot{p}=\left(\frac{\partial\Delta p(\tau)}{\partial t_{\rm n}}\right)_ {averaged\ over\ \Delta t_{\rm n}}. \tag{61}\]  
Inserting this assumption into \(K_{2}\) gives:  
\[K_{2}=\Delta\dot{p}\int_{t_{\rm n}}^{t_{\rm n}+\Delta t_{\rm n}}W_{1,{\rm dyn }}^{*}(t_{\rm n}+\Delta t_{\rm n}-\tau)d\tau. \tag{62}\]  
The weighting functions are recognized as a sum of weighted, falling exponential terms, which can be expressed as:  
\[W_{dyn}(t_{\rm n})=\sum_{i=1}^{N}m_{i}e^{-n_{i}t_{\rm n}}. \tag{63}\]  
Substituting this definition into the integral, the equation can be easily solved by integrating the exponential terms. \[K_{2} =\Delta\dot{p}\int_{t_{\rm n}}^{t_{\rm n}+\Delta t_{\rm n}}\left[ \sum_{i=1}^{N}m_{i}e^{-n_{i}t_{\rm n}}\right]d\tau, \tag{64}\] \[Q_{2,\rm dyn,1}(t_{\rm n})=\frac{1}{R_{\rm H}}\int_{0}^{t_{\rm n}}W_{1,\rm dyn }^{*}(t_{\rm n}-\tau)\frac{\partial\Delta p}{\partial t_{\rm n}}(\tau)d\tau= \frac{1}{R_{\rm H}}Y_{0}(t_{\rm n}). \tag{56}\]0  
Next, the first part of the integral, denoted as \(K_{1}\), needs to be evaluated:  
\[Q_{2,\rm dyn,1}(t_{\rm n})=\frac{1}{R_{\rm H}}\int_{0}^{t_{\rm n}}W_{1,\rm dyn }^{*}(t_{\rm n}-\tau)\frac{\partial\Delta p}{\partial t_{\rm n}}(\tau)d\tau= \frac{1}{R_{\rm H}}Y_{0}(t_{\rm n}). \tag{56}\]1  
In this context, the authors of the TVB method employed a [PERSON] expansion of the weighting function around the point \((t_{\rm n}-\tau)\).