Drag Force vs Velocity and Drag force as a function of Drag coefficient
This MATLAB code calculates the drag force against a cyclist. Two plots have been shown in the figure(All values have been taken in SI units)
The effect of velocity on the drag force (with all other parameters kept constant) has been shown in the upper part by plotting the drag force against the velocity.
The effect of different shapes on the drag force (with all other parameters kept constant) is shown in the lower part by plotting the drag force against the drag coeffiecent for different shapes.
%Program to calculate drag force against a cyclist.
% Plot of 1) Drag force vs Velocity 2) Drag force vs Drag coefficient
clear all
close all
clc
%INPUTS:-
%Considering Equal Area(m^2)for all shapes
A=0.7;
%Density of air(kg/m^3)
rho=1.2;
%---------------------------------
%DRAG FORCE VS VELOCITY
%Considering Variable Velocity(m/s)for first plot
v = 1:10;
%Sample drag coefficient value
dc=0.4;
%Drag force calculation with varying velocity
df=0.5*dc*rho*A*v.^2;
%Plot of drag force vs velocity
subplot(3,1,1)
plot(v,df)
xlabel('Velocity')
ylabel('Drag force')
title('DRAG FORCE VS VELOCITY')
grid on
%--------------------------------------------------------------
%DRAG FORCE VS DRAG COEFFICIENT
%Available Drag Coefficients for different shapes
cd1=0.47;%for sphere
cd2=0.42;%for half sphere
cd3=0.82;%for long cylinder
cd4=1.15;%for short cylinder
cd5=0.04;%for streamlined body
cd6=0.09;%for streamlined half-body
%Considering equal velocity(m/s) in all cases
V=1;
%Drag coeffients
CD=[cd1 cd2 cd3 cd4 cd5 cd6];
%Drag force calculation for different drag coefficients
DRF=0.5*rho*A*V.*CD;
%Plot of Drag force vs Drag coefficients
subplot(3,1,2)
plot(CD,DRF)
xlabel('Drag coefficient')
ylabel('Drag force')
title('DRAG FORCE VS DRAG COEFFIECIENT')
grid on
subplot(3,1,3)
plot(CD,DRF,'rd')
xlabel('Drag coefficient')
ylabel('Drag force')
grid on