LQRDiscrete - MapleSim Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


ControlDesign

  

LQRDiscrete

  

design discrete-time linear quadratic state feedback regulator (LQR) for a given pair

 

Calling Sequence

Parameters

Options

Solvability Conditions

Description

Examples

Calling Sequence

LQRDiscrete(A, B, Q, R, opts)

Parameters

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

Options

• 

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.

ATXAXATXB+NBTXB+R1BTXA+NT+Q=0

The LQR feedback gain is calculated as

K=BTXB+R1BTXA+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).

Solvability Conditions

• 

The pair A,B must be stabilizable.

• 

The pair QNR1NT,ABR1NT must have no unobservable modes on the unit circle.

• 

R>0 (positive definite) and QNR1NT0 (positive semidefinite).

Description

• 

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=0xTQx+uTRu+2xTΝ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.

Examples

withControlDesign:

withDynamicSystems:

csysNewSystemMatrix2s2+3s+1,1s+2,s1s2+5,7s+1s+4

csysTransfer Functioncontinuous2 output(s); 2 input(s)inputvariable=u1s,u2soutputvariable=y1s,y2s

(1)

sysStateSpacecsys

sysState Spacecontinuous2 output(s); 2 input(s); 7 state(s)inputvariable=u1t,u2toutputvariable=y1t,y2tstatevariable=x1t,x2t,x3t,x4t,x5t,x6t,x7t

(2)

sys:-a;sys:-b;sys:-c;sys:-d

010000000100000001000−5−15−6−3000000001000000010000−8−14−7

00000010000001

10020451−1−2211470

0000

(3)

Q13LinearAlgebra:-IdentityMatrix7;R2LinearAlgebra:-IdentityMatrix2

Q13000000013000000013000000013000000013000000013000000013

R2002

(4)

dsysToDiscretecsys,1,method=bilinear

dsysTransfer Functiondiscrete; sampletime = 12 output(s); 2 input(s)inputvariable=u1z,u2zoutputvariable=y1z,y2z

(5)

sysStateSpacedsys

sysState Spacediscrete; sampletime = 12 output(s); 2 input(s); 7 state(s)inputvariable=u1q,u2qoutputvariable=y1q,y2qstatevariable=x1q,x2q,x3q,x4q,x5q,x6q,x7q

(6)

KLQRDiscretesys:-a,sys:-b,Q,R

K0.04812023135835660.301603484258431−0.4208348953190100.05115143018465260.0.0.0.0.0.0.0.0.03724081407389232.04657437887789×10−50

(7)

KprLQRDiscretesys:-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.725780367562653I−0.09599244712197310.725780367562653I0.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

(8)

See Also

ControlDesign

ControlDesign[LQR]

ControlDesign[LQRContinuous]

ControlDesign[LQROutput]

ControlDesign[StateFeedback][Ackermann]

ControlDesign[StateFeedback][PolePlacement]