- #1

- 184

- 5

This lecturer uses ##FFT## on ##V##, then solves the ODE using an ODE solver in Matlab, then inverse ##FFT## to get the real solution :

$$FFT(v_t)=\hat{v_t}=FFT(\mu v_x)\\

=>\frac{\partial{\hat{v}}}{\partial{t}}=iK\mu \hat{v}$$

##K## is a vector of wave numbers, ##FFT## is fast fourier transform of a function, ##ifft## is the inverse fast fourier transform, and ##i## is the imaginary number.

the lecturer solves for ##\hat{v}## with an ODE solver, then inverse fourier transform to get solution ##v##.

BUT, in the book Spectral Methods for Matlab, the author first transforms the function with ##FFT##, then he calculates the derivative in Fourier space, then the author claims he must transform this back into ##x## space to get the derivative. So, $$\mu \hat{v}_x=\mu iK\hat{v}\\ v_x=-\frac{ifft(\mu iK\hat{v})}{\sqrt{1-x^2}}$$

the ##\sqrt{1-x^2}## comes from chain rule derivative, where the author states when he takes the ##FFT## of the function, it puts the function into ##\theta## space, so to get the x derivative the author has to use chain rule for some reason.

I can't figure out why the methods are different. The only idea I have is maybe the first lecturer's function V is approximately zero at the boundaries, while the Spectral Methods for Matlab author's function is not zero at the boundaries. Could this be the only difference?