lqi
Linear-quadratic integral control.
Inputs
Continuous or discrete-time LTI model (m inputs, n states, p outputs).
State weighting matrix (n+p-by-n+p).
Input weighting matrix (m-by-m).
Optional cross term matrix (n+p-by-m). If s is not specified, a zero matrix is assumed.
Outputs
State feedback matrix (m-by-n).
Unique stabilizing solution of the continuous-time Riccati equation (n+p-by-n+p).
Closed-loop poles (n-by-1).
Equations $$ \dot{x} = A\,x + B\,u,\quad x(0) = x_0 $$$$ J(x_0) = \int_0^\infty z^T Q\, z + u^T R\, u + 2\, z^T S\, u \,\, dt $$$$ z = \left[ \matrix{ x \cr x_i} \right],\qquad x_i = \int_0^t r - y \,\, dt $$$$ L = \sigma (A - B\, G) $$
Source Code: lqi