2
$\begingroup$

Solving a 1D dispersive wave equation with NDSolve and the finite element method seems to give completely wrong results. Consider the 1D PDE below

eq = D[f[t, x], {t, 2}] - D[f[t, x], {x, 2}] - D[f[t, x], {t, 2},{x, 2}]==0

with an initial shape for f as shown below and zero speed:

shape = Cos[32*Pi*(-0.5 + x)]/E^(120.*(x-0.5)^2);
ics ={f[0, x] == shape, Derivative[1,0][f][0,x]==0};
Plot[shape,{x,0,1},Frame->True, PlotLabel->{"x","f[0,x]","initial shape"]}]

enter image description here

Solving the problem for x in the {0,1} region with NDSolveValue (and implicit zero Neumann values, which are anyway irrelevant at short times when the wave has not reached the region boudaries yet) renders a solution without error:

sol=NDSolveValue[{eq, ics} // Flatten, f, {t, 0, 0.25}, {x} \[Element]region,
  Method -> {"FiniteElement", "MeshOptions" -> {"MaxCellMeasure" -> 0.005}}];

This solution plotted below is obviously wrong since it displays no dispersion, despite the D[f[t, x], {t, 2},{x, 2}] term in eq!!!

enter image description here

More precisely, plotting the three terms of the equation a t = 0 for instance shows that the last (and giant) term has been simply ignored without notice:

enter image description here

The equation which has been solved is actually

eq2 = D[f[t, x], {t, 2}] - D[f[t, x], {x, 2}]==0

This is strange since according to the documentation pasted below, the original equation eq fullfills all the requested conditions to be solvable (Transcient PDE in 1D, single PDE with derivatives that are second order in space and second order in time, linear with constant coeff, zero Neumann values):

enter image description here

$\endgroup$
  • 1
    $\begingroup$ I am a bit surprised that you are not presented an error message stating that Mathemtica's FEM capabilities do not support fouth-order PDE. To my knowledge, they do not and D[f[t, x], {t, 2},{x, 2}] is a fourth order term. $\endgroup$ – Henrik Schumacher Mar 20 at 12:58
  • 1
    $\begingroup$ Thanks Henrik. 1) Where did you find this information in the doc. 2) And what does "...derivatives up to second order in space and arbitrary order in time" mean, in the section of the documentation that I have copy-pasted above ? $\endgroup$ – user3650925 Mar 20 at 13:43
  • $\begingroup$ Good point! Okay, I am not sure whether your use case is supposed to be covered or not. Let's ask @user21; as developer, he will definitely be able to tell. $\endgroup$ – Henrik Schumacher Mar 20 at 13:47
  • $\begingroup$ @HenrikSchumacher It's solved as a transient PDE (see this tutorial). One can see some evidence with Head /@ sol["Coordinates"] (I used region = Line[{{0}, {1}}]). $\endgroup$ – Michael E2 Mar 21 at 0:01
  • 1
    $\begingroup$ @HenrikSchumacher, yes the documentation is not quite clear on this: I have changed the sentence to "Transcient PDE in 1D, single PDE with derivatives that are second order in space OR second order in time.." That should be better. I'd need to look at why this does not give a warning but that is nothing I can fix for 12.0 $\endgroup$ – user21 Mar 21 at 6:07
5
$\begingroup$

Unfortunately, the FEM in version 11.3 (and the upcoming V12.0) can not handle mixed temporal and spatial derivatives. Also, I have updated the documentation you link to:

"Transcient PDE in 1D, single PDE with derivatives that are second order in space OR second order in time.."

This should make things clearer. The fact that the term is simply ignored is unfortunate; it probably should give a warning. Your only chance for this type of PDE is to use the "TensorProductGrid" discretization.

$\endgroup$
  • 1
    $\begingroup$ Thank you user 21. I mark my question as answered. But I am not convinced that just replacing the and by an or in the pointed doc is enough to be clear. I suggest to be more explicit in what is handled or not. Something like " - single and coupled PDEs with derivatives up to second order in space only and arbitrary order in time only" would be preferable. By the way I could not see the change at reference.wolfram.com/language/FEMDocumentation/tutorial/… $\endgroup$ – user3650925 Mar 21 at 9:39
  • $\begingroup$ @user3650925, the change is made in V12.0 and will be visible once released. $\endgroup$ – user21 Mar 21 at 13:04

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.