# LQRegulatorGains

LQRegulatorGains[ssm,{q,r}]

gives the optimal state feedback gain matrix for the StateSpaceModel ssm and the quadratic cost function, with state and control weighting matrices q and r.

LQRegulatorGains[ssm,{q,r,p}]

includes the state-control cross-coupling matrix p in the cost function.

LQRegulatorGains[{ssm,finputs},{}]

specifies finputs as the feedback inputs of ssm.

# Details and Options

• The standard state-space model ssm can be given as StateSpaceModel[{a,b,}], where a and b represent the state and input matrices in either a continuous-time or a discrete-time system:
•  continuous-time system discrete-time system
• The descriptor state-space model ssm can be given as StateSpaceModel[{a,b,c,d,e}] in either continuous time or discrete time:
•  continuous-time system discrete-time system
• LQRegulatorGains also accepts nonlinear systems specified by AffineStateSpaceModel and NonlinearStateSpaceModel.
• For nonlinear systems, the operating values of state and input variables are taken into consideration, and the gains are computed based on the approximate Taylor linearization and returned as a vector.
• The argument finputs is a list of integers specifying the positions of the feedback inputs in .
• LQRegulatorGains[ssm,{}] is equivalent to LQRegulatorGains[{ssm,All},{}].
• The cost function is:
•  continuous-time system discrete-time system
• In LQRegulatorGains[ssm,{q,r}], the cross-coupling matrix p is assumed to be zero.
• The optimal control is given by , where is the computed feedback gain matrix.
• For continuous-time systems, the optimal feedback gain is computed as , where is the solution of the continuous Riccati equation , and is the submatrix of associated with the feedback inputs .
• For discrete-time systems, the optimal feedback gain is computed as , where is the solution of the discrete Riccati equation .
• The optimal control is unique and stabilizing if is stabilizable, is detectable, , and .

# Examples

open allclose all

## Basic Examples(5)

Compute the optimum feedback gain matrix for a continuous-time system:

 In[1]:=
 In[2]:=
 In[3]:=
 Out[3]=

Calculate the optimal control gains for an unstable system:

 In[1]:=
 In[2]:=

Compare the open- and closed-loop poles:

 In[3]:=
 Out[3]=

Compute the optimal state-feedback gain matrix for a discrete-time system:

 In[1]:=
 In[2]:=
 Out[2]=

Calculate the feedback gains for controlling a two-input system using the first input:

 In[1]:=
 In[2]:=
 Out[2]=

A set of feedback gains for a stabilizable but uncontrollable system:

 In[1]:=
 Out[1]=