# Solving the 2D heat equation

I am trying to solve the 2D heat equation (or diffusion equation) in a disk:

NDSolve[{\!$$\*SubscriptBox[\(\[PartialD]$$, $$t$$]$$f[x, y, t]$$\) == \!$$\*SubsuperscriptBox[\(\[Del]$$, $${x, y}$$, $$2$$]$$f[x, y, t]$$\),
f[x, y, 0] == E^(-x^2 - y^2)}, {t, 0, 1}, {x, y} \[Element] Disk[]]


but I get this error

NDSolve::underdet: There are more dependent variables, {f[x,y,0],f[x,y,t],(f^(0,0,1))[x,y,t]}, than equations, so the system is underdetermined.


I want to include the Neumann boundary condition such that the normal derivative is zero. How can I include that?

edit: user21 fixed my mistake, here is a density plot from the code

DensityPlot3D[f[x, y, t] /. sol, {x, -1, 1}, {y, -1, 1}, {t, 0, 1},
PlotRange -> All, AxesLabel -> Automatic]


with sol the solution as found below. • Please, post the code of the 3D plot – Jose Enrique Calderon Jun 30 '17 at 17:43
• done, see edit. – Ruud3.1415 Jul 2 '17 at 13:19

## 1 Answer

You need to add the dependent variable f like so:

NDSolve[{Derivative[0, 0, 1][f][x, y, t] ==
Derivative[0, 2, 0][f][x, y, t] + Derivative[2, 0, 0][f][x, y, t],
f[x, y, 0] == E^(-x^2 - y^2)}, f, {t, 0, 1},
Element[{x, y}, Disk[{0, 0}]]]


Concerning the Neumann zero boundary condition: Neumann zero boundary conditions are the default so nothing needs to be done.

• yes... I should have done that.. Thanks user21! Also thanks for the info andre! – Ruud3.1415 Jun 30 '17 at 17:30
• @andre, thanks added your comment to the post. – user21 Jun 30 '17 at 17:55