ceases. If $\xi_{t}=a$, i.e. if the tank is full, then water flows over the top.

Let $f$ be a real valued function on $\mathcal{I}\times \mathcal{O}$. We assume $X_{t}:=f(I_{t},O_{t}),\ t\geq 0,$ is a (finite state) time-inhomogeneous Markov chain, and we denote by $\mathbf{E}$ the state space of $X$. Let $$\begin{aligned}
v(x):=V(r^{+},r^{-},x),\quad x\in \mathbf{E},\end{aligned}$$ model the water outflow/inflow, in terms of the states of $X$, so that $$\begin{aligned}
v(X_{t})=V(r^{+},r^-,f(I_{t},O_{t})),\quad t\ge 0\end{aligned}$$ represents the water outflow/inflow at time $t$.

Let $\mathbf{E}^{+}$ be the set of states of $X$ such that the water tank has greater water inflow than outflow, and let $\mathbf{E}^{-}$ be the set of states of $X$ such that the water tank has greater water outflow than inflow. The integral $$\begin{aligned}
\varphi_{t}=\int_{0}^{t}v(X_{u})\operatorname{d \!}u\end{aligned}$$ is not exactly the water content at time $t$, because we should take into account those periods when the tank is full or empty. However, as noted in [@rogers1994fluid], understanding $\varphi_{t}$, and the corresponding $\tau_{t}^{\pm}$ and $X_{\tau_{t}^{\pm}}$ allows us to easily express the quantities of interest for $\xi_{t}$ in terms of Wiener-Hopf factorization, and to further compute these quantities once we compute the Wiener-Hopf factorization numerically.

We now assume that the tank has infinite capacity, $a=\infty$, and that 