I am trying to solve the 2D heat equation $$\Delta u =u_t$$ with Dirichlet boundary conditions on the rectangle $(0,a)\times (0,b)$ and with initial condition $u(x,y,0)=g(x,y)$. This is my code
g[x_,y_]:=x^2+y^2
a=1;
b=2;
s = NDSolve[{Laplacian[un[x, y, t], {x, y}] == D[un[x, y, t], {t, 1}],
DirichletCondition[un[x, y, t] == 0, True],
un[x, y, 0] == g[x, y]},
un, Element[{x, y},Rectangle[{0, a}, {0, b}]]] // Flatten
ParametricPlot3D[{x, y, un[x, y, 1] /. s}, {x, 0, a}, {y, 0, b}, PlotRange -> All, BoundaryStyle -> Directive[Blue, Thick]]
The code is not working, what is my mistake?
g[x, y]
. How to expect it to be solved numerically? Mathematica is very powerful software but even it can not guess what $g(x,y)$ could be without telling it. $\endgroup$