Jump to content

Compounding two conditional functions of x

Featured Replies

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!

Archived

This topic is now archived and is closed to further replies.

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.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.