I am trying to linearize a free-floating system with a free-floating base and 3 joints (j1, j2, j3). As I understand the positions part of the system state is given by the vector (this matches MultibodyPlant::num_positions()
):
q (10x1) = [base_quaternion (4x1), base_lin_position (3x1), j1_pos, j2_pos, j3_pos]
Since angular velocity requires only 3 components, the velocity part of the system state is written as (this matches MultibodyPlant::num_velocities()
):
q_dot (9x1) = [base_rot_vel (3x1), base_lin_vel (3x1), j1_vel, j2_vel, j3_vel]
Using this, the full system state is given as (this works when using MultibodyPlant::SetPositionsAndVelocities
) :
X (19x1) = [q (10x1),q_dot (9x1)]
With this, the system acceleration resulting from its dynamics and control forces X_dot = f(X, U)
would be written as:
X_dot (18x1)= [q_dot (9x1), q_ddot (9x1)]
Due to the difference in the representation of rotations and angular velocities, the number of terms needed to define X
and X_dot
is different.
This brings to the following questions while linearizing the system about a point using Linearize
:
The
A
andB
matrices after linearization of a continuous-timeMultibodyPlant
represent the equationX_dot = A*X + B*u
. However, there seems to be a mismatch here in the sizes of the arrays/matrices involved asX_dot (18x1)
is different from matrices given byLinearize
:A (19x19)
andB (19x3)
. I don't then understand what accelerations does the matrixX_dot
from the linear system equation represents with its size19x1
?The above question is only for a continuous-time case. For a discrete-time system,the following equations hold without any issues with the matrix sizes:
X[n+1] = A_d * X[n] + B_d * u[n]
. However, it is not clear how the quaternion properties are maintained during this linearized forward simulation?