MATLAB: How to get the solution to converge in a pure Neumann problem

convergeneumannPartial Differential Equation Toolboxpure

How to get the solution to converge in a pure Neumann problem?
I am solving a PDE in a 4-sided geometry.
How to get the solution to converge in my example code (myPDEExample.m)?
I receive a step size too small error as follows:
ERROR: Error using pde.EquationModel/solveStationaryNonlinear (line 104)
Stepsize too small.
Error in pde.PDEModel/solvepde (line 77)
u = self.solveStationaryNonlinear(coefstruct, u0);
Error in myPDEExample (line 51)
results = solvepde(model);

Best Answer

A Neumann problem such as this would not have a unique solution if it is not accompanied by an additional constraint or a reference Dirichlet boundary condition. Please refer to the following technical article (first few sections details the problem) for more information:
Note : The below mentioned link is an archived link
The easiest workaround would be to set the value of solution at some point equal to zero (Dirichlet boundary condition). However, we do not provide an interface to specify the solution at a point. So, the next best option is to split an edge and specify a reference value on that edge as Dirichlet boundary condition.  The following link will help show how to do this: