%
%  w07pond.m -- water wave (djm - 25 feb 04)
%

sig = 0.5;  G = 1;  

L = 50;  dL = L/500;  x = 0:dL:L;  kmax = 10;

eta00 = zeros(size(x));
eta03 = zeros(size(x));
eta05 = zeros(size(x));
eta25 = zeros(size(x));
eta40 = zeros(size(x));

for j=1:size(x,2)
  eta00(j) = 2*quadl(@w07pondX,0,kmax,1e-4,[],x(j), 0,sig,G);
  eta03(j) = 2*quadl(@w07pondX,0,kmax,1e-4,[],x(j), 3,sig,G);
  eta05(j) = 2*quadl(@w07pondX,0,kmax,1e-4,[],x(j), 5,sig,G);
  eta25(j) = 2*quadl(@w07pondX,0,kmax,1e-4,[],x(j),25,sig,G);
  eta40(j) = 2*quadl(@w07pondX,0,kmax,1e-4,[],x(j),40,sig,G);
end

x1 = [-fliplr(x(2:end)) , x];  

eta00 = [fliplr(eta00(2:end)) , eta00];
eta03 = [fliplr(eta03(2:end)) , eta03];
eta05 = [fliplr(eta05(2:end)) , eta05];
eta25 = [fliplr(eta25(2:end)) , eta25];
eta40 = [fliplr(eta40(2:end)) , eta40];

figure(101);  clf
hold on
plot(x1,-real(eta00),'b')
plot(x1,-real(eta03)+0.5,'k')
plot(x1,-real(eta05)+1.2,'k')
plot(x1,-real(eta25)+2.0,'k')
plot(x1,-real(eta40)+2.5,'r')
axis([-50 50 -1.0 3.0])

title('\bf water waves from a localized initial disturbance (2D theory)')
xlabel('\bf x-axis');
h = ylabel('\bf y-axis (shifted)');
set(gca,'YTick',[-1 0])

text(-40,-0.1,'\bf t=0')
text(-40, 0.4,'\bf t=3')
text(-40, 1.1,'\bf t=5')
text(-40, 1.9,'\bf t=25')
text(-40, 2.4,'\bf t=40')
