Flow over Bicycle Using MATLAB
Aim:
To write a Matlab program to calculate drag force against a cyclist.
Code for drag force with velocity
clear all
close all
clc
rho = 1.2;
a = 0.1;
cd = 0.8;
v = 1:50;
f = rho * a * v.^2 * cd/2;
plot(v,f,'LineWidth',2)
xlabel('VELOCITY')
ylabel('DRAG FORCE')
I create a matrix for velocity using the range operator and using the formula the drag force calculated
Output Graph
The drag force varies with the square of the velocity so the plot is like a parabolic curve
clear all
close all
clc
rho = 1.2;
a = 0.1;
cd =[0.81,0.42,0.47,1.07,0.09,0.04];
v = 10;
f = rho * a * v^2 *cd./2;
plot(cd,f,'LineWidth',2)
xlabel('DRAG COEFFICIENT')
ylabel('DRAG FORCE')
Various drag coefficient values are taken from the internet and created a matrix
Output Graph
The drag force varies with the drag coefficient linearly So the plot is a straight line
Thank You