say I have an inverted pendulum system like
$$ \begin{split} \dot{x}_1 &= x_2 \\ \dot{x}_2 &= \sin(x_1) - 0.5x_2 + u \,. \end{split} $$
I now want to design a controller that tracks a user defined reference for the system output $y = x_1$ such that the error $e := y_{set} - y$ gets zero.
Remark: I know that it doesn't really make sense to try to track any other reference for $y$ other than one of the equilibria, but I am more interested in the method itself rather than the result (the pendulum is just a minimal example, in reality I would track the position of the cart carrying the pendulum).
First I transform the system into error coordinates:
$$ e = y_{set} - x_1 \rightarrow x_1 = y_{set} - e $$
and therefore, assuming constant references values $y_{set}$ we get the new system equations
$$ \begin{split} \dot{e} &= -x_2 \\ \dot{x}_2 &= \sin(y_{set} - e) - 0.5x_2 + u \,. \end{split} $$
Correct so far?
Question: Now here is my problem: If I want to perform a stability analysis using the standard Lyapunov function approach, how do I have to deal with the $y_{set}$ in the system equation above?
Because for $y_{set} \neq 0$, the term $\dot{x}_2 \neq 0$ even if $e = x_2 = u = 0$.
Since the reference can in principle be an arbitrary constant, how can I deal with it efficiently?