Question: Create a MATLAB function that will do the following Given: Re (Reynolds number) & ?/D (relative roughness) Return: f The first line of your function

Create a MATLAB function that will do the following

Given: Re (Reynolds number) & ?/D (relative roughness)

Return: f

The first line of your function should be "function f = f_userID(Re, rel_rough)" without the quote marks.

Your function should incorporate an if statement to check whether the flow is laminar, turbulent, or transitional, and return the appropriate friction factor.

Use a loop to solve the Colebrook formula for the friction factor to a precision of at least 10-5 if the flow is turbulent.

Use the Moody diagram to test various combinations of Re & ?/D.

MUST BE A FUNCTION, NOT A SCRIPT

Please show a screen capture of the program on matlab

Create a MATLAB function that will do the following Given: Re (Reynoldsnumber) & ?/D (relative roughness) Return: f The first line of your

Moody Diagram 11 01 Transition Region 0.1 0.09- 0.08 0.07 0.06 0.05 0.05 -0.04 0.03 0.02 0.015 0.04 0.01 - 0.005 IIIII Friction Factor Laminar Flow 0.002 0.001 5x 10-4 Relative Pipe Roughness 0.02 0.015 2x 10-4 Complete Turbulence: 0.01 r-1-1-r1911----- - ----- --1-re Material (mm) Concrete, coarse 0.25 Concrete, new smooth 0.025 Drawn tubing 0.0025 Glass, Plastic Perspex 0.0025 Iron, cast 0.15 Sewers, old Steel, mortar lined 0.1 Steel, rusted 0.5 Steel, structural or forged 0.025 Water mains, old 1.0 HHHHHHHHH 103 5x10-5 a Rim 3.0 JLJJJJ-- El 10-5 -Friction Factor = CAP. H5x 10-6 .!.!J ALL.... Smooth Pipe 104 106 107 108 105 Reynolds Number, Re = evd

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!