Periodic or non periodic function plotting

307 Views Asked by At

I am currently working on plotting a function and figuring out if its periodic or not. The function is as follows:$$x_n=\beta\cdot x_{n-1}+\alpha\gamma\cdot\operatorname{sgn}(x_{n-3})+\alpha(1-\gamma)\cdot\operatorname{sgn}(x_{n-2})$$ I know $0<\beta<1$, $\alpha<0$, $0<\gamma<1$. Note that $\operatorname{sgn}$ is the sign function.

I have created an app on MATLAB which helps me figure out if it is periodic or not depending on the three initial values I start with. I have noticed that it can be $1$, $3$ or $4$-periodic so far.

I am having a hard time figuring out how to write this mathematically. I am trying to find a negative delay. Any hints or sources that I can use would be really appreciated.

2

There are 2 best solutions below

9
On BEST ANSWER

$\DeclareMathOperator{\sgn}{sgn}$In this answer it is always assumed that $0 < β, γ < 1$ and $α \in \mathbb{R}^*$.


Define $ε_n = \sgn(x_n)$ for $n \geqslant 1$, then the recurrence relation becomes$$ x_n = βx_{n - 1} + α(1 - γ) ε_{n - 2} + αγ ε_{n - 3} $$ and it can be proved by induction that$$ x_n = β^{n - 3} x_3 + α(1 - γ) \sum_{k = 2}^{n - 2} β^{n - k - 2} ε_k + αγ \sum_{k = 1}^{n - 3} β^{n - k - 3} ε_k. \quad \forall n \geqslant 3 $$ Next assume that $N$ is a period of the sequence $\{x_n\}$, then\begin{gather*} x_3 = x_{N + 3} = β^N x_3 + α(1 - γ) \sum_{k = 2}^{N + 1} β^{N - k + 1} ε_k + αγ \sum_{k = 1}^N β^{N - k} ε_k\\ \Longleftrightarrow x_3 = \frac{α}{1 - β^N} \left( (1 - γ) \sum_{k = 2}^{N + 1} β^{N - k + 1} ε_k + γ \sum_{k = 1}^N β^{N - k} ε_k \right), \end{gather*} where $ε_{N + 1} = ε_1$. For general $m \geqslant 0$, define $x'_n = x_{n + m}$ and $ε'_n = ε_{n + m}$ for $n \geqslant 1$, analogous derivation shows that$$ x_{m + 3} = x'_3 = \frac{α}{1 - β^N} \left( (1 - γ) \sum_{k = 2}^{N + 1} β^{N - k + 1} ε'_k + γ \sum_{k = 1}^N β^{N - k} ε'_k \right), $$ i.e.$$ x_n = \frac{α}{1 - β^N} \left( (1 - γ) \sum_{k = 2}^{N + 1} β^{N - k + 1} ε_{n + k - 3} + γ \sum_{k = 1}^N β^{N - k} ε_{n + k - 3} \right), \quad \forall n \geqslant 3 \tag{1} $$ where $ε_{N + k} = ε_k$ for $k \geqslant 1$.

Remark: (1) implies that if $N'$ is a period of $\{ε_n\}$, it is also a period of $\{x_n\}$.

Therefore, on the one hand, sequence $\{x_n\}$ can be completely recovered by $ε_1, \cdots, ε_N$. On the other hand, for arbitrary $N \geqslant 1$ and $ε_1, \cdots, ε_N \in \{-1, 0, 1\}$, it suffices to check whether $ε_n = \sgn(x_n)$ holds for $1 \leqslant n \leqslant N$, where $x_1 = x_{N + 1}$, $x_2 = x_{N + 2}$, and $x_n$ ($n \geqslant 3$) is given by (1) .


Now consider the case in which $ε_n ≠ 0$ for any $n \geqslant 1$. For $n \geqslant 3$, since $ε_{N + n - 2} = ε_{n - 2}$, then by (1), $ε_n = \sgn(x_n)$ is equivalent to$$ ε_n = \sgn(α) · \sgn\left( ((1 - γ) + β^{N - 1} γ) ε_{n - 2} + ((1 - γ)β + γ) \sum_{k = 2}^N β^{N - k} ε_{n + k - 3} \right). \tag{2} $$ Note that $(1 - γ) + β^{N - 1} γ > 0$, $(1 - γ)β + γ > 0$, and$$ (1 - γ) + β^{N - 1} γ > ((1 - γ)β + γ) \sum_{k = 2}^N β^{N - k} \Longleftrightarrow γ < \frac{1 - 2β + β^N}{2(1 - β)(1 - β^{N - 1})}. $$ If $γ < \dfrac{1 - 2β + β^N}{2(1 - β)(1 - β^{N - 1})}$, or in particular $β < \dfrac{1}{2}$ and $γ \leqslant \dfrac{1 - 2β}{2(1 - β)}$, then (2) is equivalent to$$ ε_n = \sgn(α) · ε_{n - 2}. \tag{3} $$

