ControlDesign
LQRDiscrete
design discrete-time linear quadratic state feedback regulator (LQR) for a given pair
Calling Sequence
Parameters
Options
Solvability Conditions
Description
Examples
LQRDiscrete(A, B, Q, R, opts)
A
-
Matrix; system matrix of a state-space system
B
Matrix or Vector; input matrix of a state-space system
Q
Matrix; state weighting matrix
R
Matrix; input weighting matrix
opts
(optional) equation(s) of the form option = value; specify options for the LQRDiscrete command
N = Matrix or Vector
Weighting on the state-input multiplication term in the cost function. If omitted, a zero matrix with appropriate dimensions will be considered.
poles = true or false True means the eigenvalues of A-BK are returned. See LQR for details. The default value is false.
riccati = true or false True means the solution of the associated Riccati equation is returned. The infinite horizon solution of the following discrete-time Riccati equation (DARE) is returned.
ATXA−X−ATXB+NBTXB+R−1BTXA+NT+Q=0
The LQR feedback gain is calculated as
K=BTXB+R−1BTXA+NT
The default value is false.
parameters = {list, set}(name = complexcons)
Specifies numeric values for the parameters of sys. These values override any parameters previously specified for sys. The numeric value on the right-hand side of each equation is substituted for the name on the left-hand side in the sys equations. The default is the value of sys given by DynamicSystems:-SystemOptions(parameters).
The pair A,B must be stabilizable.
The pair Q−NR−1NT,A−BR−1NT must have no unobservable modes on the unit circle.
R>0 (positive definite) and Q−NR−1NT≥0 (positive semidefinite).
The LQRDiscrete command calculates the discrete-time LQR state feedback gain for a given pair.
The optimal state feedback gain, K, is calculated such that the quadratic cost function
Ju=∑n=0∞xTQx+uTRu+2⁢xTΝu
is minimized by the feedback law u[n] = -Kx[n] subject to the system dynamics
xn+1=Axn+Bun
Q and R are expected to be symmetric. If the input Q and/or R are not symmetric, their symmetric part will be considered since their antisymmetric (skew-symmetric) part has no role in the quadratic cost function.
In addition to the state feedback gain, depending on the corresponding option values, the command also returns the closed-loop eigenvalues and the solution of the associated Riccati equation.
Note that the time domain is inherent to the command regardless of the any time domain implications the input pair might have. To be more specific, this command calculates a discrete-time LQR feedback gain for the given input pair even if that pair is initially extracted from a continuous-time state-space. If the gain is then used for feedback stabilization in continuous time domain, obviously such a mistake in command usage leads to a result which is not theoretically valid.
with⁡ControlDesign:
with⁡DynamicSystems:
csys≔NewSystem⁡Matrix⁡2s2+3⁢s+1,1s+2,s−1s2+5,7s+1⁢s+4
csys≔Transfer Functioncontinuous2 output(s); 2 input(s)inputvariable=u1⁡s,u2⁡soutputvariable=y1⁡s,y2⁡s
sys≔StateSpace⁡csys
sys≔State Spacecontinuous2 output(s); 2 input(s); 7 state(s)inputvariable=u1⁡t,u2⁡toutputvariable=y1⁡t,y2⁡tstatevariable=x1⁡t,x2⁡t,x3⁡t,x4⁡t,x5⁡t,x6⁡t,x7⁡t
sys:-a;sys:-b;sys:-c;sys:-d
010000000100000001000−5−15−6−3000000001000000010000−8−14−7
00000010000001
10020451−1−2211470
0000
Q≔13⁢LinearAlgebra:-IdentityMatrix⁡7;R≔2⁢LinearAlgebra:-IdentityMatrix⁡2
Q≔13000000013000000013000000013000000013000000013000000013
R≔2002
dsys≔ToDiscrete⁡csys,1,method=bilinear
dsys≔Transfer Functiondiscrete; sampletime = 12 output(s); 2 input(s)inputvariable=u1⁡z,u2⁡zoutputvariable=y1⁡z,y2⁡z
sys≔StateSpace⁡dsys
sys≔State Spacediscrete; sampletime = 12 output(s); 2 input(s); 7 state(s)inputvariable=u1⁡q,u2⁡qoutputvariable=y1⁡q,y2⁡qstatevariable=x1⁡q,x2⁡q,x3⁡q,x4⁡q,x5⁡q,x6⁡q,x7⁡q
K≔LQRDiscrete⁡sys:-a,sys:-b,Q,R
K≔0.04812023135835660.301603484258431−0.4208348953190100.05115143018465260.0.0.0.0.0.0.0.0.03724081407389232.04657437887789×10−50
Kpr≔LQRDiscrete⁡sys:-a,sys:-b,Q,R,poles=true,riccati=true:Kpr1;Kpr2;Kpr3
0.04812023135835660.301603484258431−0.4208348953190100.05115143018465260.0.0.0.0.0.0.0.0.03724081407389232.04657437887789×10−50
−0.0959924471219731+0.725780367562653⁢I−0.0959924471219731−0.725780367562653⁢I0.597646681572766+0.⁢I−0.133580894281149+0.⁢I0.+0.⁢I0.271790906833210+0.⁢I−0.271790906833210+0.⁢I
0.342082466307579979569800296497885639351786335687550.054836997137896559065463795059790315059092605697878−0.0765154355125472252954240980794033938116281948301510.00930026003357319396900145495172223394826444362655160.0.0.0.0548369971378965590654637950597903150590926056978781.0190795441519386008663204999259911522050659569203−0.42467264969582701414729333026735701324346677591194−0.0161167278036927530850684604787121942357286736344510.0.0.−0.076515435512547225295424098079403393811628194830151−0.424672649695827014147293330267357013243466775911942.0214621984357416787319413739918552066383416590039−0.509659957013962976642303115028964333925822866013650.0.0.0.0093002600335731939690014549517222339482644436265516−0.016116727803692753085068460478712194235728673634451−0.509659957013962976642303115028964333925822866013652.24919438674456099003047869510800776268589222479490.0.0.0.0.0.0.0.333333333333333333333333333333333333333333333333332.2865039209104185372543140058046721769304597671473×10−502.8675502202583078721736253812994957905085589515221×10−500.0.0.0.2.2865039209104185372543140058046721769304597671473×10−500.674942403127531625737466343897601256870546126025706.1566600468408239873788918398523229241598769169614×10−500.0.0.0.2.8675502202583078721736253812994957905085589515221×10−506.1566600468408239873788918398523229241598769169614×10−501.0082757364608649590707996772309345902038794593591
See Also
ControlDesign[LQR]
ControlDesign[LQRContinuous]
ControlDesign[LQROutput]
ControlDesign[StateFeedback][Ackermann]
ControlDesign[StateFeedback][PolePlacement]
Download Help Document