Computational conditions.

## Abstract

In this chapter, we present numerical examples of an estimation of shallow water flow based on Kalman filter finite element method (Kalman filter FEM). Shallow water equations are adopted as the governing equations. The Galerkin method, using triangular elements, is employed to discretize the governing equation in space, and the selective lumping method is used to discretize time. We describe the influence on the numerical results of setting the observation points.

### Keywords

- Kalman filter FEM
- shallow water equation
- Galerkin method
- selective lumping method

## 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

*, and*q

*indicate the true value of the state variable, the observation value, the constant coefficient, the system, and the observation noise, respectively.*r

*denotes the number of time steps. Figure 1 shows relationship between the observation and the estimation values.*n

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 _{i}, * η*,

*, and*g

*indicate flow velocity component for the*h

*and*x

*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),*y

where Δ, _{i}], [* M*], and

*(0 ≤*e

*≤ 1).*e

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 {

*} and {*z

*} and the matrix [*r

*] denote the observation value and the observation noise vectors and the observation matrix.*H

## 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*], [

*], and [*Q

*] 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.*R

### 5.1. Computation of Kalman gain matrix

1. Set input data: [* A*],

*], [*Q

*],*R

*, (*ε

*= 0 ∼*n

*)*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 * η*(

*) = 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*t

u

_{x},

u

_{y}, and water elevation

*, i.e., the computational result by the FEM, are given at the observation points.*η

Time increment |
0.001 |

Time steps | 2000 |

Number of nodes | 153 |

Number of elements | 200 |

Gravitational acceleration , m/s^{2} |
9.8 |

Lumping parameter |
0.8 |

Initial of estimated error covariance |
1.0 |

Initial of estimated value |
0 |

Convergence determination constant |
0.01 |

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*,

*) = (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*y

*and*u

*and water elevation*v

*at*η

*= 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.*T

## 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 * η*(

*) = 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 (*t

*,*x

*) = (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*y

*and*u

*and water elevation*v

*at*η

*= 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.*T

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

Based on the estimation result at (* x*,

*) = (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*y

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 | ^{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.

## Acknowledgments

This work was supported by Grants-in-Aid for Scientific Research (C) Grant Number 15K05786, and the contents of this work, i.e., formulation by FEM and the theory of the Kalman filter FEM, is based on seminars by Emeritus Professor Mutsuto Kawahara at Chuo University's Department of Civil Engineering. The computations were mainly carried out using the Fujitsu PRIMERGY CX400 computer facilities at Kyushu University's Research Institute for Information Technology. We wish to thank Emeritus Professor Mutsuto Kawahara and the staff at Kyushu University's Research Institute for Information Technology.

## References

- 1.
Kawahara, M., Kodama, T. and Kinoshita, M., Finite element method for tsunami wave propagation analysis considering the open boundary condition. Computers & Mathematics with Applications, Vol. 16 (1988), pp. 139–152. - 2.
Tanaka, S., Bunya, S., Westerink, J.J., Dawson, C.N. and Luettich, R.A., Scalability of an unstructured grid continuous Galerkin-based hurricane storm surge model. Journal of Scientific Computing, Vol. 46, 3 (2011), pp. 329–358. - 3.
Kawahara, M. and Shimada, Y., Gradient method of optimal control applied to the operation of a dam water gate. International Journal for Numerical Methods in Fluids, Vol. 19 (1994), pp. 463–477. - 4.
Kurahashi, T. and Kawahara, M., Flood control of urban stormwater conduit systems using the finite element methods. International Journal for Numerical Methods in Fluids, Vol. 52 (2005), pp. 1029–1057. - 5.
Yonekawa, K. and Kawahara, M., Application of Kalman filter finite element method and AIC. International Journal of Computational Fluid Dynamics, Vol. 17 (2003), pp. 307–317. - 6.
Suga, R. and Kawahara, M., Estimation of tidal current using Kalman filter finite-element method. Computers and Mathematics with Applications, Vol. 52 (2006), pp. 1289–1298. - 7.
Kurahashi, T., Yoshiara, T. and Kobayashi, Y., Verification of estimation accuracy of flow field in a shallow water region based on the Kalman filter finite element method. Transactions of the JSME (in Japanese), Vol. 82, 835 (2016), pp. 1–19.