Project

Writing a MATLAB program to Calculate Drag Force against a cyclist and also for the various other shapes

The drag coefficient associated with different shapes are as follows and the same has been considered for the code as well:

Code:

% Program to calculate the drag force aginast a cyclist

% Objective: To calculate drag force seperately for various air velocity &
% for drag coefficient associated with different shapes
% The results will be displayed by plotting two graphs

% Equation to calculate Drag Force (Fd)
% Fd = 0.5*rho*A* v^2 * Cd
% In the formula, Fd = Drag Force (N), rho = Density of Air (kg/m^3), A =
% Frontal Area (m^2), v = velocity (m/s), Cd = Drag Coefficient (Unitless)

close all; clear all; clc;

% Inputs
% Drag Coefficient (Unitless)
Cd_1 = 0.8;

% Reference Values of drag coefficent for different shapes
% Sphere = 0.47, Half-sphere = 0.42, Cone = 0.5, Cube = 1.05, Angled_Cube =
% 0.8, Long_Cylinder = 0.82, Short_Cylinder = 1.15, Streamlined_Body =
% 0.04, Streamlined_Half-body = 0.09
Cd_2 = [0.47 0.42 0.5 1.05 0.8 0.82 1.15 0.04 0.09];

% Frontal Area (m^2)
A = 0.1;

% Velocisty (m/s)
v_1 = 1:50; % Velocity range

% Fixed Velocity (m/s)
v_2 = 1;

% Density (kg/m^3)
rho = 1.2;

% Calculating Drag Force(N) for various velocity values
Fd_1 = 0.5* rho*A* v_1.^2 * Cd_1;

% Calculating Drag Force(N) for various shapes
Fd_2 = 0.5* rho*A* v_2.^2 * Cd_2;

% plotting 
figure(1)

% graph to compare the effec of air velocity on drag force
subplot(2, 1, 1)
plot(v_1, Fd_1)
xlabel('Velocity (m/s)') 
ylabel('Drag Force (N)')
title('Drag Force vs Velocity')
grid on

% Graph to compare the drag coefficient and drag force
subplot(2, 1, 2)
plot(Cd_2, Fd_2)
xlabel('Drag Coefficient')
ylabel('Drag Force (N)')
grid on
title('Drag Force vs Drag Coefficient')

Results:

The graph shows the drag force increases rapidly as the velocity increases, because in the equation contain the square of velocity. The nature of drag force is parabolic in output graph. In the second graph for various shapes with constant frontal area, the drag force is increasing linearly. Thats why the velocity has very high on impact of drag force comapre to the shape of the vehicle.

Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.