### matlab *.m files to solve PDEs using spectral methods.

If these programs strike you as slightly slow, they are. They would run more quickly if they were coded up in C or fortran. As matlab programs, would run more quickly if they were compiled using the matlab compiler and then run within matlab.

Here's a script from the March 20 class discussing power spectra of various functions class_mar20.m It uses the script find_spec.m .

Here's a script from the March 27 class comparing finite difference approximations of derivatives to spectral approximations of derivatives. class_mar27.m It uses the script d_mid.m, f.m, and fdiff.m and

All of the following codes are on [0,2 pi] and assume periodic boundary conditions.

Here's a script from the April 1 class comparing different spectral approaches to solving the heat equation. class_apr1.m It uses the scripts heat4.m, heat5.m, heat6.m, and heat7.m below.
This solves the heat equation by treating the linear term explicitly heat4.m
This solves the heat equation by treating the linear term implicitly heat5.m
This solves the heat equation by Crank-Nicolson heat6.m
This solves the heat equation exactly heat7.m

This solves Burger's equation by treating the nonlinearity explicitly and evolving the linear term exactly burgers2.m It needs subroutine convolve.m Here's a script testing it out: test_burgers2.m
This solves Burger's equation by treating both the linear term and the nonlinear term explicitly burgers2a.m It needs subroutine convolve.m Here's a script testing it out: test_burgers2a.m
This solves Burger's equation by treating the linear term implicitly and the nonlinear term explicitly burgers2b.m It needs subroutine convolve.m Here's a script testing it out: test_burgers2b.m
This solves Burger's equation via an integrating factor method. burgers3.m It needs subroutine convolve.m Here's a script testing it out: test_burgers3.m

This solves the cubic Schroedinger equation via a splitting method. split_schroedinger1.m Here's a script testing it out: test_schroedinger1.m
This solves the cubic Schroedinger equation via Strang splitting. split_schroedinger2.m Here's a script testing it out: test_schroedinger2.m
This solves the cubic Schroedinger equation via Richardson extrapolation on Strang splitting split_schroedinger1.m Here's a script testing it out: test_schroedinger3.m