To simplify the discussion below, define shift operator $s_m$ for $m \geqslant 1$ and reversion operator $r$ as $s_m(x)_n = x_{n + m}$ and $r(x)_n = -x_n$ for all $n \geqslant 1$.

Case 1.1: $α > 0$. Now (3) becomes $ε_n = ε_{n - 2}$ for all $n \geqslant 3$.

  • If $(ε_1, ε_2) = (1, 1)$, then $x_n = \dfrac{α}{1 - β}$ for all $n \geqslant 1$.
  • If $(ε_1, ε_2) = (1, -1)$, then $x_{2n - 1} = -x_{2n} = \dfrac{α(1 - 2γ)}{1 + β}$ for all $n \geqslant 1$.
  • If $(ε_1, ε_2) = (-1, 1)$, then $x_{2n - 1} = -x_{2n} = -\dfrac{α(1 - 2γ)}{1 + β}$ for all $n \geqslant 1$.
  • If $(ε_1, ε_2) = (-1, -1)$, then $x_n = -\dfrac{α}{1 - β}$ for all $n \geqslant 1$.

Case 1.2: $α < 0$. Now (3) becomes $ε_n = -ε_{n - 2}$ for all $n \geqslant 3$. Note that all the four possibilities of $(ε_1, ε_2)$ can be generated by the case in which $(ε_1, ε_2) = (1, 1)$ with shift operators and reversion operators. Thus it suffices to consider the case in which $(ε_1, ε_2) = (1, 1)$, then for all $n \geqslant 1$,$$ x_{4n - 3} = -x_{4n - 1} = -\frac{α}{1 + β^2} (1 - β - 2γ),\\ x_{4n - 2} = -x_{4n} = -\frac{α}{1 + β^2} (1 + β - 2βγ). $$

Analogously, by singling out $ε_{n - 3}$ instead of $ε_{n - 2}$ in (2), it can be proved that if $γ > \dfrac{1 - 2β + 2β^2 - β^N}{2(1 - β)^2}$, or in particular $β < \dfrac{1}{2}$ and $γ \geqslant \dfrac{1 - 2β + 2β^2}{2(1 - β)^2}$, then (2) is equivalent to$$ ε_n = \sgn(α) · ε_{n - 3}. \tag{4} $$

Case 2.1: $α > 0$. Now (4) becomes $ε_n = ε_{n - 3}$ for all $n \geqslant 4$. In the eight possibilities of $(ε_1, ε_2, ε_3)$, $(ε_1, ε_2, ε_3) = (1, 1, 1)$ and $(ε_1, ε_2, ε_3) = (-1, -1, -1)$ yield a constant sequence by the remark above, and all the rest can be generated by the case in which $(ε_1, ε_2, ε_3) = (1, 1, -1)$ with shift operators and reversion operators. Thus it suffices to consider the case in which $(ε_1, ε_2, ε_3) = (1, 1, -1)$, then for all $n \geqslant 1$,$$ x_{3n - 2} = \frac{α}{1 - β^3} (1 + β - β^2 - 2(β - β^2)γ),\\ x_{3n - 1} = \frac{α}{1 - β^3} (2(1 - β^2)γ - 1 + β + β^2),\\ x_{3n} = -\frac{α}{1 - β^3} (2(1 - β)γ - 1 + β - β^2). $$

