clear
global t w
w=[5, 10, 17, 22, 30, 50, 51, 90, 120, 180, 292, 395, 445, 775, 780,...
    700, 698, 880, 925, 800, 578, 400, 350, 202, 105, 65, 55, 40, 30, 20];
w=w/1000;
t=1:30;
plot(t,w,'.','MarkerSize',15)

% Model function
A=1;
B=.5;
C=17;
z=linspace(0,30,100);
plot(t,w,'.','MarkerSize',15)
hold on
plot(z,A*sech(B*(z-C)).^2);
hold off

% Apply Levenberg
%x1 = [A;B;C];   
%x = levenberg(@misfit,x1);