I'm considering the following PDE

$$ \begin{align} \left[\cos\theta\frac{\partial}{\partial r}-\frac{\sin\theta}{r}\frac{\partial}{\partial\theta}\right]\left[\sin\theta\frac{\partial}{\partial r}+\frac{\cos\theta}{r}\frac{\partial}{\partial\theta}\right]\alpha(r,\theta)=\alpha(r,\theta), \end{align} $$

on the quarter $0\leq r \leq 1$, $0\leq \theta\leq \pi/2$ with conditions

$$ \begin{align} \alpha(r,0)&=1\\ \frac{\partial \alpha(r,\pi/2)}{\partial r}&=1 \end{align} $$

This is not exactly a Neumann boundary value problem, since the imposed derivative is tangential (not normal) to the portion of the surface. Nor is it an elliptic equation but a hyperbolic one, so this is more like a Goursat problem.

When using NDSolve as

pde=-(1/(2 r^2))(2 Cos[2 \[Theta]] ((\[Alpha]^(0,1))[r,\[Theta]]-r (\[Alpha]^(1,1))[r,\[Theta]])+Sin[2 \[Theta]] ((\[Alpha]^(0,2))[r,\[Theta]]+r ((\[Alpha]^(1,0))[r,\[Theta]]-r (\[Alpha]^(2,0))[r,\[Theta]])))+\[Alpha][r,\[Theta]]==0


I get the error

 NDSolve::fembderiv: The expression (\[Alpha]^(1,0))[r,\[Pi]/2]==1 given as a spatial boundary condition for the possibly automatically chosen finite element method should not have explicit derivatives of the dependent variables. NeumannValue should be used to specify spatial derivatives at the boundary.
  • 1
    $\begingroup$ You copy the code with Copy As -> Plain Text, right? This isn't the proper way to copy code. Now all the Derivatives in your code are broken. To copy the code properly, have a look at this: mathematica.meta.stackexchange.com/q/1584/1871 $\endgroup$
    – xzczd
    May 29, 2022 at 23:26
  • $\begingroup$ @xzczd Thank you. $\endgroup$ May 30, 2022 at 7:51

1 Answer 1


Does this approach give reasonable results? Rewrite the PDE

$$ \left( \cos\theta\frac{\partial}{\partial r}-\frac{\sin\theta}{r}\frac{\partial}{\partial\theta}\right) \beta(r,\theta) = \alpha(r,\theta),$$ where $$ \beta(r,\theta)=\left( \sin\theta\frac{\partial}{\partial r}+\frac{\cos\theta}{r}\frac{\partial}{\partial\theta}\right) \alpha(r,\theta), $$

so that the boundary conditions become

$$ \begin{align} \alpha(r,0)&=1\\ \beta(r,\pi/2)&=1. \end{align} $$

pde = {Cos[θ] Derivative[1, 0][β][r, θ] -
    Sin[θ]/r Derivative[0, 1][β][r, θ] == α[r, θ],
  β[r, θ] == Sin[θ] Derivative[1, 0][α][r, θ] +
    Cos[θ]/r Derivative[0, 1][α][r, θ]};

bc = {α[r, 0] == 1, β[r, π/2] == 1};

soln = NDSolveValue[{pde, bc}, {α, β}, {r, 0, 1}, {θ, 0, π/2}];

ParametricPlot3D[{r Cos[θ], r Sin[θ], soln[[1]][r, θ]}, {r, 0, 1}, {θ, 0, π/2}]


Is the warning message important? The solution is not as flat as it looks in this plot.

enter image description here

  • $\begingroup$ Nice. Thank you ! Although I was looking also for a generic explanation about how to implement those kinds of boundary conditions, this is a quick detour. $\endgroup$ May 30, 2022 at 12:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.