-
Posts
70 -
Joined
-
Last visited
-
Days Won
11
Content Type
Profiles
Forums
Events
Library
Downloads
Gallery
Posts posted by John Brezovec
-
-
As you've seen, forecastLinear can only take a constant training period (in your case the last three days). In order to get more flexibility than this, you may want to explore using the Prediction tool, using a time counter (time since last top-up) as your input signal.
As a similar example, I have a pressure signal that shows several increasing pressure cycles. I want to predict when my pressure is going to reach a certain threshold using only the data from the current run, rather than a fixed training duration.
First, I can generate a time counter that we're going to use as the input signal to my prediction tool:
timeSince($runs.growEnd(10d), 1h)
Where $runs is a condition where each capsule is an individual filter run. In your case you would want to generate a condition where the capsules go from top-up to top-up. The growEnd part of this function ensures the time counter extends into the future.
I can then generate a condition that contains only my current filter run using something like this:
$runs.join(past().inverse().afterStart(1s),10d,false)
Where 10d is the maximum duration a run can last.
We can then plug this all into the prediction tool, using our time counter as our input signal, and limiting the prediction to only use data from the Current Run.
Now you can use a simple value search to find when your predicted pressure goes above/below a certain threshold.
Hope this helps!
Signal-Based Capsule Adjustments
in General Seeq Discussions
Posted
Seeq has functions to allow easy manipulation of the starts and ends of capsules, including functions like afterStart(), move(), and afterEnd(). One limitation of these functions is that they expect scalar inputs, which means all capsules in the condition have to be adjusted by the same amount (e.g. move all capsules 1 hour into the future).
There are cases when you want to adjust each capsule dynamically, for instance using the value of a signal to determine how to adjust the capsule.
Solution:
This post will show how to accomplish a dynamic / signal-based version of afterStart(). This approach can be modified slightly to recreate other capsule adjustment functions.
Assume I have an arbitrary condition 'Condition', and signal 'Capsule Adjustment Signal'. I want to find the first X hours after each capsule start, where X is the value of 'Capsule Adjustment Signal' at the capsule start. I can do this with the below formula.
This formula only takes two inputs: $condition, and $signal. This formula goes through each capsule in the condition, and manipulates its start and end keys. In this case, the start key is the same as the original, but the new end key is set to the original start key plus the value of my signal. This formula produces the following purple condition:
Some notes on this formula:
To accomplish other capsule adjustments, look at changing the definitions of the $newStartKey and $newEndKey variables to suit your needs.