Case 2.2: $α < 0$. Now (4) becomes $ε_n = -ε_{n - 3}$ for all $n \geqslant 4$. In the eight possibilities of $(ε_1, ε_2, ε_3)$, $(ε_1, ε_2, ε_3) = (1, -1, 1)$ and $(ε_1, ε_2, ε_3) = (-1, 1, -1)$ yield a sequence of period $2$ by the remark above, which is the same as the ones in case 1.1, and all the rest can be generated by the case in which $(ε_1, ε_2, ε_3) = (1, 1, 1)$ with shift operators and reversion operators. Thus it suffices to consider the case in which $(ε_1, ε_2, ε_3) = (1, 1, -1)$, then for all $n \geqslant 1$,$$ x_{6n - 5} = -x_{6n - 2} = -\frac{α}{1 + β^3} (1 + β - β^2 - 2βγ),\\ x_{6n - 4} = -x_{6n - 1} = -\frac{α}{1 + β^3} (1 + β + β^2 - 2β^2 γ),\\ x_{6n - 3} = -x_{6n} = -\frac{α}{1 + β^3} (-1 + β + β^2 + 2γ). $$

It can be verified that the sequences in case 1.1 to case 2.2 indeed satisfy the given recurrence relation.

6
On

Calling

$$\delta(u,v)=\alpha(1-\gamma)\mbox{sign}(u)+\alpha\gamma \mbox{sign}(v) $$

we have

$$ \min_{u,v}\delta(u,v) \le \alpha(1-\gamma)\mbox{sign}(x_{n-2})+\alpha\gamma \mbox{sign}(x_{n-3})\le \max_{u,v}\delta(u,v) $$

and the recurrences

$$ x_n^i = \beta x_{n-1}^i+\min_{u,v}\delta(u,v)\\ x_n^s = \beta x_{n-1}^s+\max_{u,v}\delta(u,v)\\ $$

have the solutions

$$ x_n^i = C_0 \beta^{n-1}+\frac{(1-\beta^n)}{\beta-1}\min_{u,v}\delta(u,v)\\ x_n^s = C_0 \beta^{n-1}+\frac{(1-\beta^n)}{\beta-1}\max_{u,v}\delta(u,v)\\ $$

and after a little transient

$$ x_n^i \le x_n\le x_n^s $$

Attached the plot for $x_n^i, x_n^s$ in red and $x_n$ in blue. Note that the recurrences $x_n^i, x_n^s$ should begin at $x_3$. The values assumed are $\alpha=-3,\beta = 0.25, \gamma = 0.75$ and the initial conditions $x_1,x_2,x_3$ are random values in the range $(-10, 10)$

enter image description here

NOTE

Due to the structure

$$ x_n = \beta x_{n-1}+\cdots $$

there is an exponential component all along $n\to\infty$ which eliminates the periodic behavior possibility.

If instead we consider the recurrence

$$ x_n = \alpha(1-\gamma)\mbox{sign}(x_{n-2})+\alpha\gamma \mbox{sign}(x_{n-3}) $$

with $\beta = 0$ then periodic solutions can appear when the initial conditions $x_1, x_2, x_3$ have different signs as for instance $x_1=1,x_2 = -1, x_3 = 0$

enter image description here

or $x_1=1,x_2 = -1, x_3 = 1$

enter image description here

To solve

$$ z_n = \beta z_{n-1}+\alpha(1-\gamma)+\alpha\gamma $$

which is a linear recurrence we use the fact

$$ z_n = z_n^h+z_n^p\\ z_n^h -\beta z_{n-1}^h = 0\\ z_n^p -\beta z_{n-1}^p=\alpha(1-\gamma)+\alpha\gamma $$

then easily we find $z_n^h = C\beta^{n-1}$. Now considering $z_n^p = C_n\beta^{n-1}$ and substituting into the particular we can find also the recurrence for $C_n$ which is

$$ C_n-C_{n-1} = \alpha\beta^{1-n} $$

with solution

$$ C_n = \frac{\alpha \beta \left(1-\beta ^{-n}\right)}{\beta -1} $$

and finally

$$ z_n = C\beta^{n-1}+ \frac{\alpha \beta \left(1-\beta ^{-n}\right)}{\beta -1}\beta^{n-1}=C \beta^{n-1}+\frac{\alpha(1-\beta^n)}{\beta-1} $$

The general solution can be computed with the help of the following MATHEMATICA script

x2 = 2; x3 = 3; x1 = 1;
path = {x1, x2, x3};
beta = 0.5; alpha = 10; gamma = 3;
For[i = 1, i <= 30, i++, x4 = beta x3 + alpha (1 - gamma) Sign[x2] + alpha gamma Sign[x1]; 
AppendTo[path, x4]; x1 = x2; x2 = x3; x3 = x4]

ListPlot[path, PlotRange -> All]