How to solve a 4th order PDE using Fourier spectral method?

834 Views Asked by At

I would like to solve PDE in a numerical way (Fourier spectral method, actually). And I think I should find some particular solution of the equation to apply the method, but I don't know how.

The equation is:

$$\frac {\partial y}{\partial t} - \frac{\partial ^2 y}{\partial x^2} + \frac{\partial ^4 y}{\partial x^4} = 0.$$

I thought $y = e^{-12t} \sin{2x}$ might be a particular solution. So I used following modified MATLAB code:

(Originally, it was made to solve KdV equation, and it put particular solution of KdV equation to u. I just put the particular solution above to u.

%         FFT with integrating factor v = exp(-ik^3t)*u-hat.

% Set up grid and two-soliton initial data:
  N = 256; dt = .4/N^2; x = (2*pi/N)*(-N/2:N/2-1)';
  A = 2; B = -12; clf, drawnow, set(gcf,'renderer','zbuffer')
  u = sin(A*x)*exp(12*t);
  v = fft(u); k = [0:N/2-1 0 -N/2+1:-1]'; ik3 = 1i*k.^3;

% Solve PDE and plot results:
  tmax = 0.006; nplt = floor((tmax/25)/dt); nmax = round(tmax/dt);
  udata = u; tdata = 0; h = waitbar(0,'please wait...');
  for n = 1:nmax
    t = n*dt; g = -.5i*dt*k;
    E = exp(dt*ik3/2); E2 = E.^2;
    a = g.*fft(real( ifft(     v    ) ).^2);
    b = g.*fft(real( ifft(E.*(v+a/2)) ).^2);     % 4th-order
    c = g.*fft(real( ifft(E.*v + b/2) ).^2);     % Runge-Kutta
    d = g.*fft(real( ifft(E2.*v+E.*c) ).^2);
    v = E2.*v + (E2.*a + 2*E.*(b+c) + d)/6;
    if mod(n,nplt) == 0 
      u = real(ifft(v)); waitbar(n/nmax)
      udata = [udata u]; tdata = [tdata t];
    end
  end
  waterfall(x,tdata,udata'), colormap(1e-6*[1 1 1]); view(-20,25)
  xlabel x, ylabel t, axis([-pi pi 0 tmax 0 2000]), grid off
  set(gca,'ztick',[0 2000]), close(h), pbaspect([1 1 .13])

But it doesn't seem that it works pretty well.