
dx = 0.005;
x = [0:dx:50];

a0 = 0.6;
x0=15;

P = (x-x0).* sqrt((3/4)*a0/(1+a0));
eta = a0 * (sech(P)).^2;

detadx = diff(eta)/dx;
xbar = 0.5*(x(1:end-1)+x(2:end));

figure(1),
subplot(2,1,1)
hold on
plot(x,eta,'r')

subplot(2,1,2)
hold on
plot(xbar,detadx,'r')


