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 ∈ Ω]
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 ∈ Ω]
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}
.
Answer
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 ImplicitRegion
also 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
Comments
Post a Comment