Jump to content

Volume-Calculation count up flow signal until a max Volume is reached


Go to solution Solved by John Brezovec,

Recommended Posts

I have a flow in and flow out in l/h at a tank. What I´m trying to achieve is count up the flow in and flow out and get a capsule once a specific amount of liter as passed the tank, then reset and count up for next capsule.

Convert signals toStep() ? and then make a runningSum(), save as variable and stop when the volume reached.

Can that be depicted in one formula?

Link to comment
Share on other sites

  • Seeq Team
  • Solution

If I understand correctly, you have a Flow Signal (L/hr), and want to create a capsule every time that flow sensor sees a certain amount of material. It sounds like you want to do some math with multiple flow sensors, but I think that'll be very similar to how we can treat just one.

The problem requires us to choose an inception time -- that is, when do we first start counting? Let's assume we want to start counting every year. We can represent that by creating a periodic condition with a capsule every year. In the periodic condition tool, select a Yearly duration:

image.png

We can then do a running integral over each year using the integral function:

$flow.integral($years)

This will end up looking like:

image.png

Then, we can generate a capsule every time a certain quantity passes through this meter (say 1000L) using some additional formula, where $integral is the running integral we just created.

$reset_quantity = 1000L
floor($integral/$reset_quantity).toCondition()

They key to this formula is the floor function, which will round down to the nearest integer, allowing us to 'chop up' the integral into 1000L chunks. This will generate the blue condition below, where we have a new capsule every 1000L:

image.png

If desired, you could then do another integral on top of the blue condition to give you a running integral that resets every 1000L:

image.png

This result could also be expressed as a single formula:

$years = years()
$reset_quantity = 1000 L

$yearly_integral = $flow.integral($years)
$fill_events = floor($yearly_integral/$reset_quantity).toCondition()

$flow.integral($fill_events.removeLongerThan(10d))
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...