Drag Force as a function of Velocity At different Coefficient of drag
%Drag force calculation as a function of velocity at different C_d
clear all
close all
clc
%inputs
%drag coefficient
c_d = [0.04 0.09 0.3 0.40 0.45 0.8 1.05]
%area m^2
a=0.2;
%density kg/m^3
rho=1.1;
%velocity m/s^2
v=[1:95];
for i=1:length (c_d)
C_D=c_d(i)
%drag force
F_d=0.5*rho*a*v.^2*C_D
hold on
plot (v,F_d)
axis([0 v(end)+25 0 1200])
x1 = v(end)+0.5;
y1 = 0.5*rho*a*v(end)^2*C_D ;
txt1=strcat('\leftarrow c_d =',num2str(C_D));
text(x1,y1,txt1)
xlabel('velocity')
ylabel('drag force')
grid on
pause(0.2)
end