MATLAB QUESTION. x = 9 Water is discharged from a reservoir through a long pipe
ID: 3868101 • Letter: M
Question
MATLAB QUESTION.
x = 9
Water is discharged from a reservoir through a long pipe as shown in the figure. By neglecting the change in the level of the reservoir, the transient velocity of the water flowing from the pipe, v(t) can be expressed as: v(t) = squareroot 2gh = tan h (t/2L squareroot 2gh) where h is the height of the fluid in the reservoir, L is the length of the pipe, g is the acceleration due to gravity, and t is the time elapsed from the begining of the flow. Find the value of h necessary for achieving a velocity of v = (x + 2) m/sec at time t = 3 sec when L = 5m and g = 9.81 m/sec^2 x value is based on the last digit of your student ID. For example, student with ID 41234567 uses x = 7Explanation / Answer
clc;
clear all;
x = 7; % change the value of x here, based on your student id.
t = 3;
L = 5;
g = 9.81;
syms h
% Formulating the equation making v(t) as LHS and rest as RHS and which in
% turn equals to (x + 2)
v_t = tanh((t/(2*L))*sqrt(2*g*h)) == (x + 2);
% solving for h
sol_h = solve(v_t, h);
h = sprintf('%.6f', double(sol_h))
Output
h =
-1.390278
>>
Matlab Codeclc;
clear all;
x = 7; % change the value of x here, based on your student id.
t = 3;
L = 5;
g = 9.81;
syms h
% Formulating the equation making v(t) as LHS and rest as RHS and which in
% turn equals to (x + 2)
v_t = tanh((t/(2*L))*sqrt(2*g*h)) == (x + 2);
% solving for h
sol_h = solve(v_t, h);
h = sprintf('%.6f', double(sol_h))
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.