## We have moved the forum to https://forum.ngsolve.org . This is an archived version of the topics until 05/05/23. All the topics were moved to the new forum and conversations can be continued there. This forum is just kept as legacy to not invalidate old links. If you want to continue a conversation just look for the topic in the new forum.

#### Notice

The forum is in read only mode.

# Wave Equation with Explicit Euler Time Integration

1 year 4 months ago - 1 year 4 months ago #4586 by pmaurerl
Hi,

I am trying to solve the wave equation using explicit Euler time stepping (for the sake of simplicity) by substituting $\dot{p}= q$.
Thus, I am solving the set of equations summarized in the attached PDF-file .

For 1D, I am running the attached (executable) code , where at the Dirichlet boundary, the pressure $p(t)=\sin(2 \pi f t)$ with $f=1$Hz is prescribed.

The plots of the solution of the FEM simulation and of the extracted time signals at the Dirichlet BC at x=0 for $p(t)$ (which is prescribed) and $q(t)$ which is obtained from the simulation look good at first sight. The solution of the wave propagation, i.e. pressure field $p(t)$ is as expected. However, the FEM solution of the auxiliary quantity $q$ is not. But when I am computing the difference quotient from $p(t)$, I get the correct (target) solution for $q(t)$.
Thus, I am wondering if I am using some of the NGSolve utilities wrong or if there is any other reason for that.

I also added results of alternative excitation functions for the Dirichlet BC to the attachments . (Somehow I was not able to upload any attechment. Therefore, all I am providing all these hyperlinks. Sorry for that.)
For the 2D case and also for an initial condition (instead of excitation by Dirichlet BC), I get the same behavior (Primary quantity $p(t)$ is right, but the auxiliary quantity $q(t)$ is wrong. However, computing the difference quotient from $p(t)$ yields the correct result.

Best,
Paul

Last edit: 1 year 4 months ago by pmaurerl. Reason: found error
Time to create page: 0.109 seconds