Water filling a barrel with leakage

  • Thread starter Thread starter lkmarcum
  • Start date Start date
  • Tags Tags
    Leakage Water
AI Thread Summary
The discussion focuses on modeling the height of water in a barrel that fills at a rate of 36.8 lb/sec while leaking at a rate proportional to the water depth, given by 9.2*h lb/sec. The challenge is to develop a mathematical model for the height of the water as a function of time, particularly for use in a Matlab script. A differential equation approach is suggested, where the change in volume over time is expressed as the difference between the inflow and outflow rates. The conversation emphasizes the need for numerical approximation techniques to simulate the system accurately over a specified time period. Theoretical height equations are also provided for comparison with the numerical model.
lkmarcum
Messages
3
Reaction score
0

Homework Statement


The flow of water into a barrel = 36.8 lb/sec.
The height of the water = h = weight of the water in the barrel/(density of water)(bottom area of barrel)

There is a "leak" at the bottom of the barrel at h = 0. Flow out of the barrel is related to the depth of the water in the barrel. The deeper the water in the barrel the faster it will flow out. For this barrel the water flow out in lb/sec is = 9.2*h.

The area of the barrel is A = 4.60 ft^2. The density of water is p = 62.4 lb/ft^3.

Develop a mathematical model to represent the height of the water in the barrel as a function of time.

Homework Equations


I'm given an equation for the theoretical height of the water:
htheo(t) = 4(1-exp(-.032t))

The Attempt at a Solution


I'm drawing a blank on this, unfortunately. I have to develop a model for h(t) to use in a Matlab script to produce a matrix for height values from t = 0 to 250 seconds.

My original thought was to set h = (36.8t - 9.2h)/(density*area) and then solve for h. But of course that resulted in a linear equation with no maximum height of the water. This is obviously incorrect since the water will eventually even out as the leak factor is equal to the incoming water, when h = 4 ft.

I simply cannot wrap my mind around how to set up an equation for this. Any help at all would be greatly appreciated!
 
Physics news on Phys.org
Hi lkmarcum, Welcome to Physics Forums.

Is this implementation meant to be a numerical approximation (simulation), or are you meant to derive the closed form formula? The problem can be modeled by a differential equation which can either be solved symbolically or you can "integrate" it by numerical approximation (either using a built-in solver or by implementing your own numerical integrator).
 
The problem is presented in three parts:

1) Find a way to approximately model the height from t = 1 to 250

2) Find height values over the same time period using the equation for the theoretical height.

3) Plot the data from parts 1 and 2 to give a comparison.

Parts 2 and 3 are no problem. It's finding a way to model the system in Matlab for part 1 that is giving me fits.
 
QUOTE="lkmarcum, post: 4905241, member: 530041"]

Homework Statement


The flow of water into a barrel = 36.8 lb/sec.
The height of the water = h = weight of the water in the barrel/(density of water)(bottom area of barrel)

There is a "leak" at the bottom of the barrel at h = 0. Flow out of the barrel is related to the depth of the water in the barrel. The deeper the water in the barrel the faster it will flow out. For this barrel the water flow out in lb/sec is = 9.2*h.

The area of the barrel is A = 4.60 ft^2.[/quote]
So the volume when the water is h feet high is 4.60 h cubic feet.

The density of water is p = 62.4 lb/ft^3.
The water is coming in at 36.8 lbs/sec the volume is increasing by 36.8/62.4= 0.590 ft^3/sec.
But water is also going out at 9.2h lbs/sec= (9.2/62.4)h= 0.147h ft^3/sec.

dV/dt is the rate at which the volume of water is changing: dV/dt= 0.590- 0.147h.
Since V= 4.60 h, dV/dt= 4.60 dh/dt= 0.590- 0.147h

Develop a mathematical model to represent the height of the water in the barrel as a function of time.

Homework Equations


I'm given an equation for the theoretical height of the water:
htheo(t) = 4(1-exp(-.032t))

The Attempt at a Solution


I'm drawing a blank on this, unfortunately. I have to develop a model for h(t) to use in a Matlab script to produce a matrix for height values from t = 0 to 250 seconds.

My original thought was to set h = (36.8t - 9.2h)/(density*area) and then solve for h. But of course that resulted in a linear equation with no maximum height of the water. This is obviously incorrect since the water will eventually even out as the leak factor is equal to the incoming water, when h = 4 ft.

I simply cannot wrap my mind around how to set up an equation for this. Any help at all would be greatly appreciated!
 
So it looks like you want to create a numerical model, essentially a simulation of the system.

Consider a small time interval (time step) Δt at some instant t during the filling. At time t the current height of the water is h. How much water flows into the barrel during that time interval? How much (approximately) flows out during that interval? At the end of the time interval (new time = t + Δt), what's the new volume of water in the barrel, and thus the new height h?

Starting at t = 0, volume = 0, and h = 0, repeat the above saving values of h and t along the way, until your Δt's sum to 250 seconds. Play with the size of Δt to see how it affects accuracy compared to the theoretical result.
 
gneill - Thank you very much for your help. This definitely got me pointed in the right direction. Now I just need to figure out how to use a "for loop" to execute this in Matlab!

Again, thank you for taking the time!
 
Back
Top