WEEK 1 MATLAB Program to calculate drag force against a cyclist
This is my first project on MATLAB.In this project we study about drag force and how it is varied according to velocity and drag coefficient.Assuming area and density to be same for calculation purpose. If velocity is varied with drag coeffecient kept constant how it effects the drag force is shown in figure1.If velocity is kept constant and drag coeffecient is changed ie for diffrent shapes value changes ,how it effects drag force is shownin figure2.
%A program to calculate the drag force against a cyclist
clear all
close all
clc
%Inputs
%Area m^2
a= 0.2;
%density kg/m^3 ,assumed to be same for all shapes
rho= 1.2;
%velocity vs drag force
%Drag co-effecient since velocity variation we take single value
c_d1 =[0.47 ];
%velocity variation
v1=[2 3 4 5 6];
drag_force1=rho*c_d1*a*v1.^2*0.5;
figure(1)
plot(v1,drag_force1)
xlabel('velocity')
ylabel('drag force')
%drag co-effecient vs drag force
%drag coeffecient for diffrent shapes
c_d2=[.47 .42 .5 1.05 .8];
%velocity we take constant
v2=10;
drag_force2=rho*c_d2.*a*v2^2*0.5;
figure(2)
plot(c_d2,drag_force2,'color','r')
xlabel('drag coefficient')
ylabel('drag force')