A pipe of diameter D is to be submerged in a river spaning a

A pipe of diameter D is to be submerged in a river, spaning a section of width W. The flow of the river creates a drag force FD on the pipe which is given by: F_D= ((DW)/2)pv^2C_D (v)

where r is the water density (=103 kg/m3), v>0 is the average water speed in m/s, CD(v) is the speed-dependent drag coefficient given by C_D=.193 (^3sqrt(14)((pDv)/u)^.681    u is the viscosity of water (=0.002 kg/(m-s)).   A structural analysis of the pipe indicates that it can withstand a maximum force of 75 N. Write a program that computes the average water speed that the pipe can withstand when D=0.0254 m and w=25 m. Use Newton’s Method with convergence criterion of 10^-4 for the relative error. Verify your answer by using the MATLAB function fzero. Include this verification in your program. Your program should output: - A plot of the function versus v with appropriate attributes. This plot helps in determining the initial estimate for Newton’s Method (the initial value x0). - The answer from Newton’s Method along with the number of iterations
3
- The answer from the fzero function.
Save your program for this problem with m-file name firstnameinitial_lastname_Project1_3.m. Document your program as necessary. Upload to Moodle your main program and any necessary m-file functions.  

Solution

The equation for c_d is not clear. Please update that and you\'ll get the answer using the code below.

drag_force.m

%function to calculate drag force

function f = drag_force(v)
p = 103; %density
D = 0.0254; %diameter
W = 25; %width
u = 0.002; %viscosity
cd = c_d(p, D, v, u); %c_d function call
f = ((D*W/2)*p*v^2)*cd; % calculation of f
end

drag_force_differential.m

% function for differential for drag force. Same as above except updated equation for f. (Differential % of above f wrt v)

function f = drag_force_differential(v)
p = 103;
D = 0.0254;
W = 25;
u = 0.002;
cd = c_d(p, D, v, u);
f = 2*(D*W/2)*p*v*cd;
end

c_d.m

function cd = c_d(p, D, v, u)
cd = 0.193^(3*sqrt(14)*((p*D*v)/u))^0.681;
end

script.m

%main script

max = 75;

%fzero function
fun = @drag_force;
v0 = 0.005;
v = fzero(fun, v0);
disp(v);

%Newton\'s method
force = 0;
force_differential = 1;
vel = 10;
n = 0;
while (force>max+0.0001 || force<max-0.0001)
    vel = vel - force/force_differential;
    force = drag_force(vel);
    force_differential = drag_force_differential(vel);
    n = n + 1;
end

disp(n);
disp(v);

A pipe of diameter D is to be submerged in a river, spaning a section of width W. The flow of the river creates a drag force FD on the pipe which is given by: F
A pipe of diameter D is to be submerged in a river, spaning a section of width W. The flow of the river creates a drag force FD on the pipe which is given by: F

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site