I am looking at numerical solutions to the heat equation with Dirichlet and Neumann conditions on the same boundary. That is $u(x,t)$ satisfying $$ u_t = u_{xx}\,, \quad x \in[0,1]\,, \quad t>0\,, $$ with $$ \begin{gathered} u(x,0) = u_0(x)\,,\\ u(0,t) = g(t) \quad \forall \, t>0\,,\\ u_x(0,t) = h(t) \quad \forall \, t>0. \end{gathered} $$ This is with a view to solving an advection-diffusion problem with the same BCs.

If I discretise on $N+1$ points, $$ U^n_j \approx u(j \Delta x, n \Delta t) $$ with $\Delta x = 1/N$ then I would expect to discretise as $$ (U_j)_t = \frac{1}{\Delta x^2}\left[ U_{j-1} - 2 U_j + U_{j+1} \right]\,, $$ but then I can't see how to discretise both the boundary conditions. If I let $$ U_0(t) = g(t)\,, $$ and $$ \frac{U_1(t) - U_0(t)}{\Delta x} = h(t) $$ then I have an issue determining $(U_N)_t$.

Resentfully I tried discretising with backwards difference twice $$ (U_j)_t = \frac{1}{\Delta x^2}\left[ U_{j-2} - 2 U_{j-1} + U_{j} \right]\,, $$ which allows me to impose both boundary conditions on $(U_2)_t$, but I think this is unconditionally unstable.

Does this even make sense? I was thinking about a shooting method using a shooting parameter $s$ with $u(1,t)=s$ to try to match $u_x(0,t;s)=h(t;s)$ at each time step, but this feels inefficient.

  • $\begingroup$ Possible duplicate: scicomp.stackexchange.com/q/20836 (or at least related)? $\endgroup$ Commented Nov 16, 2016 at 21:35
  • 6
    $\begingroup$ Short answer: This is called a lateral Cauchy problem and is the textbook example of an ill-posed problem (meaning it does not admit a stable solution), independent of any numerical method. There are ways of approximating this problem with a family of stable problems, such as the quasireversibility method (basically, add a very small fourth-order term to the equation, such that these boundary conditions become well-posed). But in general you should rather ask yourself whether that is really the right model. $\endgroup$ Commented Nov 16, 2016 at 21:41

1 Answer 1


In the comments Christian directed me towards lateral Cauchy problems and the fact that this is a textbook example of an ill-posed problem.

Following this lead, I found that this is more specifically know as the sideways heat equation. As an alternative to the suggested quasireversibility method (again Christian), there is a proposed sequential solution in Berntsson (2003).

[Berntsson (2003)] Fredrik Berntsson , Sequential solution of the sideways heat equation by windowing of the data, 2003, Inverse Problems in Engineering, (11), 2, 91-103.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.