 # Allison Buenemann

Seeq Team

70

31

## Everything posted by Allison Buenemann

1. Sometimes when looking at an xy plot, it can be helpful to use lines to designate regions of the chart that you'd like users to focus on. In this example, we want to draw a rectangle on the xy plot showing the ideal region of operation, like below. We can do this utilizing Seeq's ability to display formulas overlaid against an xy plot. 1. For this first step, we will create a ~horizontal line on the scatter plot at y=65. This can be achieved using a y=mx+b formula with a very small slope, and a y-intercept of 65. The equation for this "horizontal" line on the xy plot is: 0.00001*\$x+65 2. If we want to restrict the line to only the segment making the bottom of our ideal operation box, we can leverage the within function in formula to clip the line at values we specify. Here we add to the original formula to only include values of the line between x=55 and 5=60. (0.00001*\$x+65) .within(\$x>55 and \$x<60) 3. Now let's make the left side of the box. A similar concept can be applied to create a vertical line, only a very large positive or negative slope can be used. For our "vertical" line at x=55, we can use the following formula. Note some adjustment of the y-axis scale may be required after this step. (-10000*(\$x-55)) 4. To clip a line into a line segment by restricting the y values, you can use the max and min functions in Formula, combined with the within function. The following formula is used to achieve the left side boundary on our box: (-10000*(\$x-55)) .max(65) .min(85) .within(\$x<55.01 and \$x>54.99) The same techniques from steps 1-4 could be used to create the temperature and wet bulb max boundaries. Formula for max temp boundary: (0.00001*\$x+85).within(\$x>55 and \$x<60) Formula for max wet bulb boundary: (-10000*(\$x-60)) .max(65) .min(85) .within(\$x<60.01 and \$x>59.99)
3. FAQ: I have a condition for events of variable duration. I would like to create a new condition that comprises the first third of the time (or 4th, or 10th) of the original condition. Solution: A stepwise approach can be taken to achieve this functionality. 1. Begin with your condition loaded in the display pane. 2. Create a new Signal using Signal from Condition that calculates the total duration of each of your event capsules, interpolated as a step signal. 3. Create a new signal that is your total event duration multiplied by the proportion of the event that you would like to capture. e.g. for the first 1/3 of the event, divide your total duration signal by 3, as shown below. 4. Create an arbitrary discrete signal with a sample at the start of each of your event capsules. 5. Shift the arbitrary discrete signal in time by the value of your signal calculated in step 3. In this example, the 1/3 duration signal. Note, depending on your version of Seeq, the function to do this may be called move() or delay(). 6. Use the toCapsules() function in Formula to create a tiny (zero duration) capsule at each of your shifted, discrete samples. 7. Join the start of your original condition with the capsules created in step 6 using the composite condition tool.
4. Hi Venaktaramesh, The Knowledge Base article below describes how the AF Data Reference connector can be used to write Seeq calculations to AF. In order to se PI Notifications for Seeq calculations, items must follow this pathway of communication. https://seeq.atlassian.net/wiki/spaces/KB/pages/933725050/Seeq+AF+Data+Reference Thanks, Allison
5. Hi @Devin, When you open the import from CSV file tool, select import file as condition. If you scroll down to the "+" icon that says "Optional Settings" you'll see that the default treatment of CSVs imported as a condition is to treat all columns as capsule properties.
6. Hi @Devin, beginning in version R22.0.48 this got much easier with the CSV Import Tool 2.0. You can learn more about the CSV Import 2.0 tool from this https://seeq.atlassian.net/wiki/spaces/KB/pages/537690127/Import+CSV+Files+2.0. If you need assistance upgrading your software to version 48+ feel free to reach out to your account manager or sales executive.
7. Sometimes it is desired to have custom units of measure display in Seeq Scorecards. This could be used when the signal or condition has no units or when you want to add a custom display or a unit that might not be a recognized Seeq unit. You can use Seeq's Number Format customization in the item properties panel to add custom text units to your scorecard. Here are some examples showing different ways to add text display units. The key here is including the text in quotation marks. More information on how to customize these number displays, including the syntax for adding custom text, can be found by clicking the "?" icon next to "Number Format".
• 3
• 8. An optional workaround to having the values show directly on top of the histogram bars is to combine histogram and scorecard views in an Organizer Topic. Here is an example of doing this:
9. The workaround discussed in this forum post is another way to visualize multiple series together on one scatter plot, and holds up so long as the variables can be displayed on the same y-axis scale. For dramatically different y-axis scales, Seeq Data Lab can be used to produce scatter plots with multiple y-axes.
10. FAQ: I have a signal with a gap in the data from a system outage. I want to replace the gap with a constant value, ideally the average of the time period immediately before the data. Solution: 1. Once you've identified your data gaps, extend the capsules backwards by the amount over which time you want to take the average. In this example, we want to fill in the gap with the average of the 10 minutes before the signal dropped, so we will extend the start of the data gap capsule 10 minutes in the past. This is done using the move function in Formula: \$conditionForDataGaps.move(-10min,0min) 2. Use Signal from Condition to calculate the average of the gappy signal during the condition created in step 1. Make sure to select "Duration" for the timestamp of the statistic. 3. Stitch the two signals together using the splice function. The validvalues() function at the end ensures a continuous output signal. \$gappysignal.splice(\$replacementsignal,\$gaps).validvalues()
11. When examining data in Capsule Time view it can be useful to view data from the time period immediately the capsules alongside the data during the capsules. This can be done by: 1. Hover over the x-axis (shown in the image above as measuring time from the start of the capsule in hours), click and drag your mouse to the right. You will likely see no data from the time period before 0.0 on the x-axis. 2. Click on the "Dimming" option at the top of the Display Pane. Check the box to "Show Data Outside of Conditions". When this box is checked the data outside of the conditions is displayed, slightly more faintly than the data within the capsules. Optionally, utilize some of Seeq's coloring features in capsule time to display the data from each capsule and before/after in different colors (rainbow shown).
12. Background: When looking to identify trends or step changes in a signal, we typically recommend an approach of smoothing the signal, taking the first derivative, then identifying when that derivative is positive or negative. This method works well most of the time, but employing this technique in combination with others can be more effective at capturing trends/step changes when the value change in the signal is more subtle. Solution: When looking for step changes, we can use a technique of calculating a range of the signal on a rolling periodic basis and search for when the range exceeds some limit. We can then combine this condition with when the derivative is positive (increasing step changes) or negative (decreasing step changes) to capture our final condition. 1. Create a rolling window over which you will look at the range (max-min value) of the signal. In my example I used a 4h window every 30 minutes, because my tank draining events were typically never longer than 4h. Select the smallest time period that you can that is still longer than your longest draining event. 2. Use Signal from Condition to calculate the range (max-min) of your signal over each of the rolling windows. Make sure to place the time stamp of the statistic at the end of each rolling capsule. 3. Identify time periods when that range calculation is above some threshold. In this example we used a threshold of 2 based looking at the trend output of our step 2. If we zoom in on a smaller range of time, we see that our capsules for when the range value is high actually extend beyond the completion of our decreasing signal. 4. We can intersect this condition that we have identified for high range in the signal with a condition for when the derivative of the signal is negative to capture our desired events. First calculate the first derivative of the signal. We apply a smoothing agileFilter in this step as well to remove signal noise. 5. Identify when that derivative value is less than zero using the value search tool. 6. Now take the intersection of the condition for negative derivative of the level and the condition for high range. The final view of the original signal and the events identified: Use chain view to validate your calculations:
13. Background: Seeq has functions in Formula to remove outliers based on different algorithms, but sometimes it is desired to identify and remove outliers that falls outside of the interquartile range. Solution: The approach we can take to solve this data cleansing problem in Seeq is to determine the periods over which we want to calculate the quartiles, calculate new signals from the 25th and 75th percentiles during each of those periods, identify deviations from those percentiles, and remove data outside of the IQR from our original signal. 1. The first step is to decide what type of periods you would like to use to calculate your percentiles. Some periodic choices might include: hourly, daily, or a rolling window of 24 hours each hour. Other choices could be the current production run, the time since the equipment was last maintained, etc. In this example we will use an hourly periodic condition in our quartile calculations. 2. Next, use the signal from condition tool to calculate the 25th percentile during each of the capsules defined above. 3. Use the same method to calculate the 75th percentile during each of the capsules defined above. 4. Use Seeq's Formula tool to calculate the IQR. \$UpperQ - \$LowerQ 5. Now use Formula to calculate the upper and lower limits as for outlier removal as: \$upperQ + n*\$IQR (where n is a scalar multiplier, 1.5 in this example) \$lowerQ - n*\$IQR 6. Search for deviations from the Upper and Lower limits using Deviation Search. 7. Then use Formula to remove data during the identified outlier capsules. \$signal.remove(\$outliers)
14. Background: One of the quirks of raw, ungridded time series data is that sampling frequencies may vary. Sometimes the sample frequency is different for two signals that you are comparing, and sometimes the sample frequency is different for a single signal at different points in time due to a process data historian's compression configuration. How you handle this variability in sampling rate can have a significant impact on calculations of summary statistics. Various approaches to calculating summary statistics and their implications: In this example we have four signals with different amounts of samples in the display range (as highlighted by the "count" statistic in the details pane. Our goal is to calculate a single "average" value for all of the signals during this window. Notice the different outcome values from each different approach. Method 1: One option that we have for getting a single "average" statistic is to take the average value of each of the 4 signals over the time window, then take the average of that. This method weights each of the signals evenly in the calculation of the final average value, since the final average value is equal to (0.25)*avg1 + (0.25)*avg2 + (0.25)*avg3 + (0.25)*avg4 Method 2: A second option is to first create a continuous average signal, then aggregate that over the display window to calculate an average. The average can be calculated using formula and the average function with the syntax shown below. Note that the sample count on the output signal has a significantly larger number of samples than any of the original signals. This is because the average function calculates a sample any time any of the input signals has a sample. For the signals that do not have a sample at a particular key, the linearly interpolated value of the signal is used in the average calculation. Then a scorecard aggregation of the average of the continuous average signal can be calculated in the Scorecard Metric tool to get the result below. Method 3: A third option is to take the average of all the data points in the display window, independent of which signal they belong to. This approach involves first combining all of the samples from the 4 signals into a single signal, then taking the average of that value over the display window. The sample count of the combined signal will be equal to the sum of the sample counts of all other signals, as demonstrated below. In this approach, the resultant signal also has a sample any time any of the other signals contain a sample. Note that if signals have the same frequency, a tiny delay can be applied to the 2nd through the nth signal (1 ns to n-1 ns) to ensure all samples are kept. A scorecard metric of the average of the combined signal can then be calculated. The overall average value returned using this method is much higher than the two previous methods due to the relatively higher amounts of samples in signals 3 & 4, which have generally have higher values than signals 1 & 2. Method 4: A non-time-weighted average (similar to method 3) can also be calculated using the following formula: average(\$signal1.toDiscrete(),\$signal2.toDiscrete(),\$signal3.toDiscrete(),\$signal4.toDiscrete()) Once again the final signal contains a number of samples equal to the sum of all of the sample counts of the input signals. In conclusion.. Which method of averaging is best for your use case? The answer is probably "it depends" on the use case you are analyzing. Some examples of when different methods may be applied: An average over a specific time range - Method 1 An instantaneous average at a point in time - Method 2 An average of signals where each sample represents a unique event or independent measurement (e.g. lab or quality data) - Method 4 Regardless of your specific use case, having an understanding of how your data frequency, your historian's compression settings and your analytical approach can impact your results is an important starting point in any analysis!
15. FAQ: I've created a condition for a particular event of interest and now I would like to create a signal that is the running count of these events in a given time period. This analysis is common in equipment fatigue use cases when equipment degrades slowly based on a number of cycles (thermal, pressure, tension, etc) that it has undergone during it's life or since a last component replacement. Solution: We can convert each of these capsules into a signal comprised of a single sample (with value of 1) per capsule, then take a running sum of this new signal over the current equipment life condition. 1) Use Formula to create a signal with a constant value of 1 and a sample every 1 second. (1).toSignal(1sec) 2) Use Signal from Condition to create a new signal with a single sample of value 1 per capsule. Take the average of the "1 signal" during each of the event capsules. 3) Use Formula to calculate the running sum of the 1 sample per capsule signal during the Current Equipment Life capsule. \$OneSamplePerCapsule.runningSum(\$CurrentLife).toLinear(7d)
16. Question: I have a scorecard metric displaying the maximum value of a signal during a given capsule. I have the Scorecard coloring red if the value is >2%. Is there any way to display a scorecard with just color coded cells containing no values? What I am seeing now: What I would like to create: Solution: In general, the approach to creating a blank scorecard with color thresholds is to create a string signal comprised of varying amounts of spaces for each threshold/band. Then you can apply that number of spaces as a color threshold in the Scorecard metric tool. 1) Create your "empty" string signal in Formula. In the example below, we have a baseline signal that is a completely empty string and we are splicing in a string containing two spaces any time the value of the original signal is greater than 2%. You can see that the empty string signal has what looks like a constant value each time the original signal is > 2%, but when you hover the cursor over the signal you see that it is actually blank. 2) Use Formula to create a scalar threshold value to select as your threshold in Scorecard. Note, in versions R22.0.47 and greater, string values are accepted as thresholds in the scorecard metric tool, so this step can be skipped. 3) Calculate your scorecard metric. For versions before R22.0.47, the tool input for the thresholds will look like this: For versions R22.0.47 and newer, you can use: 4) The final scorecard (validated against the original one containing values):
17. Hi Felix, You can embed the scorecard multiple times by clicking on the content in Seeq Organizer and copying and pasting another copy of it. You can then click on each of the copies and adjust the date range of that particular copy. My recommendation to create the scorecard you originally described is: 1) Create a simple scorecard metric calculating the average value of your signal. Remove the scorecard metric name column and set header to none. 2) Create a new Organizer Topic. Insert a table into that Organizer. Make the headings of the table columns the date ranges that you are interested in. 3) Configure your date ranges in Organizer Topic using the Create Custom Date Range Option. 4) Add your scorecard from workbench into Organizer Topic. Click on the scorecard metric value and copy and paste it into each of the other table cells. Then click on each scorecard individually to edit which date range is applied to it: The final scorecard looks like: Thanks, Allison
• 3 replies
• 2
• 18. Hi Isaac, On version R21.0.43, you may still have to include the valuesearch(isgreaterthan(x)) syntax in your condition formulas. For your last comment, regarding isgreaterthan functions only working for scalars, the best way to handle this would be to take the difference between signals and compare that to zero, for example A is greater than B if (A-B)>0. This slight modification of Thorsten's method may work for you: Max: \$days = days() \$aMax = \$a.aggregate(maxValue(), \$days, durationKey()) \$bMax = \$b.aggregate(maxValue(), \$days, durationKey()) \$gMax = \$g.aggregate(maxValue(), \$days, durationKey()) \$hMax = \$h.aggregate(maxValue(), \$days, durationKey()) \$aIsMax = (\$aMax-\$bMax).ValueSearch(isGreaterThan(0)).intersect((\$aMax-\$gMax).valueSearch(isGreaterThan(0))).intersect((\$aMax-\$hMax).valueSearch(isGreaterThan(0))) \$bIsMax = (\$bMax-\$aMax).ValueSearch(isGreaterThan(0)).intersect((\$bMax-\$gMax).valueSearch(isGreaterThan(0))).intersect((\$bMax-\$hMax).valueSearch(isGreaterThan(0))) \$gIsMax = (\$gMax-\$bMax).ValueSearch(isGreaterThan(0)).intersect((\$gMax-\$aMax).valueSearch(isGreaterThan(0))).intersect((\$gMax-\$hMax).valueSearch(isGreaterThan(0))) \$hIsMax = (\$hMax-\$aMax).ValueSearch(isGreaterThan(0)).intersect((\$hMax-\$bMax).valueSearch(isGreaterThan(0))).intersect((\$hMax-\$gMax).valueSearch(isGreaterThan(0))) "".toSignal(1d) .splice("Area A".toSignal(1d), \$aIsMax) .splice("Area B".toSignal(1d), \$bIsMax) .splice("Area G".toSignal(1d), \$gIsMax) .splice("Area H".toSignal(1d), \$hIsMax) Min: \$days = days() \$aMin = \$a.aggregate(minValue(), \$days, durationKey()) \$bMin = \$b.aggregate(minValue(), \$days, durationKey()) \$gMin = \$g.aggregate(minValue(), \$days, durationKey()) \$hMin = \$h.aggregate(minValue(), \$days, durationKey()) \$aIsMin = (\$aMin-\$bMin).ValueSearch(isLessThan(0)).intersect((\$aMin-\$gMin).valueSearch(isLessThan(0))).intersect((\$aMin-\$hMin).valueSearch(isLessThan(0))) \$bIsMin = (\$bMin-\$aMin).ValueSearch(isLessThan(0)).intersect((\$bMin-\$gMin).valueSearch(isLessThan(0))).intersect((\$bMin-\$hMin).valueSearch(isLessThan(0))) \$gIsMin = (\$gMin-\$bMin).ValueSearch(isLessThan(0)).intersect((\$gMin-\$aMin).valueSearch(isLessThan(0))).intersect((\$gMin-\$hMin).valueSearch(isLessThan(0))) \$hIsMin = (\$hMin-\$aMin).ValueSearch(isLessThan(0)).intersect((\$hMin-\$bMin).valueSearch(isLessThan(0))).intersect((\$hMin-\$gMin).valueSearch(isLessThan(0))) "".toSignal(1d) .splice("Area A".toSignal(1d), \$aIsMin) .splice("Area B".toSignal(1d), \$bIsMin) .splice("Area G".toSignal(1d), \$gIsMin) .splice("Area H".toSignal(1d), \$hIsMin) Thanks, Allison
19. Hi Mike, After further digging internally, it seems that the desire for a simple way to calculate EWMA in Formula is a commonly requested feature request. I've raised https://seeq.atlassian.net/browse/SUP-21652 on your behalf, and linked it to the feature request so that you'll be updated as progress is made. Thanks, Allison
20. FAQ: I have various conditions that I've created and I am trying to capture the minimum value of a signal during 1 condition and the maximum value of the same signal during another condition. I want these values displayed in a scorecard where the headers are the exact time stamps when the max or min value occurred. Solution: Let's take an example where we have two conditions for when a signal is increasing in value and when a signal is decreasing in value. We want to know the max ROC during the time periods when the signal is increasing, the min ROC when the signal is decreasing and I want them all summarized in a single scorecard metric for "max ROC". 1) Begin with the signals of interest in the display pane and conditions of interest identified. In this case we have a temperature signal, its derivative, and two conditions for when the temperature signal is increasing or decreasing in value. 2) We can use Signal from Condition to calculate the maximum ROC during each increasing time period. Make sure to specify that the time stamp of the statistic be placed at the point of max value. This will be important for displaying an accurate time header in our scorecard. 3) Use Signal from Condition again to calculate the min ROC during the decreasing time periods. This time place the time stamp of the statistic at the point of min value. 4) Use the CombineWith function in Formula to create a new signal combined of the min and max ROC value signals. 5) Use Formula to create a new condition comprised of tiny capsules for each data point in your combined min and max condition. This is done by doing a value search for when the combined ROC signal has valid data. You will notice that these capsules are so short in length that they do not render in the display pane, but you can see their start and end times, as well as the value of the combined signal during each event in the capsules pane. 6) Now switch to Scorecard view and pull the value of the combined min/max ROC signal into a condition based scorecard during the condition for when that signal has valid data. There is no need to calculate a statistic, as there is only one sample during each of these capsules. Adjust the date headers in the scorecard to display only the start or end time (as they are the same).
• 2
• • 22. Thanks Mike! What range of values would you typically expect for the Δt/tau parameter? I'm mocking up an example for this and was originally treating tau as the duration of the entire time period of interest (which I now know to be incorrect), which was resulting in Δt/tau in the range of 0-1 and Gamma in the range of 0 - -e. I'm thinking actual values of Δt/tau may be >1? Thanks, Allison
23. Hi Mike, I have a couple of questions as I am working on a solution to your problem. 1) I'd like to get a better idea of how you defined your initialized value of EWMA in Excel. You likely still had to assume some first value of the EWMA, even if it was just the value of the the parameter at the start time of the data pull. 2) I'm also curious if the Gamma value is also actually changing with time over the period of interest (so there would be Gamman, Gamman-1). My impression of your Δt/tau parameter was that the tau portion would represent the progress through the period of interest (a value between 0 and 1) and therefore be changing over time causing gamma to change over time. Please correct me if that is an incorrect assumption. Thanks! Allison
• 