drag force against a cyclist
%project_1
% function to plot drag force vs velocity
clear all
close all
clc
%inputs
%density kg/m^3
rho=2;
%frontal area m^2
a=0.25;
%velocity m/s
v=[1:25];
%drag_coefficient
c_d=0.5;
%drag force
drag_force=0.5*rho*a*v.^2*c_d;
%graph plot
plot(v,drag_force,\'color\',\'r\')
xlabel(\'velocity\')
ylabel(\'drag_force\')
grid on
%project_2
% plotting drag force as a function of drag coefficient
clear all
close all
clc
%inputs
%density kg/m^3
rho=2;
%frontal area m^2
a=0.25;
%velocity m/s
v=5;
%drag_coefficient
c_d=[0.04 0.09 0.42 0.47 0.5 0.8 0.82 1.05 1.15];
%drag force
drag_force=0.5*rho*a*v.^2*c_d;
%graph plot
plot(c_d,drag_force,\'color\',\'r\')
xlabel(\'drag_coefficient\')
ylabel(\'drag_force\')
grid on