This small repository implements pseudospectral solvers for a few one-dimensional partial differential equations (PDEs) in periodic domains. In each case, the solver uses in-place Fourier transforms (FFTW) and time-steppers from OrdinaryDiffEq.jl for fast, high-accuracy, and stable solutions. The density of the grid can be any power of two.
Look at the short testing script for an example of how to integrate a model.
The three equations implemented are briefly described below, in order of increasing complexity. A different equation could be implemented pretty easily by following the same pattern in the module.
where
This is a simplified shallow water wave model with a third-order derivative and rippling, ghostly solutions.
A fourth-order PDE famous for its chaotic behavior. The model produces different behavior for different domain length, which causes the terms above to have different scaling.
More info about pseudospectral techniques generally can be found in the books:
- Chebyshev and Fourier Spectral Methods (Boyd)
- Spectral methods: fundamentals in single domains (Canuto)
- A Practical Guide to Pseudospectral Methods (Fornberg)
This repo uses the Julia Language and DrWatson to make a reproducible scientific project named
Simple Spectral PDEs
It is authored by Mark Baum markmbaum@protonmail.com.
To (locally) reproduce this project, do the following:
- Download this code base. Notice that raw data are typically not included in the git-history and may need to be downloaded independently.
- Open a Julia console and do:
julia> using Pkg julia> Pkg.add("DrWatson") # install globally, for using `quickactivate` julia> Pkg.activate("path/to/this/project") julia> Pkg.instantiate()
This will install all necessary packages for you to be able to run the scripts and everything should work out of the box, including correctly finding local paths.