Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Linear advection equation using FFT and RK4

Solve using FFT

ut+cux=0,x∈(0,2π),c=1u_t + c u_x = 0, \qquad x \in (0,2\pi), \qquad c = 1

with initial condition

u(x,0)=sin⁡(20x)exp⁡(−5(x−π)2)u(x,0) = \sin(20 x) \exp(-5(x-\pi)^2)

periodic boundary conditions and RK4 in time.

Extend f:[a,b]→Rf :[a,b] \to R periodically to whole of RR.

Solve the problem.

Make animation

Loading...

Compare this to a 6th order finite difference scheme from here:

python rk4cs.py -N 128 -cfl 0.25 -ic wpack -order 6