## 1. Introduction

Conventionally, shallow water flow analysis based on the FEM has been carried out to investigate the marine environment, specifically coastal drift sand, storm surges, tsunamis, and so on [1, 2]. However, the computed results are rarely close to the observed values if the appropriate governing equation is not employed, the appropriate discretization technique is not applied to the governing equation, or the boundary conditions are not defined appropriately. This has prompted a great deal of inverse analysis in recent years, aiming to obtain flow fields that more closely approach the observed values. Boundary control analysis is one of these inverse analytic techniques, in which an unknown boundary condition is numerically determined by iterative computation such that the computed water elevation homes in on the target value or the observed value [3, 4]. Deterministic methods such as the adjoint variable or sensitivity equation methods are commonly employed. On the other hand, the stochastic approach has also been adopted, in which estimation of the flow field is employed using a Kalman filter. Removal of the noise data from the observed values and the flow field estimation are also performed. Conventionally, flow fields are estimated using Kalman filter FEM, and this method is applied to the practical coastal model [5, 6]. However, the effect of boundary conditions on the estimated flow field has not been investigated. This prompted us to research and describe in detail in this chapter the formulation of Kalman filter FEM and numerical experiments for flow estimation when changing the positions of observation points [7].

## 2. Concept of state estimation

In the Kalman filter, system and observation equations are employed. Eqs. (1) and (2) are sample equations:

where *ϕ*, *z*, *a*, *q*, and *r* indicate the true value of the state variable, the observation value, the constant coefficient, the system, and the observation noise, respectively. *n* denotes the number of time steps. **Figure 1** shows relationship between the observation and the estimation values.

Here, *p* indicate the estimation value for the state variable and estimation error. From **Figure 1**, it is found that the estimation value is expressed as a summation of the true value and the estimation error, and the observation value is expressed by the summation of the true value and the observation error. Based on this concept, our formulation of the Kalman filter is shown below.

## 3. Discretization of the governing equation

The shallow water equations, shown below, are employed as the governing equations.

where *u*_{i}, *η*, *g*, and *h* indicate flow velocity component for the *x* and *y* directions, water elevation, gravitational acceleration, and water depth, respectively. The Galerkin method and the selective lumping method are applied to discretize the governing equation. The discretized governing equation is written as Eq. (5) and is represented by Eq. (6),

(5) |

where Δ, *S*_{i}], [*M*], and *e*(0 ≤ *e* ≤ 1).

The system equation in the Kalman filter is obtained by adding the vector represented by the multiplication of the driving matrix [Γ] and the system noise vector {g} and is shown as Eq. (8). Here, the vector {*ø*} indicates the vector of true value. The observation equation shown in Eq. (9) is also introduced. The vectors {*z*} and {*r*} and the matrix [*H*] denote the observation value and the observation noise vectors and the observation matrix.

## 4. Derivation of computational equations in the Kalman filter FEM

The process of modification of the estimation vector

where

Consequently, Eq. (12) is obtained from Eqs. (9), (10), and (11).

Here, we consider the expected value for Eq. (12) in time. In addition, the expected value for vectors

where [*I*] denotes the unit matrix, and

Substituting Eq. (14) for Eq. (10), Eq. (15) is obtained.

where

Next, let us consider the Kalman gain matrix

Eq. (17) is obtained by substituting Eq. (15) with Eq. (16), and substituting Eq. (9) with the obtained equation.

Here, the error covariance matrix after assimilation

Also, in calculating Eq. (18), it is assumed that the expected value of the covariance matrix of the observation error and the estimation error before assimilation is a zero vector (see Eq. (19)).

Consequently, the predicted error covariance matrix can be expressed, such as in Eq. (20),

where

In addition, Eq. (20) is represented by Eq. (22) taking Eq. (21) into account.

Next, let us consider the computation of the estimated error covariance matrix before assimilation

Subtracting Eq. (8) from Eq. (23) gives us Eq. (24).

Here, the estimated error covariance matrix

Considering the relation equations

where

## 5. Computational algorithm based on the Kalman filter FEM

If the matrices [*A*], [*Q*], and [*R*] are steady coefficient matrices, the computational algorithm can be divided into two parts: the computations of the Kalman gain matrix and the estimated value in time. The computational algorithm for the Kalman filter FEM is shown below.

### 5.1. Computation of Kalman gain matrix

1. Set input data: [*A*], *Q*], [*R*], *ε*, (*n* = 0 ∼ *imax*)

2. Calculation of estimated error covariance matrix:

3. Calculation of Kalman gain matrix:

4. Calculation of predicted error covariance matrix:

5. Check of convergence: if

### 5.2. Computation of estimated value in time

6. Calculation of estimated value:

7. Calculation of optimal estimated value:

## 6. Numerical example 1

