Skip to content
Permalink
3737262dd3
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
15 lines (14 sloc) 487 Bytes
function [v_analytical,v_terminal,t]=freefall(h,timespan)
% help file for freefall.m
% N is number of timesteps between 0 and 12 sec
% v_an...
t=[0:h:timespan]';
c=0.25; m=60; g=9.81; v_terminal=sqrt(m*g/c);
v_analytical = v_terminal*tanh(g*t/v_terminal);
v_numerical=zeros(length(t),1);
delta_time =diff(t);
for i=1:length(t)-1
v_numerical(i+1)=v_numerical(i)+(g-c/m*v_numerical(i)^2)*delta_time(i);
end
plot(t,v_numerical,'o-')
end