# DiscreteLQRegulatorGains

DiscreteLQRegulatorGains[sspec,wts,τ]

gives the discrete-time state feedback gains with sampling period τ for the continuous-time system specification sspec that minimizes a cost function with weights wts.

DiscreteLQRegulatorGains[,"prop"]

gives the value of the property "prop".

# Details and Options    • DiscreteLQRegulatorGains is also known as discrete linear quadratic regulator, discrete linear quadratic cost equivalent regulator or discrete linear quadratic emulated regulator.
• DiscreteLQRegulatorGains is typically used to compute a digital implementation of a regulator that can stabilize a system or improve its performance.
• The controller is typically given by , where is the computed gain matrix.
• • The inputs u to sys consist of feedback inputs uf and other inputs ue.
• The system specification sspec is the system sys together with the uf specification.
• DiscreteLQRegulatorGains computes the discrete-time controller for a linear continuous-time system sys that minimizes an approximated discrete-time equivalent of a continuous-time cost function.
• The continuous-time cost function is given by .
• The discrete-time cost function is approximated as , with the following terms:
•  state weight matrix input weight matrix cross-coupling weight matrix • The weights wts can have the following forms:
•  {q,r} cost function with no cross-coupling {q,r,p} cost function with cross-coupling matrix p
• The system sys can be given as StateSpaceModel[{a,b,}], where a and b represent the state and input matrices in the continuous-time system .
• The discrete-time design model dsys is a zero-order hold approximation , with the following terms:
•  state matrix input matrix • The system specification sspec can have the following forms:
•  StateSpaceModel[…] linear control input and linear state AffineStateSpaceModel[…] linear control input and nonlinear state NonlinearStateSpaceModel[…] nonlinear control input and nonlinear state SystemModel[…] general system model <|…|> detailed system specification given as an Association
• The detailed system specification can have the following keys:
•  "InputModel" sys any one of the models "FeedbackInputs" All the feedback inputs uf
• The feedback inputs can have the following forms:
•  {num1,…,numn} numbered inputs numi used by StateSpaceModel, AffineStateSpaceModel and NonlinearStateSpaceModel {name1,…,namen} named inputs namei used by SystemModel All uses all inputs
• For nonlinear systems such as AffineStateSpaceModel, NonlinearStateSpaceModel and SystemModel, the system will be linearized around its stored operating point.
• DiscreteLQRegulatorGains[,"Data"] returns a SystemsModelControllerData object cd that can be used to extract additional properties using the form cd["prop"].
• DiscreteLQRegulatorGains[,"prop"] can be used to directly give the value of cd["prop"].
• Possible values for properties "prop" include:
•  "Design" type of controller design "DesignModel" model used for the design "DiscreteTimeClosedLoopPoles" poles of "DiscreteTimeClosedLoopSystem" "DiscreteTimeClosedLoopSystem" dcsys with ue(k) and (k) as input and y(k) as output {"DiscreteTimeClosedLoopSystem",<|"Merge"m|>} whether to merge the discrete-time closed-loop system "DiscreteTimeControllerModel" dcm with (k) and x(k) as input and uf(k) as output "DiscreteTimeDesignModel" approximated discrete-time model dsys "DiscreteTimeOpenLoopPoles" poles of dsys "DiscreteTimeWeights" weights ϕ, ρ, π of the approximated cost "FeedbackGains" gain matrix κ or its equivalent "DiscreteTimeFeedbackGainsModel" dgm with x(k) as input and uf(k) as output "FeedbackInputs" inputs uf of sys used for feedback "InputModel" input model sys "InputsCount" number of inputs u of sys "OpenLoopPoles" poles of "DesignModel" "OutputsCount" number of outputs y of sys "SamplingPeriod" sampling period τ "StatesCount" number of states x of sys
• The diagram of the discrete-time feedback gains model dgm, discrete-time controller model dcm, and discrete-time closed-loop system dcsys.

# Examples

open allclose all

## Basic Examples(1)

Compute a set of discrete-time regulator gains for a continuous-time system:

## Scope(23)

### Basic Uses(7)

Compute the discrete-time state feedback gain of a system:

The discrete-time approximation is stable:

The discrete-time closed-loop system is even more stable:

The gain for an unstable system:

The discrete-time approximation is also unstable:

The discrete-time closed-loop system is stable:

The gains for various sampling periods:

The discrete-time approximations:

The discrete-time closed-loop systems:

Compute the state feedback gains for a multiple-state system:

The dimensions of the result correspond to the number of inputs and the system's order:

Compute the gains for a multiple-input system:

Reverse the weights of the feedback inputs:

A higher weight does not lead to a smaller norm:

Increase the weight even more to reduce the relative signal size:

Compute the gains when the cost function contains cross-coupling of the states and feedback inputs:

Compute the gains for a nonlinear system:

The controller for the approximate linear system:

### Plant Models(5)

A descriptor StateSpaceModel:

### Properties(11)

DiscreteLQRegulatorGains returns the discrete-time feedback gains by default:

In general, the feedback is affine in the states:

It is of the form κ0+κ1.x, where κ0 and κ1 are constants:

The systems model of the feedback gains:

An affine systems model of the feedback gains:

The discrete-time closed-loop system:

The poles of the linearized closed-loop system:

Increasing the weight of the states makes the system more stable:

Increasing the weight of the feedback inputs makes the system less stable:

The model used to compute the feedback gains:

The poles of the design model:

The discrete-time approximate model used to compute the feedback gains:

The poles of the approximate discrete-time model:

The approximate discrete-time weights:

The design method:

Properties related to the input model:

Get the controller data object:

## Applications(1)

Design an optimal controller by emulation:

The step response of the emulated system:

## Properties & Relations(1)

A continuous-time system:

Compute the weights for the emulated discrete-time system:

Compute the discrete LQ gains using the emulated system and corresponding weights:

DiscreteLQRegulatorGains directly gives the same result:

## Possible Issues(1)

It is not possible to compute an optimal regulator for a system that is not stabilizable: The second mode is not stabilizable: