Ceyron / machine-learning-and-simulation

All the handwritten notes 📝 and source code files 🖥️ used in my YouTube Videos on Machine Learning & Simulation (https://www.youtube.com/channel/UCh0P7KwJhuQ4vrzc3IRuw4Q)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Spatial Discretization is incorrect for FFT application

Ceyron opened this issue · comments

In these three small simulation scripts:

the Fast Fourier Transformation (FFT) was used slightly incorrectly. When setting up the spatial mesh, points on both ends of the boundary are included. That introduces noise and aliasing because the domain is no longer its original size, but slightly larger. See also PR #6.

The fix proposed in PR #6 should also work here, but it would require some additional changes to the code in order to make subsequent operations work as well. Most importantly, the interpolation part of the semi-lagrangian advection scheme would require slight rethinking.