Calculating drag force over a bicycle.
- I am going to calculate drag force and plot it vs velocity and drag coefficient using MATLAB
Coding for drag force vs Velocity:
As `F prop v^2` where `F` is drag force and `v` is velocity, the plot will have a quadratic curve.
Code:
%Calculating the drag force over the bicycle and plotting drag force vs velocity
clear all
close all
clc
%Inputs
c_d = 0.9; %Drag_coefficient
A = 0.4; %Frontal area
rho = 1.8; %Density
v = [1:60]; %Velocity
%Calculating drag force
DF = rho*A*v.^2*c_d*0.5;
%Plotting
plot(v, DF)
xlabel('Velocity')
ylabel('Drag Force')
Plot:
Coding for drag force vs drag coefficient:
As `F prop c_d` where `F` is drag force and `c_d` is drag coefficient, the plot will have a straight line.
Code:
%Calculating the drag force over the bicycle and plotting drag force vs drag coefficient
clear all
close all
clc
%Inputs
c_d = [0:0.1:1]; %Drag coefficient
A = 10; %Frontal area
rho = 1.8; %Density
v = 10; %Velocity
%Calculating drag force
DF = c_d.*A*rho*v^2*0.5;
%Plotting
plot(c_d, DF)
xlabel('Drag coefficient')
ylabel('Drag Force')
Plot: