Auto Floodgate Control Using EnKf-NMPC Method

One of the flood controls, especially in the downstream areas are barrage. Those are optimized using Ensemble Kalman filter based non linear predictive control. Ensemble Kalman Filter is used to predict water levels and flow of waters when it reaches the barrage. The results obtained from this method is then used as input for controlling the floodgates. Simulations are performed in three circumstances, namely the normal flow, flooding and drought. For normal flow, using optimum quantities are obtained from NMPC by opening the floodgates. Simulations were performed for 100 hours, with a gap of 5 per hour of observation. EnKf fulfilled with RMSE yields accuracy of the system and estimates of less than 1, RMSE debit is 0.5346 and RMSE water level is 0.2716. Furthermore the operation of the opening gate achieves optimum value, with the movement of between 40 − 65 per cent, with an average difference of movement is 0.10065 percent. Flood conditions, the water flow 2, 000 m/s and the water level 10 m operation of opening gate ranging between 98−100 per cent and the amount of the difference opening gate is 0.028835. RMSE to estimate the flow rate of 1.5835, while for the water level of 0.3145. While the flow conditions dry, with water flow 10 m/s and the water level 1 m operation of opening gate ranging between 0 − 1 per cent and the amount of the difference opening gate is 0.41289 percent. RMSE to estimate the flow rate of 0.0826, while for the water level of 0.0677.


I. INTRODUCTION
F LOOD is the event of the setting of the mainland (which is usually dry) because of increased water volume.Floods can also be defined as extreme discharge of a river.Flooding can occur due to excessive water in a result of a big rain, river water, river or dam outbreak due to a tropical storm.Flooding occurs due to various factors such as natural and human action itself.Naturally flooding occurred due to high rainfall, the effect of physiography (the shape of the river), erosion and sedimentation, river capacity.Of the various factors needed serious handling of the the problem of flooding is often called flood control.
Flood control can be done by the barrage.The barrage has floodgate control that can open and close.It can be utilized by the surrounding community.In the rainy season it can be used as flood control, during the dry season can be used as water irrigation for farms and potentially also as a tourist spot.The problem that arises is when the arrival of waters toward the barrage is uncertain, and unscrew the water dam operations.The opening level of the gate should be such that no overflow water through the top of barrage.So it is necessary to control the floodgates to operate with a maximum.
The barrage is a building that cross through the river which is equipped with a water gate.Sluice aims to regulate the water level in the dam.Weir motion has a small water level changes.Often built when the edges / or frequent low river bank built in the downstream areas of the river.Closing the sluice gates only occur during the low water level and when a flood opened fully so that flooding can pass through the weir.
In the operation of the floodgate required height of water level in the reservoir.In calculating the water level, we consider the flow of the river before the barrage and hydrological cycle that occurs in reservoir.Estimates of inflow of the river is necessary because the water flow is uncertain.
The authors of [1] have conducted a research on the application of Kalman filter based on non linear MPC to control the floodgates.This method is used to control the water that will be used as a hydroelectric power plant.With the result that it can replace manual controls with NMPC to control the floodgates to safeguard the environment from flooding.Additionally [2] has done research on flood forecasting using hydrodynamics model using the Kalman filter method, the result is that the predicted outcome of the measured data and the accuracy is higher than using Hydraulic models.
In this work, the previous research that has been done by [1] will be applied and developed in the motion control sluice weir located on the river to overcome the problem of flooding.Many techniques have been used to predict floods, based on the model hydraulic routing.Compared with other methods Kalman filter is a method that is efficient to predict real-time flood series because it is based on the estimation of minimum variance so that it can reach the estimated optimum of state variables in the system.Meanwhile, interpolation dynamic consistently able to update the entire state of system modelling based information from measurement [2].We use a variation of Kalman filter called ensemble Kalman filter (EnKF).The advantages of the method is ensemble Kalman filter can be used in non linear equations without having to linearize the model.Movement of waters from the floodgate's barrage will be controlled by using non linear MPC (Model Predictive Control).In estimating the concentration of pollution of underground, ensemble Kalman filter gives better accuracy but requires more time compared with Kalman filter [3].

