I am new to this forum and would like to ask a question. Let us assume I have a set of matrices $U_{(t)}$ over $t = 1 ... T$ time steps. For each time step I want to find a vector $p_{(t)}$ which satisfies the equation $U_{(t)}p_{(t)}=0$. The solution can easily be found by computing the eigenvector with the smallest eigenvalue. However, I want the adjacent $p_{(t)}$ and $p_{(t-1)}$ to be close to each other for $t>1$, because I know $U_{(t)}$ is subject to little changes over time, $U_{(t)}=U_{(t-1)} + \epsilon$. This amounts to solving
$$argmin_{p_{(t)}} ||U_{(t)}p_{(t)}||^2$$ subject to $$||p_{(t)}||^2=1$$ $$||p_{(t-1)}-p_{(t)}||^2=0$$
Reformulating this in Lagrangian form is thus:
$$p_{(t)}U_{(t)}^TU_{(t)}p_{(t)} + \lambda(1-p_{(t)}^Tp_{(t)}) + \gamma\bigl((p_{(t-1)}-p_{(t)})^T(p_{(t-1)}-p_{(t)})\bigr)$$
Taking the derivative of the equation $\frac{\partial}{\partial p_{(t)}}$ setting it to zero leads me to:
$$2U_{(t)}^TU_{(t)}p_{(t)} - 2\lambda p_{(t)}-2\gamma p_{(t-1)}+2\gamma p_{(t)}$$ Dropping the constants
$$U_{(t)}^TU_{(t)}p_{(t)} - \lambda p_{(t)}+\gamma(p_{(t)} - p_{(t-1)}) = 0$$
I've made a slight mistake in the original derivation. However, I'm struggling a bit to solve the problem analytically. Thank you in advance.
Ok, so I've figured out the question. I am sharing the it with you. My current second side condition is simply $p^T_{(t−1)}p_{(t)}>=0$, which is equivalent to the cosine-similarity equation, as $p$ is unit-length anyways. The solution can then easily be obtained by scipy.optimize.minimize, which can handle inequalities and equalities: https://www.youtube.com/watch?time_continue=490&v=cXHvC_FGx24