Cylindrical Tank Capacity

You only need to bind it to the co2 value + argon value. That’s it.

But I suspect there is some misunderstanding somewhere.

Why are you changing the capacity of the tank? As several have suggested the best approach is to make the tank capacity 100 and then proportion the contents in percent.

1 Like

I finally got it, thank you! (:slight_smile:

Because the tank is holding a gas, maybe the capacity is a function of the pressure in the tank. Is that the case Nicole?

If she wants the ratio of both gas, the capacity doesn’t matter, though… Which is why we suggested setting the capacity to 100.

1 Like

If there are two gases in the tank at any given moment, then, the quantities of each of the gases will be based on an analysis of a sample of the gas; this put together with the total weigh of the gas in the thank will give you the quantity of each gas being held.
I will also assume that there is a pressure limit on the tank so, 0- pressure limit + total weight + material balance of the 2 gases = amount of each gas in the tank.
This also depends on what Nicole is trying to represent as the “level”

I ended up getting the tank to do what I wanted it to do. The expression looks a little something like this:

This looks like a hacky way of doing things. But if it works…
Two remarks, though:

  1. & is a bitwise operator. It works for booleans, but be careful.
  2. you don’t need to check for ranges. If the first if check returns true, the second one won’t be evaluated.
    here’s what I mean:
if (time < b and time >= a, something,
if (time < c and time >= b, something_else, another_thing))

for a < b < c < d
is equivalent to

if (time < b && time >= a, something,
if (time < c, something_else, 
if (time < d, another_thing, one_last_thing)))

If the second if is reached, then time >= b. You don’t have to check it again.

1 Like

I prefer to use the case instead of nested if statements,

case(True,
	{view.custom.duration_hr} > 8766, 10000000,
	{view.custom.duration_hr} > 4380, 5000000,
	{view.custom.duration_hr} > 730, 2700000,
	{view.custom.duration_hr} > 168, 450000,
	{view.custom.duration_hr} > 24, 100000,
	{view.custom.duration_hr} > 0.166, 15000,
	10.41667	
)
    
2 Likes

Yes it is indeed a better (imho) solution. I wanted to suggest it, but I thought it was more relevant to first deal with the evaluation order of ifs.

1 Like

Thank you for all your help! :slight_smile:

1 Like