# Feedback linearization of a nonlinear MIMO system

I have to design a feedback linearization for the model of a car with a single trailer. This picture shows the system:

And this is the kinematic model I got, where q_dot = [x_dot; y_dot; thA_dot; thP_dot; thR_dot].

I chose y1 = x and y2 = y as outputs. I proved that the system is controllable and observable. To complete the exercise, then, I calculated the time derivatives of y1 and y2. The classic iteration - if I'm not wrong - says to continue the derivatives until a dependance from both inputs comes out. So I calculated the second derivatives with respect to time, the third ones and the fourth ones, until I got two functions (the fourth derivatives of y1 and y2) depending on u1, du1/dt, d²u1/dt², d³u1/dt³ and u2 (the second input comes out only at this step). With these results, I thought to make a system extension: ξ1 = u1, ξ2 = du1/dt and ξ3 = d²u1/dt². The new inputs are w1 = d³u1/dt³ and w2 = u2. Finally I can write:

where v is a new control variable. This was to explain the problem and how I got to this point. Now, my question is: how do I choose v? It should depend on 8 variables, I suppose: q1, q2, q3, q4, q5, ξ1, ξ2, ξ3. But I don't know how.

$$\dot{x} = \begin{bmatrix} 0 & I & 0 & 0 \\ 0 & 0 & I & 0 \\ 0 & 0 & 0 & I \\ 0 & 0 & 0 & 0 \\ \end{bmatrix} x + \begin{bmatrix} 0 \\ 0 \\ 0 \\ I \\ \end{bmatrix}v,$$
with $$x = \begin{bmatrix}y_1 & y_2 & \dot{y}_1 & \dot{y}_2 & \ddot{y}_1 & \ddot{y}_2 & \dddot{y}_1 & \dddot{y}_2\end{bmatrix}^\top$$. You could try to find an expression for the derivatives of $$y_1$$ and $$y_2$$ as a function of $$q$$. If this does not have an explicit solution you could also use an observer, since if $$y_1$$ and $$y_2$$ are known the system is observable.