I'm trying to determine the performance index for the system $$\dot{\bf x} = UA{\bf x},$$ where I want to minimize the velocity of the dynamical system where each agent in the system comes to a predetermined consensus at time $T$. (Here, ${\bf x}$ is the position vector, $U$ is a control matrix, and $A$ is a constant matrix). Things I know for certain: both the initial and final velocities of the system are $\bf 0$. I set up and wanted to try to minimize the performance index: $$J = \int_0^T\left[{1\over2}\|\dot{\bf x}\|^2 - \lambda^T(UA{\bf x} - \dot {\bf x})\right]\,dt$$I'm trying to take the derivative of $$H = {1\over2}\|\dot{\bf x}\|^2 - \lambda^TUA{\bf x}$$ with respect to the vector ${\bf x}$.
Here's what I did so far:
$$\begin{align*}{\partial H\over\partial {\bf x}} &= {1\over2}{\partial\over\partial {\bf x}}(\dot {\bf x}\cdot\dot{\bf x}) - {\partial\over\partial{\bf x}}(\lambda^TUA{\bf x})\\ &= {1\over2}(\dot{\bf x}\cdot\ddot{\bf x} + \ddot{\bf x}\cdot\dot{\bf x}) - {\partial\over\partial{\bf x}}(\lambda^TUA{\bf x})\\ &= {1\over2}(2\dot{\bf x}^T\ddot{\bf x}) - {\partial\over\partial{\bf x}}(\lambda^TUA{\bf x}) \\ &= \underbrace{\dot{\bf x}^T\ddot{\bf x}}_\text{scalar} - \underbrace{{\partial\over\partial{\bf x}}(\lambda^TUA{\bf x})}_{????}\end{align*}$$
I'm not entirely sure that this is even possible. According to an online matrix calculator, the 2nd part $${\partial\over\partial{\bf x}}(\lambda^TUA{\bf x}) = A^TU^T\lambda,$$ which is an $n\times 1$ vector. Is this correct? If so, the performance index is impossible, and likely indicates my performance index is not set up correctly, but I'm not sure what might be wrong.
You get as variation of the action integral \begin{align} \delta J&=\int_0^T\left[\dot {\bf x}^\topδ\dot {\bf x}-δλ^\top(UA{\bf x}-\dot {\bf x})-λ^\top(UAδ{\bf x}-δ\dot {\bf x})\right]\,dt \\ &=\left[(\dot {\bf x}+λ)^\topδ{\bf x}\right]_0^T +\int_0^T\left[-(\ddot {\bf x}+\dot λ+A^\top U^\topλ)^\top δ{\bf x}-δλ^\top(UA{\bf x}-\dot {\bf x})\right]\,dt \end{align} so that the differential equations for the optimal/saddle-point solution inside the interval are \begin{align} \dot {\bf x}&=UA{\bf x}\\ 0&=\ddot {\bf x}+\dot λ+A^\top U^\topλ \end{align} where the second can be reduced with the first so that $\dot λ$ is the leading derivative.