  The author studies the diffusion problem $u_t=u_{xx},\ 0<x<1,\ t>0; \
u(x,0)=0,$ and $-u_x(0,t)=u_x(1,t)=\phi(t),$ where $\phi(t)$ is a control
function that ensures that the total mass $\int_0^1 u(x,t_k)dx$ stays between
two predetermined values. Mathematically, $\phi(t)=1$ for $t_{2k} < t<t_{2k+1}$
and $\phi(t)=-1$ for $t_{2k+1} <t<t_{2k+2},\ k=0,1,2,\ldots$ with $t_0=0$ and
the sequence $t_{k}$ is determined by the equations $\int_0^1 u(x,t_k)dx = M,$
for $k=1,3,5,\dots,$ and $\int_0^1 u(x,t_k)dx = m,$ for $k=2,4,6,\dots$ and
where $0<m<M<u_0$. Note that the switching times $t_k$ are unknowns.
Determination of switching times $t_k$ and their differences $t_{k+1}-t_k$ are
obtained. Numerical verifying examples are presented.
