As of May 31, 2023, we have updated our Code of Conduct.
8 votes

Why is my simulation of a first-order wave equation not stable?

Numerical solution of the advection equation with centered differences in space and forward Euler in time is unconditionally unstable. So the behavior you are seeing is expected. Here is a nice ...
Bill Greene's user avatar
  • 5,854
8 votes

Finite difference for 1D wave equation: why the spike initial data results in a noisy output?

I think you're probably seeing artifacts that are due to numerical dispersion. In brief, in the discrete case different (spatial) frequencies of a wave function will propagate at different phase/group ...
rchilton1980's user avatar
  • 4,749
6 votes

Absorbing boundary conditions for acoustics in Discontinuous Galerkin

The problem with ABC in the form of derivative operators at the boundary is that the exact ABCs are non-local in space and often in time, which makes them hard to use in numerical simulations. You can ...
Daniel's user avatar
  • 1,238
6 votes
Accepted

Gauss-Lobatto quadrature and nodal points for FEM

Ok, here comes the answer promised in the comment section. Let's start the other way round, going from a general grid to Gaussian grids and further constructions such as spectral elements. In grid ...
davidhigh's user avatar
  • 2,982
5 votes
Accepted

Using backward vs central finite difference approximation

Higher order methods often have a smaller radius of convergence, i.e., they require smaller time steps. In your context, this means that they require a smaller CFL number, often significantly smaller ...
Wolfgang Bangerth's user avatar
5 votes

Time step relationship with number of elements or material properties

It sounds as if you're running a time-dependent linear elasticity simulation, right? Most likely, you're running an "Explicit" time-stepping scheme, which means that all of your information at time $...
Tyler Olsen's user avatar
  • 1,522
5 votes
Accepted

How can I solve wave equation for circular membrane in polar coordinates?

I think that you have two problems: your timestep is too big (the CFL condition is not satisfied); and you are not updating the values for $\phi=2\pi$. I am not sure about the CFL condition for ...
nicoguaro's user avatar
  • 8,207
5 votes

Eikonal Equation solver with different grid densities

This may not be your definitive solution, but what you need in any case is to change the discretization method that replace the continuous Eikonal equation with some discrete numerical scheme on the ...
Peter Frolkovič's user avatar
4 votes

Runge Kutta for wave equation

High order RK methods work fine for a large number of wave propagation (an elastic example using a DG discretization). The procedure is usually to discretize the spatial derivatives in the first ...
Jesse Chan's user avatar
  • 3,102
4 votes

Energy conservation in the solution of the Helmholtz equation

Mathematically, you have the Diriclet energy: $$ E = \int (-|\nabla\psi|^2+k^2|\psi|^2-f\psi^*-f^*\psi)d^Dx $$ whose minimisation gives you the Helmholtz equation. The natural energy current would be: ...
LPZ's user avatar
  • 141
4 votes
Accepted

How to physically understand time dependent boundary conditions?

For the heat equation imagine a rod that is heated on the left and cooled on the right. Now imagine that instead of a constant prescribed temperature on the left what we want is the heat to steadily ...
James's user avatar
  • 1,859
4 votes

Time step relationship with number of elements or material properties

The most commonly used explicit ODE solver in structural analysis is the central difference method. Because it is explicit, the solution becomes unstable if the time step is larger than a so-called ...
Bill Greene's user avatar
  • 5,854
4 votes
Accepted

Numerical solution of zero-potential time-dependent Schrödinger equation in 1D

Regarding the boundary conditions: Don't be fooled by Wikipedia. Yes, the scenario in the picture suggests an absorption at the boundaries, and yes, one could use absorbing boundary conditions in ...
davidhigh's user avatar
  • 2,982
4 votes

stability of a numercial scheme for a hyperbolic system?

It is worth making some additional points. What you set out is just one version of the Lax-Wendroff method. That scheme is unique in one space dimension but has several free parameters in two or three ...
Philip Roe's user avatar
4 votes

Numerical solution of 2D wave equation using Fourier transform and finite differences

Correction in the expression It appears that complex iota $i$ has not been included in the exponents in the expression for the inverse Fourier transform. The correct expression is: $$ u(x,y,t) = \iint ...
G R Krishna Chand Avatar's user avatar
4 votes

Interpolation of 1D solution from an original grid to a new grid

