I would like to solve the following non-linear Poisson equation (as a toy problem for a more complicated problem)

c = 1 + \[Delta]*
    Inactive[Grad][\[CapitalPhi][r], {r, \[Theta], \[Phi]}, 
       r], {r, \[Theta], \[Phi]}, "Spherical"];
lhs = Inactive[
   Div][({{c, 0, 0}, {0, c, 0}, {0, 0, c}}.Inactive[
      Grad][\[CapitalPhi][r], {r, \[Theta], \[Phi]}, 
     "Spherical"]), {r, \[Theta], \[Phi]}, "Spherical"]
rhs = 1


\[CapitalPhi]1 = 1
Omega = Line[{{0}, {1}}];
bc = DirichletCondition[\[CapitalPhi][r] == \[CapitalPhi]1, r > 0];

Simplest case \[Delta]=0 works only if I activate the lhs as

num = NDSolveValue[{Activate[lhs] == rhs, bc}, \[CapitalPhi], 
  Element[{r}, Omega]] (* works *)
numG = 
 NDSolveValue[{lhs == rhs, bc}, \[CapitalPhi], 
  Element[{r}, Omega]] (* doesn't work *)

i.e. for non-active lhs Mathematica complains "Inactive[Div] called with 3 arguments; 2 arguments are expected". However, when \[Delta]=1 the equation in the activated form doesn't work ("The maximum derivative order of the nonlinear PDE coefficients for the Finite Element Method is larger than 1. It may help to rewrite the PDE in inactive form.") and the non-actived one still has the same problem.

In other words, I would like 1. to solve PDE using an inactive form for the operators in the FEM formalism but 2. to exploit the symmetry of the problem in order not to solve the full 3D problem but instead a 1D one. How can I overcome this tension and apply the vector operators defined in 3D on a function that doesn't depend on one or two of these variables?

(I am interested in a problem that is in fact not a 1D problem so I can't use a ODE solver instead of a PDE one)

  • 1
    $\begingroup$ It's not immediately clear from the document but the formal PDE/Inactive PDE for FiniteElement method is only defined for Cartesian coordinates. You can use NDSolve`FEM`GetInactivePDE to check what has actually happened internally for δ=0 case. $\endgroup$
    – xzczd
    May 5, 2022 at 4:23

1 Answer 1


Up until version 13.0 the finite element method works with Cartesian coordinates. In 13.1 one can use a truncated cylindrical coordinate for axisymmetric PDEs. It's unlikely that something else will be implemented in the foreseeable future.

  • $\begingroup$ So, 13.1 is coming? $\endgroup$
    – xzczd
    Jun 1, 2022 at 11:53
  • 1
    $\begingroup$ @xzczd, well eventually ;-) jokes aside, we had the code freeze and have seen some other way points. So I'd rather sooner than later. A shot in the blue, may in a month? $\endgroup$
    – user21
    Jun 1, 2022 at 11:55

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.