Writing the recurrence $O_t=-\frac1{T_w}\sum_{i=t-T_p}^{t-1}O_i-\frac1{T_i}\sum_{i=1}^{t-T_p-1}O_i+B_t$ in terms of its initial value I want to write the following solely in terms of its initial value $O_1$
$$ 
 O_t = -  \frac{1}{T_w}  \sum_{i=t-T_p}^{t-1} O_{i} 
 - \frac{1}{T_i}     \sum_{i=1}^{t-T_p-1} O_i
 + B_t  
 $$
where

*

*$T_w , T_i$ are non zero constants

*$T_p$ is positive integer

*$B_t$ is some function of t

*Define $O_i = 0  ,  \; B_i = 0\quad \forall \; i < 1$
I'd expanded the first 3 terms in order to find pattern , we may compare the blue terms .
I found a pattern , like the coefficients have the form $a_{n+1} = a_n + a_n^2 $ but I don't have a close form for it . Furthermore , there seems to be other patterns as well .

Context : above is actually a model for supply chain , with $\frac{1}{T_w} ,\frac{1}{T_i}  $ as proportional gain (they are 2 indepedent feedback controllers) , you don't see the error because I've already simplified the expression . I want to do this because I do have the  analytic expressions for $O_1$ , so this is the first step to prepare for optimization .

Hint.
Considering first $T_p = 3$ from
$$
\left\{
\begin{array}{rcl}
 \frac{o_0+o_1+o_2}{T_w}+o_3 &=& b_3 \\
 \frac{o_1+o_2+o_3}{T_w}+o_4&=&b_4 \\
 \frac{o_1}{T_i}+\frac{o_2+o_3+o_4}{T_w}+o_5 &=& b_5\\
 \frac{o_1+o_2}{T_i}+\frac{o_3+o_4+o_5}{T_w}+o_6 &=& b_6\\
\end{array}
\right.
$$
we can represent a matrix formula as
$$
M_1 O_{t+T_p} + M_2O_t=B_{t+T_p} 
$$
with
$$
\cases{
O_t = (o_{-1},o_0,o_1,o_2)^T\\
M_1 = \left(
\begin{array}{cccc}
 1 & 0 & 0 & 0 \\
 \frac{1}{T_w} & 1 & 0 & 0 \\
 \frac{1}{T_w} & \frac{1}{T_w} & 1 & 0 \\
 \frac{1}{T_w} & \frac{1}{T_w} & \frac{1}{T_w} & 1 \\
\end{array}
\right)\\
M_2 = \left(
\begin{array}{cccc}
 0 & \frac{1}{T_w} & \frac{1}{T_w} & \frac{1}{T_w} \\
 0 & 0 & \frac{1}{T_w} & \frac{1}{T_w} \\
 0 & 0 & \frac{1}{T_i} & \frac{1}{T_w} \\
 0 & 0 & \frac{1}{T_i} & \frac{1}{T_i} \\
\end{array}
\right)
}
$$
and as $M_1$ is invertible we have
$$
O_{t+T_p} + M_1^{-1}M_2O_t=M_1^{-1}B_{t+T_p} 
$$
NOTE
$$
M_1^{-1} = \left(
\begin{array}{cccc}
 1 & 0 & 0 & 0 \\
 -\frac{1}{T_w} & 1 & 0 & 0 \\
 \frac{1-T_w}{T_w^2} & -\frac{1}{T_w} & 1 & 0 \\
 -\frac{(T_w-1)^2}{T_w^3} & \frac{1-T_w}{T_w^2} & -\frac{1}{T_w} & 1 \\
\end{array}
\right)
$$
now assuming $O_t = 0$ we have
$$
O_{t+T_p} = \left(
\begin{array}{c}
 b_3 \\
 b_4-\frac{b_3}{T_w} \\
 b_5+\frac{b_3 (1-T_w)}{T_w^2}-\frac{b_4}{T_w} \\
 b_6-\frac{b_3 (T_w-1)^2}{T_w^3}+\frac{b_4 (1-T_w)}{T_w^2}-\frac{b_5}{T_w} \\
\end{array}
\right)
$$
