# Real-Time Water Level Monitoring Based on GNSS Dual-Antenna Attitude Measurement
## 2 Methodology
### Baseline Vector Calculation
Assuming antenna s serves as the primary antenna, located approximately at \(\left(\mathrm{x_{0}},\mathrm{y_{0}},\mathrm{z_{0}}\right)\), the linear expansion process of the distances \(\mathrm{\rho_{s}^{j}}\) and \(\mathrm{\rho_{s}^{k}}\) between antenna s and the satellite at \(\left(\mathrm{x_{0}},\mathrm{y_{0}},\mathrm{z_{0}}\right)\) can be expressed as:  
\[\mathrm{\widetilde{\rho}_{s}^{j}}=\mathrm{\rho_{0}^{j}} \tag{6}\]  
\(\mathrm{\rho_{0}^{j}}\) can be further expressed as:  
\[\mathrm{\rho_{0}^{j}}=\sqrt{\left[\left(\chi^{j}-\mathrm{x_{0}}\right)^{2}+ \left(\chi^{j}-\mathrm{Y_{0}}\right)^{2}+\left(\chi^{j}-\mathrm{Z}_{0}\right) ^{2}\right]} \tag{7}\]Similarly, the linear expansion process of \(\rho_{\mathrm{m}}^{\mathrm{j}}\) and \(\rho_{\mathrm{m}}^{\mathrm{k}}\) of antenna \(\mathrm{m}\) at \(\left(x_{0},y_{0},z_{0}\right)\) can be expressed as:  
\[\tilde{\rho}_{\mathrm{m}}^{\mathrm{j}}=\rho_{0}^{\mathrm{j}}-\frac{\chi^{ \mathrm{j}}-x_{0}}{\rho_{0}^{\mathrm{j}}}\mathrm{d}x-\frac{\dot{\mathrm{Y}}^{ \mathrm{j}}-y_{0}}{\rho_{0}^{\mathrm{j}}}\mathrm{d}y-\frac{Z^{\mathrm{j}}-z_{0 }}{\rho_{0}^{\mathrm{j}}}\mathrm{d}z \tag{8}\]  
where \(\left(\mathrm{d}x,\mathrm{d}y,\mathrm{d}z\right)\) represents the distance between the antenna \(\mathrm{m}\) to the approximate position of the antenna \(\mathrm{s}\). This distance is the baseline vector between the two antennas. Let us redefine the variables as follows:  
\[\mathrm{h}_{\mathrm{x}}^{\mathrm{j}}=\frac{\chi^{\mathrm{j}}-x_{0}}{\rho_{0}^{ \mathrm{j}}},\mathrm{h}_{\mathrm{y}}^{\mathrm{j}}=\frac{\chi^{\mathrm{j}}-y_{ 0}}{\rho_{0}^{\mathrm{j}}},\mathrm{h}_{\mathrm{z}}^{\mathrm{j}}=\frac{Z^{ \mathrm{j}}-z_{0}}{\rho_{0}^{\mathrm{j}}} \tag{9}\]  
Equation (8) can be further expressed as:  
\[\tilde{\rho}_{\mathrm{m}}^{\mathrm{j}}=\rho_{0}^{\mathrm{j}}-\left[\mathrm{h }_{\mathrm{x}}^{\mathrm{j}}\quad\mathrm{h}_{\mathrm{y}}^{\mathrm{j}}\quad \mathrm{h}_{\mathrm{z}}^{\mathrm{j}}\right]\times \begin{bmatrix}\mathrm{d}x\\ \mathrm{d}y\\ \mathrm{d}z\end{bmatrix}  \tag{10}\]  
\(\tilde{\rho}_{\mathrm{m}}^{\mathrm{k}}\) can be obtained in the same way. According to Equations (6) and (7), \(\tilde{\rho}_{\mathrm{s}}^{\mathrm{jk}}\) and \(\tilde{\rho}_{\mathrm{m}}^{\mathrm{jk}}\) can be, respectively, expressed as:  
\[\tilde{\rho}_{\mathrm{s}}^{\mathrm{jk}}=\rho_{0}^{\mathrm{j}}-\rho_{0}^{ \mathrm{k}} \tag{11}\]  
\[\tilde{\rho}_{\mathrm{m}}^{\mathrm{jk}}=\rho_{0}^{\mathrm{j}}-\rho_{0}^{ \mathrm{k}}-\left[\mathrm{h}_{\mathrm{x}}^{\mathrm{jk}}\quad\mathrm{h}_{ \mathrm{y}}^{\mathrm{jk}}\quad\mathrm{h}_{\mathrm{z}}^{\mathrm{jk}}\right] \times \begin{bmatrix}\mathrm{d}x\\ \mathrm{d}y\\ \mathrm{d}z\end{bmatrix}  \tag{12}\]  
where \(\mathrm{h}_{\mathrm{x}}^{\mathrm{jk}}=\mathrm{h}_{\mathrm{x}}^{\mathrm{j}}- \mathrm{h}_{\mathrm{x}}^{\mathrm{k}}\), \(\mathrm{h}_{\mathrm{y}}^{\mathrm{jk}}=\mathrm{h}_{\mathrm{y}}^{\mathrm{j}}- \mathrm{h}_{\mathrm{y}}^{\mathrm{k}}\), \(\mathrm{h}_{\mathrm{z}}^{\mathrm{jk}}=\mathrm{h}_{\mathrm{z}}^{\mathrm{j}}- \mathrm{h}_{\mathrm{z}}^{\mathrm{k}}\). Based on the above, we can obtain:  
\[\
abla\Delta\ \tilde{\rho}_{\mathrm{sm}}^{\mathrm{jk}}=\Delta\ \tilde{\rho}_{ \mathrm{s}}^{\mathrm{jk}}-\Delta\ \tilde{\rho}_{\mathrm{m}}^{\mathrm{jk}}=\left[\mathrm{h}_{ \mathrm{x}}^{\mathrm{jk}}\quad\mathrm{h}_{\mathrm{y}}^{\mathrm{jk}}\quad \mathrm{h}_{\mathrm{z}}^{\mathrm{jk}}\right]\times \begin{bmatrix}\mathrm{d}x \\ \mathrm{d}y\\ \mathrm{d}z\end{bmatrix}  \tag{13}\]  
By linearizing Equations (4) and (5), we obtain the following equations:  
\[\mathrm{y}=\mathrm{A}\cdot\mathrm{a}+\mathrm{B}\cdot\mathrm{b}+\mathrm{e} \tag{14}\]  
where, \(\mathrm{y}\) is the GNSS observation vector, \(\mathrm{A}\) is the design containing the carrier wavelengths, \(\mathrm{B}\) is the design matrix of unit line-of-sight vectors, \(\mathrm{a}\) is the integer ambiguity vector, \(\mathrm{b}\) is the baseline vector, \(\mathrm{e}\) is the observation error vector.