Matlab programming - program and plot for water flowing in and out of a tank
Please see attachment. Thanks for your help!© BrainMass Inc. brainmass.com October 24, 2018, 5:21 pm ad1c9bdddf
Please see the attached file for detailed explanations !
BrainMass Posting Solution
Posting # CS7914
First let us look at what the problem asks and then we shall see how it can be computed using MATLAB. The problem is on rate equations and uses simple calculus to solve these equations.
Simply put, what is happening is that initially the storage tank has some water (half-full) and the vertical height of the water is y (which is assumed to be y = 0 to start with.). So our "origin" is y = 0 and y changes as the water level in the tank changes. The water level in the tank will change according to the outflow (water leaving) and inflow (water entering) of water.
It is given that outflow is at the rate Q = 400m3/day and inflow is at a sinusoidal rate of 3Q sin2t m3/day. [Here d =day, a unit of time]. We are interested in computing the rate at which the water height (y) changes w.r.t. time i.e. dy/dt.
Important note: UNITS.
y = height of water level measured in meters (m).
Q= Rate at which a volume of water is entering/leaving (so its volume/time thus m3/day)
A= cross sectional area of the tank --- always constant--- measured in m2.
Please note that dy/dt has units: length/time (measured in meters/day)
The equation to compute dy/dt follows easily. The height changes due to difference in outflow and inflow rates which is exactly what the equation given states.
Note: Since we are computing dy/dt i.e. rate of change of height, the volume rate must be divided by cross-sectional area A because Volume = ...
The expert plots the water flowing in and out of a tank. The Matlab programming is analyzed.
Matlab Program to Model a Situation
Suppose that a rabbit is initially at point (0,100) and a fox is at (0,0). Suppose that the rabbit runs to the right at speed Vr = 5 ft/sec and the fox always runs toward the rabbit at speed Vf = 6 ft/sec. Write a Matlab program that determines to within 1 second, when the fox catches the rabbit. The program should also plot rabbit and fox positions. Use the modified Euler method to estimate Xf(t),Yf(t) and the time to capture. Please do not respond without a written program in Matlab.View Full Posting Details