Program to calculate drag force against a cyclist using MATLAB
Program to calculate drag force against a cyclist using MATLAB
The plot of drag force vs velocity
Density of air = 1.225kg/m^3
Front area = 0.5m^2
Drag coefficient = 0.85
In this, the velocity is increasing from 1m/s to 22m/s at an increment of 2m/s
% program for calculating the drag force on the bicycle
close all
clear all
clc
% Input
%drag_coefficient
c_d = 0.85;
%area m^2
a = 0.5;
%density kg/m^3
rho = 1.225;
% velocity m/s
v = [1:2:22];
% drag force N
F_d = 0.5 * c_d * a * rho * v.^2;
%plot drag force vs velocity
plot(v, F_d)
ylabel('drag force')
xlabel('velocity')
Curve obtained is parabolic in nature.
Note: In this case, the drag coefficient is kept constant.
If the drag coefficient is changing from 0.1 to 1.1 at the increment of 0.1.
And remaining all parameters remain unchanged.
Then,
% program for calculating the drag force on the bicycle
close all
clear all
clc
% Input
%drag_coefficient
c_d = [0.1:0.1:1.1]';
%area m^2
a = 0.5;
%density kg/m^3
rho = 1.225;
% velocity m/s
v = [1:2:11];
% drag force N
F_d = 0.5 * c_d * a * rho * v.^2;
%plot drag force vs velocity
plot(v, F_d)
ylabel('drag force')
xlabel('velocity')
As seen from the curve as the value of the drag coefficient increases, the drag force also increases.
- The plot of drag force vs drag coefficient
| Shape | Drag Coefficient |
| Flat plate | 1.28 |
| Prism | 1.14 |
| Bullet | 0.295 |
| Airfoil | 0.045 |
These values are taken from the internet.
These values are for the same front area.
In this velocity is increasing from 10m/s to 22m/s at rate of 5 m/s
a = 0.5m^2
density of air = 1.225kg/m^3
% program for calculating the drag force on the bicycle
close all
clear all
clc
% Input
%drag_coefficient for airfoil = 0.045
%drag coefficient for bullet = 0.295
%drag coefficient for prism = 1.14
%drag coefficient for flat plat = 1.28
c_d = [ 0.045 0.295 1.14 1.28 ];
%area m^2
a = 0.5;
%density kg/m^3
rho = 1.225;
% velocity m/s
v = [ 10:5:25 ];
% drag force N
F_d = 0.5 * rho * a * c_d .* v .* v
%plot drag force vs velocity
plot(v, F_d, 'red' )
ylabel('drag force')
xlabel('drag coefficient')