9
$\begingroup$

Following this question I came across this strange behaviour.

Let me define a 1 D interval implicitely

a = 1; b = 2;
Ω = ImplicitRegion[a <= r <= b, {r}]

and let me try to solve PDEs on this interval.

This works as expected (second order ODE)

w1 = NDSolveValue[{w''[r] == 1/2,
   DirichletCondition[w[r] == 0, r == a], 
   DirichletCondition[w[r] == 0, r == b]}, w, {r, a, b}]

Plot[w1[x], x ∈ Ω]

Mathematica graphics

and so does this

w2 = NDSolveValue[{w''[r] == 1/2,
   DirichletCondition[w[r] == 0, r == a], 
   DirichletCondition[w[r] == 0, r == b]}, w, r ∈ Ω]

This works again as expected (this time 4th order ODE)

w1 = NDSolveValue[{w''''[r] == 1/2,
   DirichletCondition[w[r] == 0, r == a], 
   DirichletCondition[w'[r] == 0, r == a], 
   DirichletCondition[w[r] == 0, r == b], 
   DirichletCondition[w'[r] == 0, r == b]}, w, {r, a, b}]


Plot[w1[x], x ∈ Ω]

Mathematica graphics

Question

But why does this fail?

w2 = NDSolveValue[{w''''[r] == 1/2,
   DirichletCondition[w[r] == 0, r == a], 
   DirichletCondition[w'[r] == 0, r == a], 
   DirichletCondition[w[r] == 0, r == b], 
   DirichletCondition[w'[r] == 0, r == b]}, w, r ∈ Ω]

with the error message The spatial derivative order of the PDE may not exceed two. >>

The only difference being using r ∈ Ω as a domain instead of {r,a,b}.

$\endgroup$
  • $\begingroup$ I think it may be a limitation of the FEM code. $\endgroup$ – Michael E2 Aug 8 '15 at 17:18
  • $\begingroup$ @MichaelE2 But why does it switch to the FEM code if the default code works? $\endgroup$ – chris Aug 8 '15 at 17:20
  • 2
    $\begingroup$ I was just about to add: Because in the non-working code, you use regions. -- That is to say, the use of regions causes NDSolve to go to FEM, without looking at whether the region is amenable to other methods. $\endgroup$ – Michael E2 Aug 8 '15 at 17:20
  • 1
    $\begingroup$ @MichaelE2 it is a pity though is it not? $\endgroup$ – chris Aug 8 '15 at 17:22
  • 3
    $\begingroup$ It's probably irrelevant, but conceptually spatial regions have no innate direction but time does. That fact that Ω could be viewed as having a direction and therefore integrated over as if it were time is a coincidence of it being 1D and the necessity of describing it in terms of a coordinate system. Still, you'd think it could say "FEM failed; integrating as an ODE with temporal variable r." $\endgroup$ – Michael E2 Aug 8 '15 at 18:35
9
$\begingroup$

Right now (V11.3) NDSolve uses FEM for elliptic PDEs and that code does up to 2nd order spatial derivatives. The fact that this PDE can be viewed as a time dependent ODE is a coincidence in 1D as pointed out by @MichaelE2 and time dependent ODE are specified via explicit bounds. Another, harder, issue is that it is not trivial to write a general test to see if an ImplicitRegion is "Simple". Also, this test needs time to execute. This needs to be run for every ImplicitRegionalso ParametricRegions basically everything that is RegionQ and the number of cases where it could help is, I feel, very limited compared to the time it is going to take. Having to specify explicit boundaries is not that bad I think. What possibly could work is to add an indication to the message that this could be solved as a transient ODE or have an example in the >> link. I'll make that a suggestion.

Update:

You can find the message documentation for this now in the help system by directing it to FEMDocumentation/ref/message/InitializePDECoefficients/femcmsd

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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