# Solving the Laplace equation with only Neumann boundary conditions

**URL:** <https://community.wolfram.com/t/solving-the-laplace-equation-with-only-neumann-boundary-conditions/5087>\
**Category:** Questions\
**Tags:** mathematica, calculus, equation-solving, numerical-computation\
**Created:** [March 11, 2015, 3:46pm UTC](https://community.wolfram.com/t/solving-the-laplace-equation-with-only-neumann-boundary-conditions/5087 "2015-03-11T15:46:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jensrix](https://avatars.discourse-cdn.com/v4/letter/j/779978/32.png) [@jensrix](https://community.wolfram.com/u/jensrix)\
**Post date:** [March 11, 2015, 3:46pm UTC](https://community.wolfram.com/t/solving-the-laplace-equation-with-only-neumann-boundary-conditions/5087/1 "2015-03-11T15:46:02Z")

</div>

Hey

I want to solve the Laplace equation with Neumann boundary conditions on all boundaries, The solution seems random when I do not include any DirichletConditions though.

Here is an example of the Laplace in cylindrical coordinates (with cylindrical symmetry). “mesh” and “region” are define on the region 0 \<= r \<= 20 and 0 \<= z \<= 30.

```
T = NDSolveValue[ 
   op == NeumannValue[r, z == 0] + NeumannValue[r, z == 30], 
   u, {r, z} \[Element] mesh, 
   Method -> {"FiniteElement", 
     "MeshOptions" -> {"BoundaryMeshGenerator" -> "Continuation"}}];
Show[
 ContourPlot[T[r, z], {r, z} \[Element] region , Mesh -> None, 
  ColorFunction -> "TemperatureMap", Contours -> 40, 
  AspectRatio -> Automatic, PlotRange -> All, 
  Method -> {"GridLinesInFront" -> True}]
 ]

```

“op” is:

![op.PNG](https://global.discourse-cdn.com/wolfram/original/3X/0/e/0ea42a9100f7397b649cdc86f95b025139a2c628.png)

And I get the result:

 ![plot.PNG](https://global.discourse-cdn.com/wolfram/original/3X/b/2/b2d1642e62cba2d32566abbf097384f62ebf6e23.png)

What do I do wrong?

---

<div class="post-metadata">

**Author:** ![sukrause](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/sukrause/32/41348_2.png) [@sukrause](https://community.wolfram.com/u/sukrause)\
**Post date:** [March 11, 2015, 9:25pm UTC](https://community.wolfram.com/t/solving-the-laplace-equation-with-only-neumann-boundary-conditions/5087/2 "2015-03-11T21:25:42Z")

</div>

First, what does it mean to say

> NeumannValue[r, z == 0]

taken into account that r is an independent variable?

Then there are not enough conditions to avoid randomness in a way. To see that take manual’s example

```
NDSolveValue[{\!\(
\*SubsuperscriptBox[\(\[Del]\), \({x, y}\), \(2\)]\(u[x, y]\)\) == 
   NeumannValue[1., x >= 0.35], 
  DirichletCondition[u[x, y] == 0., x <= -0.3]}, u, {x, y} \[Element] 
  Disk[]]
Plot3D[%[x, y], {x, y} \[Element] Disk[]]

```

and kick the Dirichlet condition out. The result is (in 2D)

```
In[9]:= NDSolveValue[{\!\(
\*SubsuperscriptBox[\(\[Del]\), \({x, y}\), \(2\)]\(u[x, y]\)\) == 
   NeumannValue[1., x >= -1.]}, u, {x, y} \[Element] Disk[]]

During evaluation of In[9]:= NDSolveValue::femibcnd: No DirichletCondition or Robin-type NeumannValue was specified; the result may be off by a constant value. >>

Out[9]= InterpolatingFunction[{{-1., 1.}, {-1., 1.}}, <>]

```

and this NDSolveValue::femibcnd is pretty reasonable. In 3D the question is: Where are the conditions for the shank?

---

<div class="post-metadata">

**Author:** ![nma](https://avatars.discourse-cdn.com/v4/letter/n/b5e925/32.png) [@nma](https://community.wolfram.com/u/nma)\
**Post date:** [March 11, 2015, 11:12pm UTC](https://community.wolfram.com/t/solving-the-laplace-equation-with-only-neumann-boundary-conditions/5087/3 "2015-03-11T23:12:52Z")

</div>

> I want to solve the Laplace equation with Neumann boundary conditions  
> on all boundaries, The solution seems random when I do not include any  
> DirichletConditions though.

You can’t have Neumann boundary conditions on all boundaries. This is ill-posed problem as there is no unique solution in this case. One of the boundaries must be Dirichlet.

---

<div class="post-metadata">

**Author:** ![jensrix](https://avatars.discourse-cdn.com/v4/letter/j/779978/32.png) [@jensrix](https://community.wolfram.com/u/jensrix)\
**Post date:** [March 12, 2015, 10:02am UTC](https://community.wolfram.com/t/solving-the-laplace-equation-with-only-neumann-boundary-conditions/5087/4 "2015-03-12T10:02:56Z")

</div>

By “NeumannValue[r, z == 0]” I mean that the derivative perpendicular to the surface at z=0 is equal to the linear function f(r)=r. This works when I include a DirichletValue.

> Where are the conditions for the shank?

When I don’t specify anything on a boundary, Mathematica uses that NeumannValue[0,boundary]. Right?

> This is ill-posed problem as there is no unique solution in this case.

Sorry, I didn’t make myself clear. I am only going to use the gradient of the solution. When there is no unique solution in this case it means that adding a constant is a solution as well. If I could just specify a single point inside the region (and thereby not spoil the boundaries) I would get a unique solution. Would that be possible?
