# Solving Poisson PDE with NDSolve and incomplete BC specifications

When solving the following PDE with a missing BC on the fourth edge ($$y=1$$):

sol = NDSolveValue[{D[u[x, y], {y, 2}] + D[u[x, y], {x, 2}] == (1-y),
DirichletCondition[u[x, y] == 0,(y==0||x==-1||x==1)]}, u, {x,y} \[Element] Rectangle[{-1,0},{1,1}]]


MMA returns an output. I would have expected an error such as missing BC. It seems that it implicitly considered a Neumann condition $$\partial_n u = 0$$ on $$y=1$$:

Plot[D[sol[x, y], y] /. y -> 1, {x, -1, 1}, PlotRange -> Full]


Plus, I get the same output when I specify NeumannValue:

sol = NDSolveValue[{D[u[x, y], {y, 2}] + D[u[x, y], {x, 2}] == 1-y + NeumannValue[0, y == 1],
DirichletCondition[u[x, y] == 0,(y==0||x==-1||x==1)]}, u, {x,y} \[Element] Rectangle[{-1,0},{1,1}]]


Is there a rational behind the apparent autocompletion of missing BCs with 0 Neumann conditions?

• It seems that it implicitly considered a Neumann condition Yes. That is correct. When solving using FEM method that is the case. From help so not specifying a boundary condition at all is equivalent to specifying a Neumann 0 condition this means NDSolve also used FEM to solve your pde (because you used DirichletCondition . see NeumannValue.html Oct 21, 2023 at 7:47
• @Nasser Where is this in the help? On the contrary, the doc for NDSolve (v13) states "The differential equations must contain enough initial or boundary conditions to determine the solutions for the yi completely." Edit In the NeumannValue doc, OK, thank you. Oct 21, 2023 at 7:49
• @Nasser It seems FEM is used for some reasons other than DirichletCondition: NDSolveValue[{D[u[x, y], {y, 2}] + D[u[x, y], {x, 2}] == (1 - y), u[x, 0] == 0, u[-1, y] == 0, u[1, y] == 0}, u, {x, -1, 1}, {y, 0, 1}] returns the same output. Anyway, you answered my question. I don't know if I should close my question, as it can be found in the doc but not easily. Oct 21, 2023 at 8:23
• It could be that FEM is selected even if you do not use DirichletCondition. It depends on the problem. I am not sure how it decides internally. But I think if you use DirichletCondition or explicit Neumann then it does select FEM in that case since these go with FEM method. You could leave the question open if you want, may be someone will have more official answer and more details. It is up to you. Oct 21, 2023 at 8:27
• If you search "Neumann zero" in this site, you'll find quite a few related posts e.g. mathematica.stackexchange.com/a/222373/1871 mathematica.stackexchange.com/a/282379/1871 , but I cannot find a post focusing on this topic at least for now. Oct 21, 2023 at 11:57