%
%  w10schr.m -- djm -- 06 mar 06
%    -  surface drop wave
%
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

g = 1;  h = 10;

dt = 0.1;  T = 20;
Nx = 2*512;  Lx = 40;  dx = 2*Lx/Nx;
x = -Lx:dx:Lx-dx;

dk = 2*pi/Lx;
k = fftshift([-Nx/2:Nx/2-1])*dk;
ki = k;  ki(1) = 1;  ki = 1./ki;

q = -exp(-1*(x.^2));  qh = fft(q);

figure(1);  clf;
    for t = 0:dt:T
    uh = qh.*exp(-i*t*sqrt(g*tanh(k*h).*k));  uh = uh + conj(uh);
    u  = ifft(uh)/2;
    plot(x,real(u),'r');  hold off

    axis([-Lx Lx -1 1])
    text(-0.7*Lx,0.8,['\bf time = ' num2str(t)],'fontsize',16)
    xlabel('\bf x-axis')
    ylabel('\bf u(x,t)')
    drawnow;  pause(0.1)
end