A. One-Dimensional Hydrodynamics Model
Hydrodynamics study the movement of waters and the force acting on the water.Hydrodynamic model equations have the form of a one-dimensional, two-dimensional and threedimensional model.The equation of one-dimensional (1D) is defined in the coordinate space, and the direction perpendicular to the main channel is ignored.This model is often used in shallow streams and does not have any steady flow.Onedimensional hydrodynamic model equation is often called the St. Venant equation.Here is the equation of conservation of mass and momentum: where width of the surface of the river, A denotes the sectional area, Q denotes the output, y denotes the elevation of the water surface, S f denotes the shift in flatness due to resistance, α denotes the coefficient correction momentum (1.0), and g denotes the coefficient of gravity acceleration, R is the hydraulic radius, P is the circumference of wet cross-section of the river.The discretization method is 4point Preissmann using implicit scheme.Preissmann method is illustrated in Fig. 1.In Fig. 1, ∆x is the space interval, ∆t is the time interval, ϕ is the weighting coefficient of distribution form in space, 0 ≤ ϕ ≤ 1, θ is the weighting coefficient of distributions on time, 0 ≤ θ ≤ 1.We assume ϕ = 1 2 , which means that the achievement is at the mid-point between the point i and i + 1.To predict the state at time at j + 1, we use EnKF (Ensemble Kalman filter) method.Because non linear forms are too complex to be formed directly into the state equation in the Kalman filter, then we leverage matrix formation using Newton-Raphson method.We acquire the following equation: Fig. 2. Floodgate [1] where X, F are vectors with Function F is a result of discretization of the equation for conservation of mass and momentum.Variable J is a derivative function from F .

B. Reservoir Model
The reservoir model obtained from the continuity equation assumes that the water is inelastic.The value of the geometry of the reservoir is A s [η(t)], this means that the outside area depends on the water level at that time.Reservoir models are not linear equations, given as follows: where η is the water level, A s is the surface area, Q in is the debit inflow, Q out is the debit outflow, Q p is the outflow for irrigation, Q G is the outflow from floodgates.

C. Floodgates Barrage
Barrage has a floodgate that serves as the controlling inflow, outflow and water level.Opening gate type of barrage is revolving gates that can be seen in Fig. 2. The equation of the floodgates is a non linear equations [1].
where A G is the area of the sluice, OP is the opening gate, S D is the downstream level, g is the acceleration of gravity, η is the elevation of waters, ε is the output coefficients.Parameter ε can be estimated based on the model variations and the floodgates with reality.The limit for parameter level ε is

A. Ensemble Kalman Filter
Ensemble Kalman filter (EnKf) was first introduced by [4], which uses statistical sample ensemble forecasting on nonlinear systems.The general form of EnKf in the stochastic nonlinear dynamical systems is where the linear measurement data z k ∈ is defined as: where x k is the state variable at time k, u k is the input vector at time k, z k is the measured data at time k, H k is the matrix of measurement that indicates the measured variable.Finally w k and v k are a white noise and measurement system white noise with zero mean and covariance Q k and R k , respectively.
The estimation process begins with developing a number of EnKF ensembles with mean 0 and covariance 1.This ensemble is generated by using the random normal distribution.
2) time update • generate the N-ensemble of time update estimation • error covariance of time update estimation 3) measurement update • generate the ensemble of measurement data where v k,j ∼ N (0, R k ) are the ensemble of measurement noises • Kalman gain • the mean of measurement update estimation • error covariance of measurement update estimation

Nonlinear Model Predictive Control
A nonlinear model predictive control (henceforth abbreviated as NMPC) is an optimization method based on feedback control of nonlinear systems.The basis of this application is the stabilization and tracking problems, that became the basis of model predictive control [5].The steps in nonlinear predictive control models are given in Fig. 3: 1) getting measurement/estimation the system 2) calculate the input signal with minimum objective function by providing a prediction horizon using a model of the system.3) implementing step 1 of the input signal to the optimum until the new measurement/estimation of the state is available.4) back to step 1 Implementation of the NMPC are open and close the opening gate.The model is a combination between the floodgate and reservoir models.After discretization given in the NMPC formula, the objective function is where J is the objective function, η is the water level , λ is the optimization parameter, k is the time index.In other words, the objective is calculating the gate opening in the control horizon to minimize costs.The algorithm is as follows: The constraints are where η edge is the level of reservoirs.

