Need to solve this in mathlab with code
Shown. Please explain each step
Problem 3.3: When water flows through a pipe there is friction between the water and the inner surface of the pipe. One method of modelling the effect of this friction is to compute the resulting head loss. The DarcyWeisbach equation expresses the head loss due to friction where L is the pipe length, Da is the hydraulic diameter, Vis the average velocity of the fluid flow being equal to the volumetric flow rate per unit cross-sectional wetted area, g is the local acceleration due to gravity and fo is a dimensionless coefficient called the Darcy friction factor.One must be careful not to confuse the Darcy friction factor with the Fanning friction factor f. The two are related by the rather trivial relation Rather strangely the hydraulic diameter is defined to be four times (not twice) the kydraulic radis This is due to the curious nature of the definition of the hydraulic radius. The hydraulic radius is defined as: where A is the cross-sectional area of the flow normal to the direction of the flow and P is the we perimeter, ie the length of the perimeter in contact with the water. The cross-sectional wetted area is the cross-sectional area of the pipe which is wetted, ie. in contact with water. This is equal to A For a pipe of circular cross section of internal diameter d where the flow completely fills the pipe the hydraulic radius is given by So the hydraulic radius comes out as one quarter of the internal diameter in this case. The hydraulic diameter is defined so that it is equal to the actual internal diameter in this case, ie. as four times the hydraulic radius. In this respect it is the definition of the hydraulic radius which is strange, being essentially half what it arguably could be. If rather than head loss one requires the pressure loss due to friction then the standard formula Ap-pgh, may be employed, where is the density of the water. To use the Darcy-Weisbach equation one must know the Darcy friction factor. There are two methods for determining this. One is graphical. A Moody chart is an experimentally derived plot of Darcy friction factor vs Reynolds momber (Re) for a variety of relative roughness values (a D) and flow regimes assuming fully developed flow in a circular pipe. Alternatively for laminar flow (ie very low Reynolds' number) Poiseuille gives the formula 64 Re