I’m quite new to the forum and to optimisation, so my apologies if the question is trivial or in the wrong section. I've rewittren the question to clarify my doubt (I was previously writing from an iPad and now I'm using my laptop, I hope it helps).
The problem I'm trying to solve is to estimate the matrices $A$ and $B$ of a linear system
$$ x(k+1) = A x(k) + B u(k) $$ using a moving horizon estimation (MHE) approach. The MHE formulation is given by $$ \begin{align} \min_{\hat{A},\hat{B}} \quad & \sum_{i=k-N+1}^{k} (x_i - x_{i\mid k})^T Q (x_i - x_{i\mid k}) \\ s.t. \quad & x_{i+1 \mid k} = \hat{A} x_i + \hat{B} u_i \\ & (\hat{A},\hat{B}) \in \mathcal{M} \end{align} $$
where $x_i \in \mathbb{R}^n$ and $u_i \in \mathbb{R}^p$ are measured states and inputs, $\hat{A} \in \mathbb{R}^{n \times n}$ and $\hat{B} \in \mathbb{R}^{n \times p}$ are the estimated dynamics, $x_{i \mid k} \in \mathbb{R}^n$ is the estimate of $x_i$ made at time $k$, $N$ is the estimation horizon, $k$ is the current time instant, $Q$ is a positive definite matrix, and $\mathcal{M}$ defines upper and lower bounds on each element of $\hat{A}$ and $\hat{B}$.
Replacing the dynamic equation constraint into the objective, this problem can be rewritten as $$ \begin{align} \min_{\hat{A},\hat{B}} \quad & \begin{bmatrix} (x_{k-N+1} - \hat{A} x_{k-N} + \hat{B} u_{k-N}) \\ \vdots \\ (x_{k} - \hat{A} x_{k-1} + \hat{B} u_{k-1}) \end{bmatrix}^T \begin{bmatrix} Q & & 0 \\ & \ddots & \\ 0 & & Q \end{bmatrix} \begin{bmatrix} (x_{k-N+1} - \hat{A} x_{k-N} + \hat{B} u_{k-N}) \\ \vdots \\ (x_{k} - \hat{A} x_{k-1} + \hat{B} u_{k-1}) \end{bmatrix} \\ s.t. \quad & (\hat{A},\hat{B}) \in \mathcal{M} \end{align} $$
I've been trying to play around with this formulation to test different manners to achieve a traditionnal quadratic programming objective (i.e. $\frac{1}{2} X^T H X + f^T X + M$) in which my variable is the estimate of the matrices. My objective is to able to use this formulation to verify whether my past measurement data allows for the unique identification of the system (i.e., the resulting optimisation problem has a unique solution). The approach that I'm using rewrites the dynamics as
$$ x^T_{k+1 \mid k} = \begin{bmatrix} x^T_{k} & u^T_{k} \end{bmatrix} \begin{bmatrix} \hat{A}^T \\ \hat{B}^T \end{bmatrix} $$
which allows to rewrite the optimisation as
$$ \begin{align} \min_{\theta}. \quad & F^T \theta^T \tilde{Q} \theta F - 2YQ \theta F +Y^T Q Y \quad \\ s.t. \quad & \theta \in M \end{align} $$
where
$$ \theta = \begin{bmatrix} \hat{A}^T \\ \hat{B}^T \end{bmatrix} \\ F = \begin{bmatrix} x_{k-N} & u_{k-N} \\ \vdots & \vdots \\ x_{k-1} & u_{k-1} \end{bmatrix} \\ Y = \begin{bmatrix} x_{k-N+1} \\ \vdots \\ x_{k} \end{bmatrix} \\ \tilde{Q} = \begin{bmatrix} Q & & 0 \\ & \ddots & \\ 0 & & Q \end{bmatrix} $$
$\theta$ is a $(n+p) \times n$ matrix, $\tilde{Q}$ is positive definite and $F$ is a $N \times (n+p)$ matrix, with $N \geq n+p$.
The structure resembles a conventional quadratic optimisation. My problem is that the variable I’m trying to optimise is multiplied by a (known) matrix on the outside, and therefore the problem cannot be directly solved using a quadratic solver. I tried to google this problem, as I imagine it is probably not uncommon and can be dealt with in a simple way, but I couldn’t find anything (I imagine I was not searching for the correct terms).
Is there a way to convert this problem into a traditional quadratic optimisation?