**Figures 2** and **3**, respectively, show the computational model and the position of observation points in the computation using the Kalman filter FEM. The estimation of shallow water flow was carried out based on the Kalman filter FEM. **Table 1** shows the computational conditions. In this study, we simulated the observed data from the shallow water flow analysis based on the FEM. The boundary condition for the water elevation is given by *η*(*t*) = sin (*t*) on the left-hand side of the open channel, and the artificial observed data is obtained by summation of the numerical result and observation noise, i.e., the white noise. In the computation of the Kalman filter FEM shown in this section, the inflow boundary condition is ignored, and the artificial observation data flow velocities *u*_{x}, *u*_{y}, and water elevation *η*, i.e., the computational result by the FEM, are given at the observation points.

The computational results are shown below. **Figures 4** and **5** show the convergence criterion expressed by the Frobenius norm. The equation for the Frobenius norm is shown in Step 5 of the flowchart in Section 4. It is seen that the convergence criterion monotonically decreases and converges. **Figures 6** and **7** show the time history of water elevation at (*x*, *y*) = (5.0 m, 0.4 m) in Case A and Case B, respectively. It is found that the observation noise can be removed in both cases. **Figures 8** and **9** show the distribution of water elevation on line *y* = 0.4 m in Case A and Case B, respectively. From **Figures 8** and **9**, it can be seen that if the observation point is not set at the upstream side in the channel, the distribution of the water elevation cannot be appropriately obtained. Conversely, from the result of Case A, it can be said that the distribution of water elevation can be correctly obtained if the position of the observation point is appropriately given in the computational model. **Figures 10** and **11** show the distribution of flow velocity *u* and *v* and water elevation *η* at *T* = 2.0 s. It can be seen that water elevation on the upstream side in Case B is not appropriately obtained in comparison with the result of Case A. Therefore, from this numerical example, it can be said that it is necessary to set the observation points uniformly in the computational domain.

## 7. Numerical example 2

In this section, the numerical experiment is carried out with the inflow boundary conditions given in Case B, shown in the previous section. An image diagram of the numerical example is shown in **Figure 12**. The inflow boundary condition is given by *η*(*t*) = sin (*t*). The computational conditions in this section are the same as in **Table 1**. As the computational result, **Figure 13** shows the convergence criterion expressed by the Frobenius norm. It can be seen that the convergence criterion decreases and converges monotonically. **Figure 14** shows the time history of water elevation at (*x*, *y*) = (5.0 m, 0.4 m) in Case C. It is found that the observation noise can be removed. **Figure 15** shows the distribution of water elevation on line *y* = 0.4 m in Case C. From **Figure 15**, it is found that the distribution of the water elevation can be appropriately obtained in comparison with the result shown in **Figure 9**. In addition, **Figure 16** shows the distribution of flow velocity *u* and *v* and water elevation *η* at *T* = 2.0 s. It is seen that water elevation on the upstream side can be more accurately obtained than with the result for Case B. Therefore, from this numerical experiment, it is necessary to give the boundary conditions if the computation of the flow field estimation is carried out based on the Kalman filter FEM, and the observation point cannot be uniformly given.

## 8. Comparison of estimation accuracy in Cases A, B, and C

Based on the estimation result at (*x*, *y*) = (5.0 m, 0.4 m) shown in **Figures 6**, **7**, and **14**, the numerical accuracy is investigated by comparison of data between the true and the estimated values in each case. The *L*_{2} norm with respect to the difference between the true and the estimated values in each case is shown in **Table 2**.

Case | Number of observation points | Inflow boundary condition | L^{2} norm |
---|---|---|---|

Case A | 10 | Not given | 1.899 |

Case B | 5 (only downstream side) | Not given | 4.161 |

Case C | 5 (only downstream side) | Given | 2.463 |

A comparison of the results in Cases A and B shows that it is necessary to set the observation points uniformly in the computational domain to obtain a highly accurate estimation result. In addition, when comparing the results in Case B and Case C, it is found that the estimation accuracy increases if the inflow boundary condition is taken into account.

## 9. Conclusions

In this study, flow field estimation analysis in an open channel was carried out based on the Kalman filter FEM. The shallow water equations were employed as the governing equations, and the Galerkin and the selective lumping methods were used to discretize the governing equation in space and time, respectively. In the numerical experiments, the observed value is created by adding white noise to the simulation result in the open channel model. The following conclusions were obtained from this study.

The observation noise can be removed from the observed value by using Kalman filter FEM.

When the observation points are set only on the downstream side of an open channel, the estimated water elevation on the upstream side is almost constant.

If the inflow boundary condition is given in the case where the observation points are positioned only on the downstream side of an open channel, the distribution of the water elevation can be appropriately obtained, including the upstream side in the open channel.