NeumannValue and FiniteElement Methods : BC not respected

I have noticed on several of my personal cases some issue with the BC using NeumannValue. Let me illustrate the problem.

I take the 1D example of NeumannValue

un = NDSolveValue[{D[-u[x], x, x] + 10 u[x] == 1 + NeumannValue[-1 + u[x], x == 1],
DirichletCondition[u[x] == 0, x == 0]}, u, {x, 0, 1}]

then I check if I do verify the BC un = 0. So that is a good thing for DirichletConditions (seems to work properly)

Now the Robin condition: un' - (-1 + un) = 0.00259342

It is not correct... Ok zero is a little hard to ask but at least it should be of the order of machine errors

Moreover, if I use NDSolve instead :

un = u /.NDSolve[{D[-u[x], x, x] + 10 u[x] == 1, u' == -1 + u,u ==0}, u,
{x, 0, 1}][]

I get

un' - (-1 + un) = -3.16211*10^-7
un = 0.

Have you encounter similar issue? how to fix it?

Thanks

• I continued Looking it up. It is possible to improve the result of NDSolveValue by reducing the mesh size : un = NDSolveValue[{D[-u[x], x, x] + 10 u[x] == 1 + NeumannValue[-1 + u[x], x == 1], DirichletCondition[u[x] == 0, x == 0]}, u, {x, 0, 1}, Method -> {"FiniteElement", "MeshOptions" -> {MaxCellMeasure -> 0.0001}}] Mar 11 '16 at 16:08
• I think you could post your comment as an answer for future reference. Mar 22 '16 at 2:03