Skip to main content
10 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,946
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
  • 6,229
6 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
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
  • 3,187
6 votes
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 ...
Wolfgang Bangerth's user avatar
5 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
  • 3,187
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,512
4 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
  • 619
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

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
  • 6,229
4 votes

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

The credits of this should go to @rchilton1980. I only want to validate the hypothesis of dispersion as the result of the response of a spike to the finite difference operator. $\bf{ Basic \; ...
Herman Jaramillo's user avatar
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
  • 1,154
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

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

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

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 ...
Yuriy S's user avatar
  • 131
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,946
3 votes
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)|} \...
mmikkelsen's user avatar
3 votes
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 ...
lightxbulb's user avatar
  • 2,197
3 votes
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 ...
Rigel's user avatar
  • 444
2 votes

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 ...
Pu Zhang's user avatar
  • 302
2 votes

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 ...
Wolfgang Bangerth's user avatar
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
  • 6,229
2 votes
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 ...
Pablo's user avatar
  • 136
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,839
2 votes
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, ...
Maxim Umansky's user avatar
2 votes

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

You can only expect to get a sensible answer if your data can be resolved by the grid. Shannons Sampling Theorem is central to all digital signal processing and states that no signal with wavelength ...
Philip Roe's user avatar
  • 1,154
2 votes

Incorporating a potential barrier in a wave-packet simulation (Fourier Transform method)

The neat thing about Fourier codes is that you can achieve very high order derivatives and if you are describing physics which is about waves, then the trigonometric base functions are a good choice. ...
MPIchael's user avatar
  • 3,005

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