Is it possible to find fluctuations in a list, such that ones graph reaches a certain peak, it will start fluctuating between two values that are unknown.
I was considering to focus on all the numbers above the threshold
I've wrote bit of python code to simulate this issues. The graph firstly increases to n value and it will fluctuate between two values m and k.

Background:
The code is simulating a compartmental SIS model on a temporal network. That is each node of that is in one of the compartments (Susceptible - Infected - Susceptible). The infection spreads by each infected node tryign to infect neighbouring node with probability
and recover with probability
at each time step.
The infection will die out if it's below the threshold
where
.
So what the code does, it runs in a while(True) loop checking if the infection dies out, and if it is above the coverage of infected is 40%. Between those two if statements, the infection goes into a steady state, that is it's above the threshold but below 40% coverage, and it fluctuates for infinite amount of time. I'm trying to find a way to find those fluctuations in a list.
The code for simulating this situation (the graph):
import random
import numpy as np
import matplotlib.pyplot as plt
n = 10
m = 11
k = 17
a = np.arange(0, n, 1)
a = np.asarray(a)
for i in range(100):
a = np.append(a, random.randint(m, k))
plt.plot(a)
plt.show()
