# guide Identifying Patterns in Discrete Sequences of Events

## Recommended Posts

Use case:

A piece of equipment has a start-up sequence in which it goes through different discrete states sequentially before completing the sequence and reaching steady state. When the equipment is off, the state is 0. When the equipment enters the start-up sequence it cycles through states 1-6 in the pattern "1-2-3-4-5-6". A successful start-up sequence will have all 6 states in the pattern "1-2-3-4-5-6." If a disruption occurs at any point in the start-up sequence the state number will read as state 7, thus a failed start-up sequence could have the pattern "1-7", "1-2-7", "1-2-3-7", etc. This use case describes methods to identify only the successful start-up sequences.

Approach 1: If the signal for the state is numeric (e.g. with discrete numeric values of 0-7)

1. Create a new signal that is the running delta of the STATENUMBER signal. Use Seeq Formula and syntax: \$statenumbersignal.runningDelta()

2. Create a new condition for all start-up sequences using value search for when the runningDelta signal just created is greater than or equal to zero.

3. Calculate the delta in your STATENUMBER signal over each start-up sequence. This value should always be equal to 6 or 7 as the sequence will either complete successfully (go to 6) or fail and end with a value of 7. Use the signal from condition tool to calculate this.

4. Create a new condition for when this delta in the STATENUMBER signal just created is equal to 6. This must be done in Seeq formula (there is a known issue in using value search for this operation) with the following syntax: \$deltaInSTATENUMBERsignal.valueSearch(isEqualTo(6))

Approach 2: If the signal for the state is a string that is easily convertible to a numeric signal.

This example is a string with discrete values "STAGE0", "STAGE6", etc.

1. In Seeq formula, use the replace() function with the following syntax: \$StringSignalForStateNumber.replace('STATE','')

2. In a new Seeq Formula Window apply the toNumber() function to the signal created in step 1 with the following syntax: \$SignalFromStep1.toNumber() - this will create a numeric signal with discrete values of 0-7.

Approach 3: If the signal for the state is a string value, not easily converted to a numeric signal or if you wish to proceed using the string signal.

1. Use Value Search to identify STATE6

2. Use Value Search to identify STATE7

3. Use Composite Condition (union operator) to create a combined condition "finalStateinSequence" for the final state in sequence, either STATE6 or STATE7.

4. Use formula to create a condition for all start-up sequences (successful and failed). Syntax: \$FinalStateInSequence.inverse().move(0,1h)
This formula code is identifying all of the time when the final state in sequence condition is not true and extending those capsules by a short amount of time so that the final state value is contained within the "all start-up sequences" capsules.

5. Use Signal from Condition to identify the ending STATENUMBER value for each of the start-up sequences.

6. Identify your successful start-up sequences by doing a valueSearch in Formula to identify when the ending STATENUMBER is equal to STATE7. Formula syntax: \$endingSTATENUMBERsignal.valueSearch(isEqualTo("STATE7"))

Content Verified DEC2023

• 1