This is the Matlab practice so needs Matlab code
2. Numerical Integration
Consider an industrial tank in the shape of an inverted cone. Theradius of the tank at the top rim is 3 m, and the total height ofthe tank is 4 m.
The volume of the tank in m3 is given by: V = (1/3) R2 H.
The volume of liquid in the tank when filled to a height h measuredfrom the bottom vertex is:
V = (1/3)pi* (R/H)2 h3
The Lab will consist of a single script, divided in two parts. Ineach part, the filling schedule will be different. A fillingschedule is a function that provides flow rate, in m3 / h, as afunction of time.
In Part I, your script will calculate the level of the liquid, h,after a two-hour filling schedule is completed. The fillingschedule for Part I, Schedule I, is as follows:
During the first 30 minutes, the flow rate will increase linearlyfrom zero to 10 m3 / h
During the following 60 minutes, the flow rate will stay constantat 10 m3 / h
During the last 30 minutes, the flow rate will decrease linearlyfrom 10 m3 / h down to zero
In Part II, your script will calculate the time it takes tocompletely fill the tank with a different filling schedule,Schedule II, given by the equation:
Flow Rate (m3 / h) = 10 (1 - e-2t ) m3 / h
where t is time in hours, and the exponent, 2t, isdimensionless
Part I:
The volume of liquid calculated in Part I, from which the height ofthe liquid in the tank will be calculated, should be obtained byusing the built-in function to integrate polynomials, polyint()
Part I generates a single output to the console: \"The height of theliquid after Schedule I is ____ meters.\"
Part II:
In Part II, your script first defines Schedule II as an anonymousfunction
In Part II your script calculates the volume at a given time byintegrating Schedule II using the built-in function quad( )
For Option A, it is acceptable to use a loop to find the time atwhich the tank gets completely full. If you will use an iterativeapproach, check the tank volume in 0.01 hour steps
Part II generates a single output to the console: \"The timerequired to fill up the tank with Schedule II is ____ hours.\"