Search for question
Question

CEG2002 NUMERICAL METHODS ASSIGNMENT Your work must be submitted (as a single pdf file) to CANVAS/ASSIGNMENTS by This assignment contributes 10% of the final mark for the course. Water Level Oscillations In A Surge Tank The following figure depicts a reservoir R supplying a turbine T via a cylindrical pipe of length L and diameter D. A surge tank S is located just upstream of the turbine as shown. HR R L Hs S T От HR (consant) and Hs denote the water levels in R and S respectively. QT (constant) and Q denote the volumetric flow rates in the turbine and pipe respectively. The water level difference H(t) = Hs HR and flow rate Q(t) are governed by the coupled first-order nonlinear ordinary differential equations (describing conservation of mass and Newton's Second Law) = H Q = As (Q-QT) −9 (H+ c |Q|Q) (g = 9.81 m/s²) where As and A denote the cross-sectional areas of the surge tank and pipe respec- tively, and c is an empirical parameter used to model the local and friction head losses between R and S. CEG2002 1 2023-24 (1) With the set of parameter values and initial (t = 0) conditions allocated from * = 0.5s) the table (all in SI units) use Euler's Method (with time-step h to estimate the time taken for the water level in the surge tank to reach its maximum value. a b с d e L 100.0000 100.0000 100.0000 100.000 100.0000 D 2.2500 1.9500 2.7500 3.0000 2.5000 с 0.0100 0.0200 0.0200 0.0200 As 20.0000 20.0000 15.0000 25.000 20.0000 10.0000 4000 01 QT 10.0000 10.0000 H(0) 15.0000 10.0000 Q(0) 20.0000 15.0000 0000 01 25.0000 12.0000 30.0000 10.0000 15.0000 25.0000 [50 marks] = (H, Q) (2) The MATLAB script on page 3 solves the differential system for z(t) using the ODE solver ode45 (4th -order Runge-Kutta scheme with adaptive time stepping). Save this script in an m file and check that you can get it to run. It should plot graphs of H(t) and Q(t). Change the parameter values (L, D etc.) to match those you used in part (1), and compare your hand calculations and estimates with results obtained from MATLAB. Don't expect to get exact agreement; ode45 is much more accurate. Investigate how your system behaves as t → ∞, and how this behaviour de- pends of the value of c. Can you predict the long time (t → ∞) values of H and Q? What happens if c = 0? Can you give a physical explanation for this? [50 marks] * The last digit of your student number determines which column of data values to use: CEG 2002 last digit column 0,1 a 2.3 " 4, 5 6,7 " b C d 89 e 2 2023-24 % surge tank model % ode system integrated using ode45 function system-surge clear global g As A LC QT g=9.81; L=50.0; D=1.0%; c=0.01; As=10.0; QT=20.0; HO=25; Q0=10; A=(pi*D^2)/4; % pipe area zO=[HO,QO]; tspan [0,100]; % initial values % time interval [t, z]=ode45 (@rhs, tspan, z0); plot(t,z) % ++ function f=rhs(t,z) global g As A LC QT f=zeros (2,1); f(1)=(z (2)-QT)/As; f(2)-((g*A)/L)*(z (1)+(c*z (2) *abs (z (2)))); return CEG 2002 3 2023-24