I am trying to solve the Viscous Burgers equation using the spectral method. $$u_t+uu_x = Du_{xx}$$ where $D$ is a constant (chosen to be zero) and with the initial condition $$u(x,0) = exp(-x/0.2)^2$$
I will use the spectral method for the spatial derivatives. $f$ denotes Fourier transform.
$$f(u_t+uu_x) = Df(u_{xx})$$ $$f(u_t)+f(uu_x) = Df(u_{xx})$$ $$f(u_t) = Df(u_{xx})-f(uu_x)$$ $$u_t = Df^{-1}(f(u_{xx}))-f^{-1}(f(uu_x))$$
I am using Matlab to numerically compute the solution over the interval $[-1,1]$. The problem is that I don't know how to treat the following term $$f(uu_x)$$
Breaking it up to $f(u)f(u_x)$ makes the solution wrong.
My question is: How should I treat that term?
I have look at convolution but don't really understand it fully in order to implement it. Any help is appreciated.
For those who are interested in how the iteration algorithm looks where I use the leapfrog method for the time derivative: $$u_{j}^{k+1} = u_{j}^{k-1} +2* \Delta t [f^{-1}(-1N^2 \pi^2 f(U_{j}^{k})) - f^{-1}(iN \pi f((U_{j}^{k})^2))]$$
Change $u u_x$ to $(u^2/2)_x$. The Fourier transform of this term is $i k F(u^2/2)$. That is you apply fft directly to $u^2/2$, this is how you handle nonlinear terms in spectral method - there is really no trick. Below is what I wrote in matlab (use the simplest Euler forward step, so mind the time step size), it solves $x$ in $[0, 2\pi]$ with initial condition $\sin(x)$, but should be easy to adapt to your case.
Press F5 and enjoy. An example output at $t=5$ is: