 Lindsey.Wilcox

44

5
• Points

11 [ Donate ]

Lindsey.Wilcox had the most liked content!

9 Neutral

Personal Information

• Company
Seeq
• Title
Analytics Engineer

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

1. This method demonstrates how to apply time warping to a signal which can shorten the time between sample points while retaining the signal’s characteristic shape. This is useful for batch processes where batches may have different durations or for aligning data from multi-step processes with different durations. Note that this method is distinct from the more complex Dynamic Time Warping. The following example is based upon the Area A Compressor Power signal available in the Example Data. A single condition was created to capture each compressor run, as shown in the following image. Step 1: Specify a Time Normalization Factor The user uses the Formula tool to specifiy a time duration (scalar value), set to 4 hours for this example. The compressor power signal for each compressor run will be normalized to this time duration. There is no single correct value; the value needs to be shorter than the minimum time duration for all signals to be normalized. // User specified time duration (scalar value). 4 hours Step 2: Create the Normalized Condition Use Formula to create the normalized Compressor Run condition based on the user-specified time normalization factor. This condition will be used later when the calculated signal delay is used for normalization. \$CompressorRuns.afterStart(\$nF) Step 3: Calculate the Run Duration Use the Signal from Condition tool to calculate the duration for each compressor run. This value will be used later for determining the calculated signal delay applied to each compressor run. Step 4: Calculate the Elapsed Time During Each Run Use the Formula tool to calculate the elapsed time during each compressor run. This value will be used later for determining the calculated signal delay applied to each compressor run. timeSince(\$CompressorRuns, 0.25min).convertUnits('h') Step 5: Calculate the Signal Delay Factor Needed for Time Warping Each sample (timestamp) for compressor power will be shifted to the left by a calculated amount to time warp the power signal from its original time period (Compressor Runs) to the normalized time period (Compressor Runs Normalized). The first sample point in each run will have no delay, and the last sample point will have the greatest delay. For example, if the original time period is 10 hours and we are normalizing to a time period of 4 hours, then the last sample point in the run will be shifted to the left by 6 hours (Delay Factor = -6 hrs). // This Formula first creates a signal with a value of 0 (default delay), then splice in the calculated delay during each compressor run. 0.toSignal(0.25min).convertUnits('hr').splice(\$ElapsedTime*(\$nF/\$RunDuration-1),\$CompressorRuns) At this point we zoom in to a single compressor run and use the Capsule Time view to better visualize the results of our intermediate calculations. For this compressor run lasting 10.9 hours, the Compressor Run Elapsed Time finishes at the correct value (10.9 hours) and the Delay Factor correctly decreases from 0 hours (beginning of run) to -6.9 hours (end of run). Step 6: Apply the Signal Delay to Time Warp the Signal Now that the appropriate delay factor is calculated for each sample point during the compressor runs, we apply it to the Area A Compressor Power signal using the delay() function in Formula. This generates the time warped signal called Compressor Power Normalized. \$CompressorPower.delay(\$delayFactor,24h).within(\$CompressorRunsN) When applying the signal delay, we are required to specify a maximum delay. This is important for the Seeq calculations going on in the background, so that the queries know how far back and forward to go when requesting input data. The maximum delay also provides a convenient way for the user to limit the applied delay, if they have some reason to do so. In our case, we just want the chosen value to be longer than the longest expected compressor run duration. Results Now that the compressor power signal has been normalized, Capsule Time view gives a nice comparison of the power signal behavior across the 3 runs contained in the Display Range:
• 1
• 2. If the condition(s) used in the analysis have a maximum capsule duration that is greater than 30 days, an alternative method is recommended to replace "if" statements. If this is the case, users can use boolean signals, as described in the following post:
3. Often, users that are familiar with coding or Excel ask how to use "if" statements in Seeq's Formula language. Essentially, these users are looking to perform certain calculations or analytics under a specific condition. In Seeq, users can use either boolean signals or conditions to replace "if" statements. This post describes how to use boolean signals to replace "if" statements and is recommended when performing calculations with capsules that have a maximum duration of longer than 30 days. If the maximum capsule duration is less than 30 days, users may use conditions to replace "if" statements, as described in the following post: This example creates a new single signal which runs different calculations during different periods of time. This technique can be used to replicate "if" logic or "if / else" logic currently being used in excel. Example existing code from excel or other systems IF Temperature > 90F Temperature * 100 IF Temperature < 90F Temperature + 10 Step 1: Create a Boolean Signal for High Temperature The following formula creates a Boolean signal that is equal to 1 when the high temperature (>90) condition is true and 0 when false. Using sign() adds an interpolated sample at the zero crossing so that the resulting signal steps at exactly the correct transition. The (\$x.sign()+1)/2 idiom compensates for sign()'s behavior of producing values -1,1 when we want the boolean signal to be have values 0,1. ((\$Temperature - 90).sign() + 1)/2 Step 2: Create a Boolean Signal for Low Temperature The following formula creates a Boolean signal that is equal to 1 when the low temperature condition is true and 0 when false. ((90 - \$Temperature).sign() + 1)/2 Step 3: Create the Final Signal This formula first multiplies each Boolean signal by the intended calculations that would be present for the respective conditions and then combines the two series.
5. In Seeq Version R21.0.42, a .movingAverageFilter() operator was introduced in Formula. This operator smooths a signal by averaging values with their neighboring values. Its important to note that this operator is intended to smooth a signal. The aggregate operator should be used for computing averages on a periodic basis, such as hourly or daily moving averages. The following example uses the .movingAverageFilter() operator to resample the Temperature signal to 5 minutes and use a window size of 30 min.
6. There are many cases where a moving average needs to be monitored. To create any statistic that is associated with a sliding time frame, first use the periods() function in Formula to create the periodic capsules. A few examples are listed below. Intent Seeq Formula 30 day average every 1 day periods(30d,1d) 24 hour average every 1 hour periods(1d,1h) 30 minute average every 5 minutes periods(30min,5min) Once the periodic condition is created, use Signal from Condition to calculate a moving average, max, min, or other statistic. The sliding capsules will appear overlapped in the capsules lane. Refer to the capsules pane to verify the capsules meet your expectation of start time and duration, then apply the desired "moving" aggregation (average, standard deviation, etc.) to any signal with the Signal from Condition tool. Below shows a moving 30 minute average sampled every 5 minutes on the Example Temperature data.
7. Background In this Use Case, a user created a condition to identify when the compressor is running. During each Compressor Running capsule, the compressor operates in a variety of modes. The user would like a summary of the modes of operation for each capsule in the form of a new signal that reports all modes for each capsule (i.e. Transition;Stage 1;Transition;Stage 2;Transition, Stage 1;Transition). Method 1. The first step is to resample the string value to only have data points at the value changes. It's possible the signal is already sampled this way, but if it is not, use the following Formula syntax to create a "compressed" signal: \$stringSignal.tocondition().setMaximumDuration(3d).transformToSamples(\$capsule -> sample(\$capsule.getStart(), \$capsule.getProperty('Value')), 4d) 2. Now, you can create a signal that concatenates the string values during each capsule. This is achieved using the following Formula syntax: \$compressorRunning.setmaximumduration(10d).transformToSamples(\$cap-> sample( \$cap.getStart(), \$compressedStringSignal.toGroup(\$cap).reduce("", (\$s, \$capsule) -> \$s + \$capsule.getvalue())), 7d).toStep()
8. You can use the start and end times of capsules to create new capsules with an arbitrary time before or after. This is useful when the process expert knows that there is a time period of interest before or after a capsule start or end timestamp. Refer to the example below. Here we have a series for the Area A Compressor Power shown in blue. We have created capsules shown in green for when the compressor is running in the high state, above 30kW. In this example, we want to create a capsule series that starts when the compressor exits the high stage (goes below 30kW) and then ends at exactly 2 hours later (or any other arbitrary time specified by the user). All we need to use is the following Seeq Formula: This formula creates a new set of capsules that start at the end of the “Compressor Power > 30” capsules and end exactly 2 hours later. The functions afterStart(), beforeStart() and beforeEnd() can be used similarly. For example, to create a set of capsules that capture the two hours prior to our “compressor high” condition, we can simply modify the formula above by changing “afterEnd” to “beforeStart.”
9. Earlier Versions (Before R21.0.42) Alternatively, all of the steps in this solution may be performed in a single Formula:
10. Background In this Use Case, a condition was created to identify when a compressor is running. Let's say I'd like to extend each capsule in this condition so that instead of ending when the compressor turns off, it ends when the next compressor running capsule starts. Method The method used depends on the Seeq version. Seeq R21.0.42 and Later Version R21.0.42 introduced the .growEnd() operator; this operator grows capsules in in a condition by extending the end until the start of the next capsule. Earlier Versions (Before R21.0.42) 1. First, create a condition that is the inverse of the Compressor Running condition. This can be achieved using the .inverse() function in Formula 2. Next, extend each Compressor Running capsule so that they overlap with the Downtime capsules. This is achieved using the .move() function in Formula. 3. Finally, combine the Downtime and Compressor Running - Extended conditions use the union logic in the Composite Condition tool.
12. Another option for creating conditions for seasons, would be to use the Custom Condition tool. The Custom Condition tool allows you to specify the start and end time of each capsule in a condition. Here I've used the Custom Condition tool to create a condition for seasons in 2019. This condition contains a capsule for each season:
13. Update as of R21.0.41: As of the release of R21.0.41, the .toCapsules() operator has changed. As of this version, the operator may be used to create a condition that contains a capsule for every valid sample in an input signal (regardless of whether the value has changed). To create a condition that contains a capsule for every value change in an input signal (as done in the previous post), the toCondition() operator must be used.
• 2 replies
• 1
• 14. Update as of R21.0.41: As of the release of R21.0.41, the .toCapsules() operator has changed. As of this version, the operator may be used to create a condition that contains a capsule for every valid sample in an input signal (regardless of whether the value has changed). To create a condition that contains a capsule for every value change in an input signal (as done in the previous post), the toCondition() operator must be used.
15. Capsule properties may also be used as column headers in Scorecard. More information on this can be found in this post:
×