IV. ANALYSIS AND RESULT
Before estimating inflow using ensemble Kalman filter, let us describe initial value and the estimated value of the required parameters.The initial value of the phase estimate is Q(x, 0) = 200m 3 /s, y(x, 0) = 3m for a normal flow, Q(x, 0) = 2000m 3 /s, y(x, 0) = 10m at the time of the flood, and Q(x, 0) = 10m 3 /s,y(x, 0) = 1m at the time of drought.The length of the river is assumed to be 30km.The time interval is 100 hours.Furthermore, the estimated value to zero sought x0 to initial value in a number of ensembles.Thus we obtain the covariance P x0 .By using the steps in accordance with the methodology described above, the final result is estimated inflow rate chart on the barrage.The observation data at the first place of observation, middle, and the end of rivers (15 meters far away from the barrage).The first simulations are carried out during normal flow.This means that the flow rate of the river is still in the normal range, normal discharge and water level, initial value of the discharge at the first observation point is 200 m 3 /s with a water level of 3 m.This occurs in the transition between the dry and rainy seasons, the irrigation needs are still met.The figure of normal inflow can be seen in Fig. 4. Value of discharges and water level at the last point of observation used as input (Q in ) to the reservoir model of barrage.Graph of the discharge and the height of river flow at the last point of observation (within 1.5 km from the water) can be seen in Fig. 5. Figure 5 shows that the estimate values are close to the real values.With the ensemble Kalman filter method, we can determine that the water level and river discharge were unsteady flow.This is the equation of Root Mean Squared Error (RMSE) to measure the difference between estimated value and the system value, if the RMSE is close to zero, its mean estimation value is close to the real value: Where RMSE is the root mean squared error, t is the time of observations, n is the time limit of observations, x t is the state variable value from the system at time t, and xt is the estimation value from state variable at time t.The simulation time (t) is 100 hours.In the next stage, the inflow is used as input to the system of floodgate control.The NMPC system requires sampling time.Here are the results of NMPC method, to control the floodgate, the state variables are water levels' barrage.
Fig. 6.Water level of the barrage.The result of opening Gate at the normal condition can be seen in the Table II.Table II shows the value of a water level of the barrage, the cost function and the auto floodgate.The inflow (Q in ) is generated from the estimation using EnKf.Data shown in the table are the simulated data every 5 hours.The movement of the barrage ranges between 49 to 51 percents.This means that the energy is used sparingly, and reduce the cost needed to drive the floodgates.
The results of the simulation of auto floodgate at the time of the flood and dry can be seen in Figs. 8 and 9.
Application of the ensemble Kalman filter-Nonlinear model predictive control method to control the opening gate with different cases obtained the following results: • In the condition of normal flow, the water flow is 200 m 3 /s and the water level is 3m.Operation of door movements ranging between 49 − 51 percent with an average cost function of 9.5367 × 10 35 and the average difference between opening gate is 0.10065 percent.This means that the energy changes during operation of the weir motion is 0.10065 percent.RMSE to estimate the flow rate is 0.5346, while for the water level is 0.2716.
The average velocity of flow is 0.3139m/s.V. CONCLUSION Based on the results and analysis, it can be concluded that: 1) Ensemble Kalman filter method can be applied to estimate the discharge and the height of the river flow, and inflow rate of barrage.It is evident from the RMS error that is relatively small in each state.
2) The results showed that the ensemble Kalman filternonlinear model predictive control method is an effective method to estimate the discharge and the height of the river flow by RMSE less than 1, and the change in gate opening is less than 25 percent.EnKf-NMPC method automation can replace manual opening gate.

Fig. 4 .
Fig.4.The top and bottom plots represent water level and discharges from upstream to downstream, respectively.

Fig. 5 .
Fig. 5.The top and bottom plots represent water level and discharges at the downstream.
Table of parameter values can seen in Table I.

TABLE I THE
PARAMETER VALUE OF RIVER

TABLE II THE
RESULT OF AUTO FLOODGATE CONTROL USING ENKF-NMPC METHOD FOR 100 HOURS IN FIVE SAMPLING TIMES.