using matlab code to solve the Colebrook Equation: 1/sqrtf= −2.0 ??? ((?/?)/3.7)+2.51/??√?) The following situation should be considered: 3. Given Q, L, hf, ρ, µ, and ?, compute the diameter d of the pipe (sizing problem). 4. Given Q, d, hf, ρ, µ, and ?, compute the pipe length L.
function d=pipedia(Q,L,hf,rho,mu,e)
d=0.1;
A=(pi/4)*d.^2;
V=Q/A;
Re=rho*V*d/mu;
f=hf*(2*9.81*d)/(L*V.^2);
LHS=1/sqrt(f);
RHS=-2*log(((e/d)/3.7)+(2.51/(Re*sqrt(f))));
while round(LHS,1)~=round(RHS,1)
d=d+0.01;
A=(pi/4)*d.^2;
V=Q/A;
Re=rho*V*d/mu;
f=hf*(2*9.81*d)/(L*V.^2);
LHS=1/sqrt(f);
RHS=-2*log(((e/d)/3.7)+(2.51/(Re*sqrt(f))));
end
end
Matlab Result:
>> D=pipedia(0.342,100,8,950,0.019,0.06)
D =
0.3200
function L=pipelength(Q,d,hf,rho,mu,e)
L=1;
A=(pi/4)*d.^2;
V=Q/A;
Re=rho*V*d/mu;
f=hf*(2*9.81*d)/(L*V.^2);
LHS=1/sqrt(f);
RHS=-2*log(((e/d)/3.7)+(2.51/(Re*sqrt(f))));
while round(LHS,2)~=round(RHS,2)
L=L+0.1;
A=(pi/4)*d.^2;
V=Q/A;
Re=rho*V*d/mu;
f=hf*(2*9.81*d)/(L*V.^2);
LHS=1/sqrt(f);
RHS=-2*log(((e/d)/3.7)+(2.51/(Re*sqrt(f))));
end
end
Matlab Result:
>> L=pipelength(0.342,0.32,8,950,0.019,0.06)
L =
98.5000
using matlab code to solve the Colebrook Equation: 1/sqrtf= −2.0 ??? ((?/?)/3.7)+2.51/??√?) The following situation should...
Please help with the following matlab code and please show all work. Thank you! Viscous losses in a pipe are expressed in terms of a friction factor, f. It is important to know the frictional forces in pipe flow because they result in pressure loss which must be accounted for in the piping system. For turbulent low in pipes, the friction factor is caleulated using the Colebrook e/D 2.51 where e is the roughness height, D is the pipe diameter...
Use a MATlab code to solve for the flows. 1.0 of water needs to be transferred from point A to point B through the following pipeline network. The pressure drop between two ends of each circular pipe length can be computed by Darcy-Weisbach equation where ΔP ls the pressure drop (Pa), f ls the friction factor (dimensionless), L Is the pipe length (m), ρ is the fluid density ( g) and D is the pipe diameter (m). Write two pressure...
2. The Colebrook equation for the Darcy friction factor, f, is written as: ./1/f + 0.86 In(y +2.51 3.7 NRevf For a Reynolds number (NRe) of 10% and a roughness factor, E/D, of 10, a) Show that there exists a root in the interval 0.001 0.1]. (1 mark) b) Find the number of iterations of the bisection method required to get a true absolute error of 10. (3 marks) c) Show two full iterations of the bisection method for this...
A 1-mile long 12-inch diameter asphalt dipped cast iron pipe (e = 0.00085 ft) conveys 60°F water at 3 cfs. Determine (a) friction factor f using the Moody Diagram, (b) f using the Colebrook equation, (c) head loss over the 1 mile distance, (d) slope of the EGL. Problem 2 A 1-mile long 12-inch diameter asphalt dipped cast iron pipe (e = 0.00085 ft) conveys 60℉ water at 3 cfs Determine (a) friction factor fusing the Moody Diagram, (b) fusing...
Your task is to write a matlab code using the Finite-Volume-Method (FVM) to solve the following 1D equations. Solve the 1D heat conduction equation without a source term. The 1D heat conduction equation without a source term can be written as Where k is the thermal conductivity, T the local temperature and x the spatial coordinate. Using the Finite Volume Method, use this equation to solve for the temperature T in a rod. The rod has a length of L=2.0m,...
Using Matlab, write an .M code program: Write a program for numerical solution of nonlinear equation by Fixed-Point Iteration method with given accuracy elementof. Solve the equation. Try 3 different representations of the equation in the form x = g(x). For every representation solve the problem with initial approximations x0 = 0, x0 = 2, and x0 = 10 and with the accuracy elementof = 10^-8. f(x) = e^x - 3x^4 - 40x - 10 = 0.
Q.1 Solve the following differential equation in MATLAB using solver ‘ode45’ dy/dt = 2t Solve this equation for the time interval [0 10] with a step size of 0.2 and the initial condition is 0.
scouS in a pipe are expre in terms of a Jriction Jactor, J. It is important to frictional forces in pipe flow because they result in pressure loss which must be accounted for in the piping system. For turbulent flow in pipes, the friction factor is calculated using the Colebrook equation: e/D 2.51 VT where e is the roughness height, D is the pipe diameter and Re is the pipe Reynolds number (dimensionless). For e/D = 0.008 and Re =...
Solve using MATLAB code 22.2 Solve the following problem over the interval from 0 to 1 using a step size of 0.25 where y(0) 1. Display all your results on the same graph. dy dx (a) Analytically (b) Using Euler's method. (c) Using Heun's method without iteration. (d) Using Ralston's method. (e) Using the fourth-order RK method. Note that using the midpoint method instead of Ralston's method in d). You can use my codes as reference.
USING MATLAB Please post code 1. Solve the 2nd order differential equation ?+89 +15y-sin(t), y(0)-1,?(0)-2 symbolically and numerically, and plot both results together over the time interval 0,10 sec. Provide appropriate labels on both axes, a title, and a legend that denotes each solution. Check your symbolic answer by using the Matlab DIFF function to compute the appropriate derivatives and then substituting them into the differential equation.