Calculation of Drag Force against a Cyclist using MATLAB
Objective: Write a Matlab program to calculate drag force against a cyclist.
Code:
- Code to plot Velocity vs Drag force.
%program to calculate the drag force over a bicycle
%program to plot velocity and drag force
clear all
close all
clc
%Inputs
%Area m^2
A = 8
%density kg/m^3
rho = 1.22
%Drag Coefficient
C_d = 2
% velocity m/s
V = [1:70]
%Drag force
drag_force = rho*A*V.^2*C_d*0.5
plot(V,drag_force);
xlabel('velocity');
ylabel('drag_force');
grid on
Output Graph:
- Graph Velocity Vs Drag force.
Code:
- Code to plot Drag Co-efficient vs Drag force.
%program to calculate the drag force over a bicycle.
%program to plot drag coefficient and drag force.
clear all
close all
clc
%Inputs
%Area m^2
A = 8
%density kg/m^3
rho = 1.22
%Drag Coefficient
C_d = [0.40:2.10]
% velocity m/s
V = 10
%Drag force
drag_force = rho*A*V^2*C_d*0.5
plot(C_d,drag_force);
xlabel('Drag_coef');
ylabel('drag_force');
grid on
Output Graph:
- Graph Drag coefficient Vs Drag force.
Reference:
- Drag coefficient of different shapes from the internet.