Matlab program to calculate drag force against a cyclist
Aim:
- To Write and execute a Matlab program to calculate drag force against a cyclist
Drag-force
A drag force is the resistance force caused by the motion of a body through a fluid, such as water or air. A drag force acts opposite to the direction of the oncoming flow velocity. This is the relative velocity between the body and the fluid.
The drag force D exerted on a body traveling through a fluid is given by
`D=(1/2)CrhoAupsilon^2`
Objective:
- To write a program to plot Velocity vs Drag force
- To write a program to plot Drag Co-efficient vs Drag force
Velocity vs Drag force
- Clear all, close all, clc is used to clear the previous process. % function refers to display the content to the viewers
- The following values are determined and inserted accordingly to find and evaluate the Drag force
- The Plot, Label, Grid options are used instantly to show the output
clear all
close all
clc
%Inputs
%Drag coefficient
c_d = 0.8;
%Density kg/m^3
rho = 1.2;
%Area m^2
A = 0.1;
%Velocity m/s
v = [1:25];
%Calculating drag force upon the bicycle
drag_force = rho*A*v.^2*c_d*0.5
plot(v, drag_force)
xlabel('velocity')
ylabel('drag_force')
grid on

Drag Coefficient vs Drag force
- Clear all, close all, clc is used to clear the previous process. % function refers to display the content to the viewers
- The Drag coefficient values are determined and inserted accordingly to evaluate the Drag force
- The Plot, Label, Grid options are used instantly to show the output
clear all
close all
clc
%Inputs
%Drag coefficient
%Sports car - 0.2
%Bus - 0.6
%Truck - 1.0
%Motorcycle - 1.8
c_d = [0.2, 0.6, 1.0, 1.8];
%Density kg/m^3
rho = 1.2;
%Area m^2
A = 0.1;
%Velocity m/s
v = [25];
%Calculating drag force upon the bicycle
drag_force = rho*A*v^2*c_d.*0.5
plot(c_d, drag_force)
xlabel('Drag coefficient')
ylabel('Drag force')
grid on

Conclusion:
- The program Velocity vs Drag force and Drag Co-efficient vs Drag force is determined and executed successfully
- In the first case, the graph plots kept increases drastically by determining the velocity opposing force against the subject
- Whereas in the second case, the Drag co-efficient vs Drag force the graph plots linearly because the velocity kept changes according to the subjects eg., Sports Car, Bus, Truck, Motorcycle, etc.