clear, clf, hold off
t=0;
n=0;
v=0;
C=0.27;
rho_air=1.22;

%assuming constant air density
A_diver=0.413;

%using CdA=1.2ft^2 from table 7-3 in fluids book with Cd=.27
M=70;
g=9.81;
h=0.1;
t_rec(1)=t;
v_rec(1)=v;
while t<=20
n=n+1
v=v+h*((-C*.5*rho_air*A_diver*v*v)/M + g);
t=t+h
v_rec(n+1)=v;
t_rec(n+1)=t;
end
plot (t_rec,v_rec)
xlabel('time (s)')
ylabel('velocity (m/s)')