Calculation Drag Force against a cyclist using Matlab
Objective : Calculation of drag force against a cyclist
Parameters :
1. Frontal Area :The total area of bicycle and the one who's riding it. It is to be noted that the frontal area changes every second and in turn the drag force changes.
2. Density (ρ) : Density of the concerned fluid
3.Velocity(V) : Speed of the vehicle
4. Drag coefficient(Cd) : which varies for different geometrical shapes.
Link :
1.https://drive.google.com/file/d/1c93BYKVlIucAMsps7arMTcd01bFdH97S/view?usp=sharing 2.https://drive.google.com/open?id=13XJLFYNAEjNj44FajETidc2uBXUPt6k7 3.https://drive.google.com/open?id=1dAd6kQitvGdohsewWz21VbvF6Y9uYvtq
Matlab/Octave Code :
# Program to calculate drag force on a bicycle
# Plot Velocity vs Drag Force
clear all
close all
clc
%inputs
%drag coefficient
c_d=0.8
%Area m^2
A=0.4
%Density kg/m^3
rho=1.2
%velocity m/s
# Considering 50 values of velocity
v=[1:50]
## The drag force is calculated as drag_force=rho*A*v.^2*c_d*0.5;
drag_force=rho*A*v.^2*c_d*0.5;
plot(v, drag_force)
xlabel('Velocity')
ylabel('Drag Force')
grid on
## Plot Drag Cofficient vs Drag Force
%inputs
%drag coefficient
# Data Source :https://www.grc.nasa.gov/www/k-12/airplane/shaped.html
c_d=[0.045 0.07 0.295 1.14 1.25]
%Area m^2
A=1
%Density kg/m^3
rho=1.2
%velocity m/s
v=25
drag_force=rho*A*v.^2*c_d*0.5;
plot(c_d, drag_force)
xlabel('Drag Coefficient')
ylabel('Drag Force')
grid on