A "better technique" is rather subjective. You mean faster, more accurate, easier to program, something else?? Since it's only 1-D, the numerical cost is small (compared to 2D/3D) and there ...
Javier-Acuna's user avatar
3 votes
Accepted

CFL condition in polar coordinates

I was going to write a comment, but the equation seems to view better in answers.. I assume Von Neumann analysis is the proper approach to derive this equation, but a coordinate transformation from ...
Charles's user avatar
  • 609
3 votes

Absorbing boundary conditions for acoustics in Discontinuous Galerkin

There exist Absorbing Boundary Conditions for the wave equation that are stable and that go up to any order of accuracy (limited only by the accuracy of discretization of your model), so that they are ...
DanielRch's user avatar
  • 472
3 votes

Velocity-Stress formulation of Elastodynamics/Wave Equation for beginner

The stress-velocity formulation has been used extensively in DG context on account of the fact that it can lead to a first order system form of the elastic equation. The latter proved to lend itself ...
DanielRch's user avatar
  • 472
3 votes

Wave Equation PDE

The problem is that odeint solves first-order ODEs of the form $$\dot u(t) = Au(t),$$ but the wave equation is (after discretization in space) a second-order ODE of ...
Christian Clason's user avatar
3 votes
Accepted

Introducing EigenModes from 2D FEM into 3D FEM

You're looking for waveguide port boundary conditions. I think the most accessible treatment is within Jin & Riley's Finite Element Analysis of Antennas and Arrays, Chapter 5. It's available on ...
rchilton1980's user avatar
  • 4,749
3 votes

What is the right way to set up two random tensor fields which have an identical average diffusivity

There is no reason to believe that two random fields with the same arithmetic mean would yield solutions that have anything to do with each other. In fact, for the case you consider, one might imagine ...
Wolfgang Bangerth's user avatar
3 votes

Modified Equation and Stability for Centred Finite Differences for Wave Equation

I'm rewriting my answer. In fact, you don't need Taylor expansion to find out why $\frac{c \Delta t}{\Delta x} < 1$. I define second order numerical time and spatial differential operators as ...
Mithridates the Great's user avatar
3 votes

Solve wave equation with discontinuous coefficients numerically?

$c$ depending on time is not the issue. You will use an RK scheme which takes care of this. The issue is $c$ is discontinuous in $x$. I recommend SBP-SAT schemes for this. (1) Derive an energy ...
cfdlab's user avatar
  • 2,993
2 votes

Analytical Solution to the acoustic / scalar (Inhomogeneous) wave equation with source term

I understand that you want to solve the differential equation $$\nabla^2 u - \frac{1}{c^2}\frac{\partial^2 u}{\partial t^2} = f(t)\delta(\mathbf{r}) \enspace ,$$ for an unbounded domain, $\mathbf{r}$...
nicoguaro's user avatar
  • 8,207
2 votes

Analytical Solution to the acoustic / scalar (Inhomogeneous) wave equation with source term

You can make up as many solutions to this equation as you want using the Method of Manufactured Solutions (PDF). Is there a reason you're focused on this particular case only, or could you use any ...
Bill Barth's user avatar
  • 10.9k
2 votes

Wave Equation PDE

Since the wave equation involves a second derivative in time, two initial conditions are necessary: initial displacement $U(x,0)$ and initial velocity $U_t(x,0)$. I don't see the initial velocity ...
Paul's user avatar
  • 11.9k
2 votes
Accepted

How to use non-dimensional form in open source codes instead of Units

The answer is very simple: you provide the code with geometric information, i.e. nodal coordinates (which in your case are expressed in metre), and not only topological information, i.e. how the mesh ...
Stefano M's user avatar
  • 3,809
2 votes

Dirichlet BCs - alternative implementation methods

My hunch is that you may be prescribing boundary data at both ends of the domain (which leads to oscillations) or incorrectly specifying the boundary data. For a hyperbolic problem, you need to ...
namu's user avatar
  • 187
2 votes
Accepted

What would be a simple approach to validate a wave propagation code?

I agree with the suggestion of starting with a simple problem and with the elastic solution. Probably the simplest wave problem is the 1D, infinite bar/string. The analytical solution to this problem ...
Bill Greene's user avatar
  • 5,854

Only top scored, non community-wiki answers of a minimum length are eligible