# Tag Info

### 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 ...
• 4,946

### 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 ...
• 6,229
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 ...
• 55.9k
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 ...
• 3,187
Accepted

### Can this finite difference dispersion be eliminated somehow?

It isn't the spike that's causing the dispersion. The scheme you use has a dispersion relationship whereby waves of different frequency travel at different speeds. Every numerical scheme has such a ...
• 55.9k
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 ...
• 3,187

### 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 ...
• 1,154

### 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 ...

### 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 ...
• 206

### 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 ...
• 3,028

### 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 ...

### 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 ...
• 55.9k

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

As David said, absorbing boundary conditions won't be completely reflectionless. That said, we can reduce relfections quite a bit, which helps to avoid influence from the boundaries while the particle ...
• 131
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 ...
• 4,946
Accepted

### (Regular) Coulomb wave function

I ended up using the integral representation of the regular Coulomb wave function given by \begin{align} F_\ell(\eta,\rho) = \frac{\rho^{\ell+1}2^\ell e^{i\rho-(\pi\eta/2)}}{|\Gamma(\ell+1+i\eta)|} \...
• 400
Accepted

### Can the Runge-Kuta algorithm help in reducing numerical dispersion and anisotropy when using the FDM to solve the 2D wave equation?

Question 1 The temporal accuracy can probably be improved by using a fourth order Runge-Kuta algorithm instead of a standard three-point central difference approximation for the second order time ...
• 2,197
Accepted

### Why does the FDM give a correct solution to a PDE with a discontinuous initial condition?

Looking at the plots of the errors, it seems that there is not much difference between the oscillations that you have in this case with respect to those that you had in your previous post (Can this ...
• 444

### Perfectly matched layer simulation with two vibrating sources

I believe it is OK to use the PML the first way you described. It's not necessary to put the source at the center, otherwise PML is not better than many other absorbing boundary conditions. The PML ...
• 302

### Measure the convergence rate of a discretization of a wave equation

You are asking very complicated questions for which there are likely no answers that can be rigorously proven. If you go back for a second and ask the same question for the solution of the Laplace ...
• 55.9k
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 ...
• 6,229
Accepted

### Trying to plot 1D wave equation for benchmarking

There are two problems with your code: 1) You are mixing $i$ and $n$ in the following line: SUM = SUM+Ai*cos((i-0.5)*pi*xi/L)*sin((n-0.5)*pi*ti/(L/c)) It should ...
• 136
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 ...
• 3,839
Accepted

### Solve wave equation with discontinuous coefficients numerically?

Here is a brute force solution that would work no matter what is the discontinuity and nonlinearity in $c(x,t)$. Write your PDE as a system of two: $\dot{y}=z\\ \dot{z}=c^2(x,t) y_{xx}$ Now, ...
• 2,595