Jump to content

Compounding two conditional functions of x


vulgarian

Recommended Posts

Hello,

 

Is it possible to combine the following functions into one?

 

x := 0.5m

 

ft(z) := if(z<=x, f(z), f(x)+f2(z-x))

 

f(z) := 850*g*z

 

f2(z) := 1024*g*z

 

ft(z) calculates the static pressure at depth z in a 0.5m layer of oil on top of water. So if z is in the oil the result is just f(z), but if in the water layer, f(0.5)+f2(z-x).

 

My fluids lecturer hinted that this kind of problem can be solved without the use of ifs, but didnt seem eager to expand!

 

I'm wondering if it can be solved through knowledge of the pressure-depth gradients of each fluid... but it's mirky!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.