Drag force calculations
In fluid mechanics the drag force exerted by the surrounding medium( fluid) plays an important role in motion study. The drag force is calculated by the formula,
dragforce=0.5*(density of fluid)*(frontal area)*(velocity)^2*(drag coefficient)
1. Drag force vs velocity
function [dragforce]=myf(a,v,rho,cd)
dragforce=0.5*a*rho*v.*v.*cd;
plot(dragforce,v,\'linewidth\',3)
xlabel(\'drag force\')
ylabel(\'velocity\')
grid on
end
On entering values of frontal area, velocity and density of air ; the function returns the drag force value and also the plot for various values of drag force for different values of velocity is plotted. In case if there are different values of velocity forming an array, element wise operator \".\" is used. Inputs given to the function are included in the output screenshot.
2.Drag force vs drag coefficient
Similarly a graph for drag force vs drag coefficient can also be made. Here the values of drag coefficient are varied , unlike previous example where velocity values were varied.
function [dforce]=func(a,v,rho,cd)
dforce=0.5*cd.*v.*v.*a*rho;
plot(dforce,cd,\'linewidth\',3)
xlabel(\'draq force\')
ylabel(\'drag coefficient\')
end
The inputs are covered in the output screenshot.