This is drone modeling (modern control). Find the A and B matrices of the linear state equation when the states and inputs are defined as follows:
x = [r, s, p, q]^T (transpose)
u = [u1, u2, u3, u4]^T
Here,
r dot = p
s dot = q
p dot = Rz [g3, -g2, 1/m*u1 - g]^T (transpose)
q dot = Identity matrix^(-1) [u2, u3, u4]^T