Calculates the optimal control input to correct for the given state error.
The calculated optimal control input as a Matrix.
The current state error of the system, represented as a Matrix.