MATLAB Boundary conditions in the resolution of a PDE with the FFT method

AI Thread Summary
When solving partial differential equations (PDEs) using Fast Fourier Transforms (FFT), it's crucial to understand the implications of boundary conditions. The default behavior of FFT is to assume periodic boundary conditions, which can lead to inaccuracies if the domain is non-periodic. For non-periodic domains, utilizing discrete sine or cosine transforms can be effective depending on the specific boundary conditions. However, for a more general approach that accommodates various boundary conditions, employing a discrete Chebyshev transform is recommended, as it allows for the use of FFT-based algorithms while providing greater flexibility in handling different types of boundaries.
accdd
Messages
95
Reaction score
20
How to impose boundary conditions when solving a PDE with fft? For example here:
If I copy this code I get periodic boundary conditions. Thank you
 
Physics news on Phys.org
Well, yes. Discrete Fourier transforms are for periodic domains. If you have a non-periodic domain then depending on the boundary conditions you might be able to use a discrete sine or cosine transform, but in the general case you should use a discrete Chebyshev transform if you want access to an FFT based algorithm.
 
Back
Top