Program to calculate drag force against a cyclist
Program to calculate drag force against a cyclist.
Graph for Velocity vs Drag Force
Any object moving through a fluid experiences drag - the net force in the direction of flow due to pressure and shear stress forces on the surface of the object.
The drag force can be expressed as:
Fd = cd 1/2 ρ v2 A (1)
where
Fd = drag force (N)
cd = drag coefficient
ρ = density of air(1.2 kg/m3 for air )
v = flow velocity (m/s)
A = characteristic frontal area of the body (m2)
The drag coefficient is a function of several parameters like shape of the body,Reynolds Number, Roughness of the surface etc.
The characteristic frontal area - A - depends on the body.
we can assume Drag coefficient for bicycle is 0.8 or 0.9
>> % inputs
>> % Drag Coefficient
>> c_d = 0.8
c_d =
0.8000
>>
>> % Area m^2
>> A = 0.1
A =
0.1000
>> % Density
>> % Density kg/m^3
>> rho = 1.2
rho =
1.2000
>> % Velocity
>> v = 1
v =
1
>> % Velocity
>> v = [1:50];
>> drag_force = rho*A*v.^2*c_d*0.5;
>> plot(v, drag_force);
>> xlabel(\'velocity\')
>> ylabel(\'Drag Force\')
>> grid on
I got errors due to wrongly typed code and due to undefined function and variable.