# A New Algorithm Model Based on Extended Kalman Filter for Predicting Inter-Well Connectivity
## 2 Construction of the SV-DC Model
### State Variable-Dynamic Capacitance Model  
The construction of the SV-DC model in this study begins with the extraction of state variables using the EKF (extended Kalman filtering) algorithm, as established in previous works [36], where state variable models were based on pressure impulse responses and solved using the EKF algorithm. In the SV-DC model, three state variables that appear in Equation (12) \(\beta_{j}\), \(\lambda_{ij}\), and \(\tau_{ij}\) are defined and extracted as state variables since they are the key parameters controlling the dynamic response characteristics of a reservoir. These variables are integral to the model and can be effectively estimated using the EKF algorithm. Consequently, Equation (12) can be transformed by a \(3\times 1\) state vector \(x_{j}(m)\):  
\[ \begin{array}{ll}x_{i}(m)&=\big{[}\ x(m),\ \ \ x_{1}(m),\ \ \ x_{2}(m)\ \big{]}^{ \prime}\\ &=\big{[}\ \beta_{j}(m),\ \ \lambda_{ij}(m),\ \ \ \tau_{ij}(m)\ \big{]}^{ \prime}\end{array}  \tag{13}\]  
Using standard techniques [37], the state variables are \[\left\{ \begin{array}{l}x_{i}(n)=\left[\begin{array}{c}x(m)\\ x_{i1}(m)\\ x_{i2}(m)\end{array}\right]+n_{xi}(m)\\ p_{i}^{c}(n)=\left[\begin{array}{cc}1\sum\limits_{m=n_{0}}^{n}\frac{1}{\tau}e \frac{(m-n)}{\tau_{ij}}&Q_{wi}(m)\sum\limits_{i=1}^{N_{i}}\lambda_{ij}\sum \limits_{m=n_{0}}^{n}\left(-\frac{1}{\tau_{ij}^{2}}e\frac{(m-n)}{\tau_{ij}}Q_{wi }(m)-\frac{(m-n)}{\tau_{ij}^{2}}e\frac{(m-n)}{\tau_{ij}}Q_{wi}(m)\right)\end{array} \right]x_{i}(n)\end{array} \right. \tag{14}\]  
Aggregating the state vectors of all \(N\) injectors, a complete \(1+2N\) state vector is obtained,  
\[x_{i}(m)=\left[\beta_{j}(m),\ \ \ \lambda_{1j}(m),\ \ \ \tau_{1j}(m),\ \ \ \lambda_{2j}(m),\ \ \ \tau_{2j}(m),\ \ \cdots,\ \ \lambda_{Nj}(m),\ \ \ \tau_{Nj}(m)\right]^{\prime} \tag{15}\]  
The state variables for the entire producer-centric system are given in Equation (16):  
\[\left\{ \begin{array}{l}x(n)=\left\{\begin{array}{l}x_{1}(m)\\ x_{11}(m)\\ x_{12}(m)\\ x_{21}(m)\\ \vdots\\ x_{N1}(m)\\ x_{N2}(m)\end{array}\right\}+n_{x}(m)\\ p(n)=p_{1}^{c}(n)+p_{2}^{c}(n)\cdots+p_{N}^{c}(n)+n_{p}(n)\\ =Hx(n)+n_{p}(n)\end{array} \right. \tag{16}\]  
To find the measurement matrix \(H\) in Equation (16), one needs to linearize the measurement equation Equation (12) using Taylor series expansion to obtain \(H\). Let Equation (12) be \(h\), it yields the following:  
\[\varepsilon=\frac{\partial h}{\partial x} \tag{17}\]  
\[\varepsilon=\left[ \begin{array}{cc}1\sum\limits_{m=n_{0}}^{n}\frac{1}{\tau} e\frac{(m-n)}{\tau_{ij}}&Q_{wi}(m)\sum\limits_{i=1}^{N_{i}}\lambda_{ij}\sum \limits_{m=n_{0}}^{n}\left(-\frac{1}{\tau_{ij}^{2}}e\frac{(m-n)}{\tau_{ij}}Q_ {wi}(m)-\frac{(m-n)}{\tau_{ij}^{2}}e\frac{(m-n)}{\tau_{ij}^{2}}Q_{wi}(m) \right)\end{array} \right] \tag{18}\]  
\[\varepsilon^{\prime}=\left[\sum\limits_{m=n_{0}}^{n}\frac{1}{\tau}e\frac{(m-n )}{\tau_{ij}}&Q_{wi}(m)\sum\limits_{i=1}^{N_{i}}\lambda_{ij}\sum\limits_{m=n_{ 0}}^{n}\left(-\frac{1}{\tau_{ij}^{2}}e\frac{(m-n)}{\tau_{ij}^{2}}Q_{wi}(m)- \frac{(m-n)}{\tau_{ij}^{2}}e\frac{(m-n)}{\tau_{ij}^{2}}Q_{wi}(m)\right)\end{array}\right] \tag{19}\]  
\[H=\left[ \begin{array}{cc}1\;\epsilon_{1}^{\prime}\;\epsilon_{2}^{\prime} \;\cdots\;\epsilon_{N}^{\prime}\end{array} \right] \tag{20}\]  
The complete state variables for all injector subsystems are given in Equation (16), where \(p(n)\) is the measured production rate, and \(n_{x}(m)\) and \(n_{p}(n)\) are additive zero-mean white noises for the state and measurement equations. The treatment of the state variables in developing the SV-DC model is expounded through the streamlined logical sequence provided in Equation (13) to Equation (20). For the computation outlined in Equation (13) to Equation (20), applying the EKF algorithm is essential, as it shows proficiency in managing nonlinearity and providing dynamic state estimation.