Skip to content

aadi-bh/spectral4hyp

Repository files navigation

Spectral Methods for Hyperbolic Problems

This code implements spectral filtering and Gibbs complimentary basis re-expansion, as outlined in the paper Spectral Methods for Hyperbolic Problems by Gottlieb and Hesthaven.

It is part of an end-semester project, which you can read more about here.

Install

Download or clone this repository and then activate your environment before running

pip install -r requirements.txt

to install the required packages, in case they are not already present.

Run

python main.py -h

will show the list of options.

Flag Explanation
-N Number of grid points and Fourier modes (can be used multiple times)
--pde Whether to solve the linear advection or Burgers' equation
--ggb Plot the re-expansion of Fourier coefficients in the basis of Gegenbauer polynomials
--Lambda When --ggb is enabled, the value of Lambda to use (sometimes referred to as alpha) for the Gegenbauer polynomials. Must be used as many times as -N.
--exact Path to the file containing the exact solution for the specified combination of PDE, initial condition, at final time.

Known issues

The Burgers' equation computes the right solution, but at a wrong speed.