This chapter discusses a straightforward application of the EnKF with a linear advection equation. The example illustrates the smooth spatial update that the EnKF provides and how information propagates with the flow. Furthermore, we will see how the EnKF provides consistent error statistics.

1 Experiment Description

We now present an extension of the linear update example from Chap. 13 using the EnKF described in Chap. 8, including a recursion in time. We consider a linear advection model on a periodic one-dimensional domain where a wave propagates from left to right. As in the example of Chap. 13, we define a non-dimensional grid with \(\Delta x =1\) and 1024 grid cells. Also, we define a non-dimensional time step \(\Delta t =1\) and constant advection velocity \(u=1\).

Thus, we now consider the data assimilation on a rectangular space-time domain where the model dynamics propagates the information forward in time from one assimilation update to the next, subject to stochastic model errors sampled from \(\mathcal {N}(0,0.0009,20)\). With a linear dynamical model, any of the error-propagation equations will give the same result (with the ensemble approach requiring an infinite ensemble size). We have used an EnKF implementation with 5000 realizations, which is large enough to make the EnKF and KF solutions practically indistinguishable. After each update we integrate the updated ensemble forward, subject to stochastic noise until the next update step.

We can relate this problem to a formulation with multiple assimilation windows defined from a measurement time up to and including the next measurement time. We also consider the filtering problem described in Sect. 2.4.2, where we update the solution at the end of the assimilation window. This update serves as the initial condition for further integration through the next assimilation window.

As in the previous section, we simulate a true pseudo-random wave sampled from \({\mathbf {z}}_\text {true} \sim \mathcal {N}(\mu =4,\sigma ^2=1,r_d=20)\). We also generate the initial ensemble using the procedure from Chap. 13, starting from a first guess field \({\mathbf {z}}_\text {fg}\) computed using Eq. (13.2) with \({\mathbf {z}}\sim \mathcal {N}(0,\sigma ^2=1,r_d=20)\). Then we add the ensemble of perturbations \({\mathbf {z}}_j \sim \mathcal {N}(0,1,20)\) to the first-guess to create the initial ensemble from Eq. (13.3).

To generate the measurements, we integrate the model forward using the exact dynamical model starting from the true solution at \(t=0\). We measure the true solution at 10 equidistributed spatial locations at every \(\Delta t = 5\), and we add uncorrelated noise to the measurements sampled from \(\boldsymbol{\epsilon }\sim \mathcal {N}(0,\sigma ^2=0.04)\).

2 Assimilation Experiment

Figure 14.1 presents three snapshots at \(t=10\), \(t=50\), and \(t=100\), hence after 2, 10, and 20 updates. The thick blue line is the ensemble mean, with the light blue shading representing plus and minus two standard deviations of the ensemble variance. We also show the yellow circles with their two standard-deviation error bars representing the measurements. The green line at the bottom of the plots is the estimated ensemble standard deviation. We have also included a thin dashed line, which is the true solution to recover through the data assimilation.

From the plots we notice how the assimilation of measurements pulls the solution closer to the measured value at the measurement locations. Simultaneously, the ensemble spread and error variance reduce. From the green line we also notice how the information from the measurements propagates downstream. As the model is also subject to a stochastic system noise or model error, there is a linear increase in error variance downstream of each measurement. The final plot is a quasi-stationary solution where the variance increase resulting from the introduced stochastic forcing balances the variance reduction from the assimilation updates. Note that the updated ensemble’s standard deviation at each observation point is similar to the observation error standard deviation of 0.2, as expected from Kalman filter theory. The code used is available from

Fig. 14.1
figure 1

The plots show a time sequence of estimates from using EnKF with a linear advection equation. The thick blue line is the ensemble mean, while the blue shadow illustrates the ensemble spread by showing plus-minus two ensemble standard deviations. The reference solution is the dashed blue line, and the observations are the yellow dots, including an error bar indicating plus-minus two standard deviations. The green line is the estimated ensemble standard deviation. This example is further illustrated in the animation available from

In the following chapters, we will introduce nonlinearities to the assimilation problem, which makes the assimilation process and the interpretation of the results more complicated.