Jump to content
  • To Search the Seeq Knowledgebase:

    button_seeq-knowledgebase.png.ec0acc75c6f5b14c9e2e09a6e4fc8d12.png.4643472239090d47c54cbcd358bd485f.png

Search the Community

Showing results for tags 'delay'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Community Technical Forums
    • Tips & Tricks
    • General Seeq Discussions
    • Seeq Data Lab
    • Seeq Developer Club
    • Seeq Admin Forum
    • Feature Requests

Categories

  • Seeq FAQs
  • Online Manual
    • General Information

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Company


Title


Level of Seeq User

Found 5 results

  1. There are times when you may need to calculate a standard deviation across a time-range using the data within a number of signals. Consider the below example. When a calculation like this is meaningful/important, the straightforward options in Seeq may not be mathematically representative to calculate a comprehensive standard deviation. These straightforward options include: Take a daily standard deviation for each signal, then average these standard deviations Take a daily standard deviation for each signal, then take the standard deviation of the standard deviations Create a real-time standard deviation signal (using stddev($signal1, $signal2, ... , $signalN)), then take the daily average or standard deviation of this signal While straightforward options may be OK for many statistics (max of maxes, average of averages, sum of totalizes, etc), a time-weighted standard deviation across multiple signals presents an interesting challenge. This post will detail methods to achieve this type of calculation by time-warping the data from each signal then combining each individually warped signal into a single signal. Similar methods are also discussed in the following two seeq.org posts: Two different methods to arrive at the same outcome will be explored. Both of these methods share the same Step 1 & 2. Step 1: Gather Signals of Interest This example will consider 4 signals. The same methods can be used for more signals, but note that implementing this solution programmatically via Data Lab may be more efficient when considering a high number of signals (>20-30). Step 2: Create Important Scalar Constants and Condition Number of Signals: The number of signals to be considered. 4 in this case. Un-Warped Interval: The interval you are interested in calculating a standard deviation (I am interested in a Daily standard deviation, so I entered 1d) Warped Interval: A ratio calculation of Un-Warped Interval / Number of Signals. This metric is detailing what the new time-range will be for the time-warped signals. I.e. given I have 4 signals considering a days worth of data of, each signal's day worth of data will be warped into 6 hour intervals Un-Warped Periods: This creates a condition with capsules spanning the original periods of interest. periods($unwarped_interval) Method 1: Create ONE Time-Shift Signal, and move output Warped Signals The Time Shift Signal will be used as a counter to condense the data in the period of interest (1 day for this example) down to the warped interval (6 hours for this example). 0-timeSince($unwarped_period, 1s)*(1-1/$num_of_signals) The next step is to use this Time Shift Signal to move the data within each signal. Note there is an integer in this Formula that steps with each signal applied to. Details can be viewed in the screenshots. $area_a.move($time_shift_signal, $unwarped_interval).setMaxInterpolation($warped_interval).move(0*$warped_interval) The last step is to combine each of these warped signals together. We now have a Combined Output that can be used as an input into a Daily Standard Deviation that will represent the time-weighted standard deviation across all 4 signals within that day. Method 2: Create a Time-Shift Signal per each Signal - No Need to move output Warped Signals This method takes advantage of 4 time-shift signals, one per signal. Note there is also an integer in this Formula that steps with each signal applied to. Details can be viewed in the screenshot. These signals take care of the data placement, where-as the data placement was taken care of using .move(N*$warped_interval) above. 0*$warped_interval-timeSince($unwarped_period, 1s)*(1-1/$num_of_signals) We can then follow Method 1 to use the time shift signals to arrange our signals. We just need to be careful to use each time shift signal, as opposed to the single time shift signal that was created in Method 1. As mentioned above, there is no longer a .move(N*$warped_interval) needed at the end of this formula. The last step is to combine each of these warped signals together, similar to Method 1. $area_a.move($time_shift_1, $unwarped_interval).setMaxInterpolation($warped_interval) Comparing Method 1 and Method 2 & Calculation Outputs The below screenshot shows how Methods 1 & 2 arrive at the same output Note the difference in calculated values. The Methods reviewed in this post most closely capture the true time-weighted standard deviation per day across the 4 signals. Caveats and Final Thoughts While this method is still the most mathematically correct, there is a slight loss in data at the edges. When combining the data in the final step, the beginning of $signal_2 falls at the end of $signal_1, and so on. There are some methods that could possibly address this, but this loss in samples should be negligible to the overall standard deviation calculation. This method is also heavy on processing, especially depending on the input signals' data resolution and as the overall number of signals being considered increases. It is most ideal to use this method if real-time results are not of high importance, and better fitting if the calculation outputs are input in an Organizer that displays the previous day's/week's/etc results.
  2. 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:
  3. Use Case Background In certain use cases, it can be advantageous to move data forward or back in time. You may move signals as part of a data cleansing step in a cause and effect analysis, prior to performing a regression, or simply as a more intuitive visualization. Here are some specific examples where this might be useful: Comparing a process variable to a process setpoint when the process variable lags the setpoint. Aligning inputs and outputs in unit operations where there is a known lag or residence time: In a plug flow reactor analysis, you may want to line up the outlet flow rate with the inlet flow rates after a known residence time. In a conveyor belt analysis, you may want to compare a widget created with an input variable upstream. Aligning lab data with process data. Moving a signal in time is easily accomplished in Seeq using the Formula tool and the function .move() Moving a signal forward in time 1. Search and select the relevant signal in the data tab and click to add it to the trend. 2. In the Tools tab, select the Formula tool. 3. Give the formula an appropriate name and enter the following formula. Make sure to match the variable name in the formula tool. Here, $cp represents the Compressor Power signal I want to move. $cp.move(3h) 4. Execute the formula. You will now have a new signal where the data is shifted forward in time. Moving a signal back (earlier) in time Follow steps 1-4 above, but in step 3, use a negative sign to indicate moving the signal earlier. $cp.move(-3h) Moving a signal by the value of another signal Example use case: Oftentimes, lab data is associated with the time the lab technician completed the test and recorded the results instead of the time when the sample was obtained from the process, which could be hours or days earlier. In order to do a root cause analysis, it would be useful if the quality results lined up with when the sample was obtained. The data could be moved using a static value, like the examples above, but if there is relevant data that can be used to dynamically shift the time period based on when the sample was actually taken, that may be more accurate and useful. In this case, $labData is the lab result with the original timestamp, and $lagTime is the difference in time from when the sample is taken and when the sample result is recorded. By inputting this into the .move() function we can dynamically move the quality data to line up with the actual process conditions using the formula below. To do this, follow steps 1-4 above, but in step 3, use another signal as your first formula parameter and the second parameter representing the maximum you want to move any given sample. $labData.move($lagTime, 5min) In the above example, $labData will be moved by the value indicated in $lagTime, up to 5 minutes, the maximum any sample will be moved. Content Verified DEC2023
  4. To better understand their process, users often want to compare time-series signals in a dimension other than time. For example, seeing how the temperature within a reactor changes as a function of distance. Seeq is built to compare data against time but this method highlights how we can use time to mimic an alternate dimension. Step 1: Sample Alignment In order to accurately mimic the alternate dimension, the samples to be included in each profile must occur at the same time. This can be achieved through a couple methods in Seeq if the samples don't already align. Option 1: Re-sampling Re-sampling selects points along a signal at select intervals. You can also re-sample based on another signal's keys. Since its possible for there not to be a sample at that select interval, the interpolated value is chosen. An example Formula demonstrating how to use the function is shown below. //Function to resample a signal $signal.resample(5sec) Option 2: Average Aggregation Aggregating allows users to determine the average of a signal over a given period of time and then place this average at a specific point within that period. Signal From condition can be used to find the average over a period and place this average at a specific timestamp within the period. In the example below, the sample is placed at the start but alignment will occur if the samples are placed at the middle or end as well. Step 2: Delay Samples In Formula, apply a delay to the samples of the signal that represents their value in the alternative dimension. For example, if a signal occurs at 6 feet from the start of a reactor, delay it by 6. If there is not a signal with a 0 value in the alternate dimension, the final graph will be offset by the smallest value in the alternate dimension. To fix this, in Formula create a placeholder signal such as 0 and ensure its samples align with the other samples using the code listed below. This placeholder would serve as a signal delayed by 0, meaning it would have a value of 0 in the alternate dimension. //Substitute Period_of_Time_for_Alignment with the period used above for aligning your samples 0.toSignal(Period_of_Time_for_Alignment) Note: Choosing the unit of the delay depends upon the new sampling frequency of your aligned signals as well as the largest value you will have in the alternative dimension. For example, if your samples occur every 5 minutes, you should choose a unit where your maximum delay is not greater than 5 minutes. Please refer to the table below for selecting units Largest Value in Alternate Dimension Highest Possible Delay Unit 23 Hour, Hour (24 Hour Clock) 59 Minute 99 Centisecond 999 Millisecond Step 3: Develop Sample Profiles Use the Formula listed below to create a new signal that joins the samples from your separate signals into a new signal. Replace "Max_Interpolation" with a number large enough to connect the samples within a profile, but small enough to not connect the separate profiles. For example, if the signals were re-sampled every 5 minutes but the largest delay applied was 60 seconds, any value below 4 minutes would work for the Max_Interpolation. This is meant to ensure the last sample within a profile does not interpolate to the first sample of the next profile. //Make signals into discrete to only get raw samples, and then use combineWith and toLinear to combine the signals while maintaining their uniqueness combineWith($signal1.toDiscrete() , $signal2.toDiscrete() , $signal3.toDiscrete()).toLinear(Max_Interpolation) Step 4: Condition Highlighting Profiles Create a condition in Formula for each instance of this new signal using the formula below. The isValid() function was introduced in Seeq version 44. For versions 41 to 43, you can use .valueSearch(isValid()). Versions prior to 41 can use .validityCapsules() //Develop capsule highlighting the profile to leverage other views based on capsules to compare profiles $sample_profiles.isValid() Step 5: Comparing Profiles Now with a condition highlighting each profile, Seeq views built around conditions can be used. Chain View can be used to compare the profiles side by side while Capsule View can overlay these profiles. Since we delayed our samples before, we are able to look at their relative times and use that to represent the alternate dimension. Further Applications With these profiles now available in Seeq, all of the tools available in Seeq can be used to gain more insight from these examples. Below are a few examples. Comparing profiles against a golden profile Determine at what value in the alternate dimension does each profile reach a threshold Developing a soft sensor based on another sensor and a calibration curve profile Example Use Cases Assess rotating equipment performance based on OEM curve regressions that vary based on equipment speed due to a VFD (alternate dimension = speed) Monitor distillation cut points based on distillation lab data (alternate dimension = lab standard, boil % in this case) Observe temperature profile along a reactor or well (alternate dimension = distance, length and depth in these cases)
  5. Hi All, I'm working on some data , wherein i have 6 Independent variable and 1 dependent variable. while running the Regression model on this data, i get very less Accuracy of model as mentioned in below screenshot. Note :- As far as data Pre-processing is concern , i have scale the features and also imputes the missing values on the basis of mean imputation. Do let me know if there's any pre-processing feature is there in seek to deal with data. Regards, JItesh Vachheta
×
×
  • Create New...