LQGRegulator
LQGRegulator[sspec,cvs,wts]
gives the optimal output feedback controller for the stochastic system specification sspec with noise covariance matrices cvs that minimizes a cost function with weights wts.
LQGRegulator[…,"prop"]
gives the value of the property "prop".
Details and Options
 LQGRegulator is also known as linear quadratic Gaussian controller or stochastic linear controller.
 LQGRegulator is used to compute a regulating controller or tracking controller for a system with disturbances and measurement noise modeled as zeromean, Gaussian, white noise processes.
 LQGRegulator works by minimizing a quadratic cost function of the states and feedback inputs, and the sum of the variances of the error between the actual and estimated states.
 A regulating controller aims to maintain the system at an equilibrium state despite disturbances u_{w} and u_{e} interfering with it. Typical examples include maintaining an inverted pendulum in its upright position or maintaining an aircraft in level flight.
 The regulating controller is given by a control law of the form , where is the computed gain matrix.
 The quadratic cost function with weights q, r and p of the states x and feedback inputs u_{f}:

continuoustime system discretetime system  A tracking controller aims to track a reference signal despite disturbances u_{w} and u_{e} interfering with it. Typical examples include a cruise control system for a car or path tracking for a robot.
 The tracking controller is given by a control law of the form , where is the computed gain matrix for the augmented system, which includes the system sys as well as the dynamics for .
 The quadratic cost function with weights q, r and p of the augmented states and feedback inputs u_{f}:

continuoustime system discretetime system  The number of states of the augmented system is given by , where is given by SystemsModelOrder of sys, the order of y_{ref} and the number of signals y_{ref}.
 The choice of weighting matrices results in a tradeoff between performance and control effort, and a good design is arrived at iteratively. Their starting values can be diagonal matrices with entries , where z_{i} is the maximum admissible absolute value of the corresponding x_{i} or u_{i}.
 The weights wts can have the following forms:

{q,r} cost function with no crosscoupling {q,r,p} cost function with crosscoupling matrix p  The measurements y_{m} are modeled as , where and are the submatrices of and associated with , and is the noise.
 The stochastic inputs u_{w} and the measurement noise y_{v} are considered to be zeromean, white and Gaussian:

, process noise , measurement noise cross covariance  The covariance matrices cvs can have the following forms:

{w,v} covariance matrices and zero cross covariance {w,v,h} covariance and cross covariance matrices  The system specification sspec is the system sys together with the u_{f}, u_{e}, y_{t} and y_{ref} specifications.
 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 u_{f} "ExogenousInputs" None the exogenous inputs u_{e} "MeasuredOutputs" All the measured outputs y_{m} "TrackedOutputs" None tracked outputs y_{t} "TrackedSignal" Automatic the dynamics of y_{ref}  The inputs and outputs can have the following forms:

{num_{1},…,num_{n}} numbered inputs or outputs num_{i} used by StateSpaceModel, AffineStateSpaceModel and NonlinearStateSpaceModel {name_{1},…,name_{n}} named inputs or outputs name_{i} used by SystemModel All uses all inputs or outputs None uses none of the inputs or outputs  LQGRegulator[…,"Data"] returns a SystemsModelControllerData object cd that can be used to extract additional properties using the form cd["prop"].
 LQGRegulator[…,"prop"] can be used to directly get the value of cd["prop"].
 Possible values for properties "prop" include:

"ClosedLoopPoles" poles of "ClosedLoopSystem" "ClosedLoopSystem" system csys {"ClosedLoopSystem",cspec} detailed control over the form of the closedloop system "ControllerModel" model cm "Design" type of controller design "EstimatorGains" gain matrix ℓ "EstimatorGainsDesignModel" model used for the estimator gains design "EstimatorRegulatorFeedbackModel" model with u_{e}, y_{m} as input and as output "EstimatorRegulatorModel" model erm with u_{f}, u_{e}, y_{m} as input and as output "ExogenousInputs" deterministic and nonfeedback inputs u_{e} of sys "FeedbackGains" gain matrix κ or its equivalent "FeedbackGainsDesignModel" model used for the feedback gains design "FeedbackGainsModel" model gm or {gm_{1},gm_{2}} "FeedbackInputs" inputs u_{f} of sys used for feedback "InputModel" input model sys "InputCount" number of inputs u of sys "MeasuredOutputs" measured outputs y_{m} of sys "OpenLoopPoles" poles of the Taylor linearized sys "OutputCount" number of outputs y of sys "SamplingPeriod" sampling period of sys "StateEstimatorModel" model sem "StateOutputEstimatorModel" model soem "StateCount" number of states x of sys "TrackedOutputs" outputs y_{t} of sys that are tracked  Possible keys for cspec include:

"InputModel" input model in csys "Merge" whether to merge csys "ModelName" name of csys  The diagram of the regulator layout.
 The diagram of the tracker layout.
Examples
open allclose allBasic Examples (4)
A system specification sspec of a system with feedback input uf and process noise input uw:
A set of noise covariance matrices cvs and regulator weights wts:
A set of noise covariance matrices cvs and regulator weights wts:
A system with feedback input uf, process noise input uw and tracked output ym:
A set of noise covariance matrices cvs and regulator weights wts:
A set of noise covariance matrices cvs and regulator weights wts:
The open and closedloop poles:
The stable closedloop and unstable openloop poles are on the left and righthand sides of the s plane:
Scope (33)
Basic Uses (4)
A system with one feedback input uf and one noisy measurement ym:
The input covariance matrix cvs is empty because there are no noisy inputs:
A set of weights wts for the states and feedback input:
Compute the regulator from a full system specification sspec:
A system with one feedback input uf, one noisy input uw and one noisy measurement ym:
A set of covariance matrices cvs and weights wts:
A system with an exogenous deterministic input ue as well:
A set of covariance matrices cvs and weights wts:
Plant Models (7)
Continuoustime StateSpaceModel:
Discretetime StateSpaceModel:
Descriptor StateSpaceModel:
A SystemModel with a noisy input:
Properties (14)
By default, LQGRegulator returns the controller comprising the estimator and regulator:
Assemble the LQGRegulator:
The LQGRegulator model:
The model used to compute the feedback gains:
The model of the state estimator:
The model used to compute the estimator gains:
For nonlinear systems, the model used to design the estimator is the nonlinear statespace model:
The model to design the feedback gains is linear:
It is essentially the Taylor linearized statespace model:
The controller is the estimator and feedback gains in series:
The computed controller is the same:
Properties related to the input model:
Get the controller data object:
Tracking (5)
The closedloop system tracks the reference signal :
Design a tracking controller for a discretetime system:
The closedloop system tracks the reference signal :
The closedloop system tracks two different reference signals:
Compute the controller effort:
Track a desired reference signal:
The reference signal is of order 4:
Design a controller to track one output of a firstorder system:
ClosedLoop System (3)
Assemble the closedloop system for a nonlinear plant model with one disturbance input:
A set of noise covariance, regulator weight matrices:
The closedloop system with a linearized model:
Compare the response of the two systems:
Assemble the merged closed loop of a plant with an LQGRegulator:
A set of noise covariance, regulator weight matrices:
The merged closedloop system:
The unmerged closedloop system:
When merged, it gives the same result as before:
Explicitly merge the closedloop system:
Create a closedloop system with a desired name:
Applications (11)
Mechanical Systems (3)
Regulate a tank’s turret angle from the azimuth:
The turret’s orientation is unregulated to a initial disturbance in the states:
Set the system specifications:
Specify a set of process covariance matrices and LQ regulator weights:
Obtain the closedloop system:
Create a noisy signal to simulate the process noise:
The turret’s angle is regulated:
Regulate the motion of a robot arm:
Without a controller, the motion of the arm is not regulated:
A set process covariance matrices and LQ regulator weights:
Obtain the closedloop system:
Generate a noisy signal to simulate the sensor noise:
The motion of the arm is controlled:
Reject the disturbance on a gantry crane's load:
A disturbance force on the gantry causes the load to swing back and forth:
A set of noise covariance matrices:
A set of state and control weight matrices:
Obtain the closedloop system:
Generate a noisy signal to simulate the process noise:
And another for the sensor noise:
The disturbance is rejected and the oscillations are damped:
Aerospace Systems (3)
Regulate the roll and yaw motions of a rigid spacecraft:
The openloop response is unregulated:
A set of covariance and weight matrices for the LQG design:
Obtain the closedloop system:
Generate a noisy signal to simulate the process noise:
And another for the sensor noise :
The satellite's orbit is regulated by the controller:
Reject a disturbance pushing a satellite away from the Lagrange point L1:
The satellite’s orbit is unstable to an initial disturbance in the η state:
At least thruster and another thruster are necessary to control the satellite:
Set the system specifications:
A set of process covariance matrices and LQ control weights:
Obtain the closedloop system:
Generate a noisy signal to simulate the process noise:
And three for the measurement noises:
The satellite’s orbit is regulated for an initial disturbance in the η state:
Compute the control effort to reject the disturbance on the η state:
Stabilize the pitch and yaw of a helicopter model:
Discretize the system with a sampling time of :
A step input to the pitch motor affects the pitch and yaw simultaneously:
As does a step input to the yaw motor:
Set the feedback inputs to the yaw and pitch motor voltages:
A set of state and control weight matrices:
Obtain the closedloop system:
Generate two noisy signals to simulate the process noises for the pitch and yaw:
And another two for the pitch and yaw position sensors:
Marine Systems (1)
Dampen the roll dynamics of a ship:
The step response is highly oscillatory:
The Bode plot reveals a low frequency response peak which causes the oscillations:
Obtain a statespace representation of the system:
Design an LQG controller to dampen the oscillations:
Obtain the closedloop system:
Generate a noisy signal to simulate the noise in the pitch measurement:
The frequency responses of the open and closedloop systems shows the attenuated peak:
Biological Systems (1)
Stabilize a population of lynx and hares:
The lynx population is eliminated with a growth rate of zero:
Specify the system specification and a set noise covariance matrices and control weights:
Obtain the closedloop system:
Generate a noisy signal to add uncertainty in the population measurement:
The closedloop response results in a stable cyclic response:
The parametric plot demonstrates the limitcycle behaviour:
The control effort reveals the equilibrium values for the hare and lynx growth rates:
Economic Systems (1)
A disturbance to the consumer spending causes the economic model to become unstable:
A set of process covariance matrices and LQG control weights:
Compute an LQG controller that stabilizes the economic model:
Obtain the closedloop system:
The national income reaches an equilibrium point:
Compute the government spending and autonomous consumption and investment:
Chemical Systems (1)
Improve the performance of a CSTR for the decomposition reaction :
The system has two poles close to the imaginary axis:
This results in a sluggish response to a temperature perturbation:
Specify the system specification and a set of covariances matrices and control weights:
Obtain the closedloop system:
The closedloop poles are further from the imaginary axis:
Generate a noisy signal to simulate the process noise:
Electrical Systems (1)
Regulate the speed of a DC motor:
Discretize the model with a sampling period of 0.1:
Simulate the openloop response to a torque disturbance:
Specify the system specification and a set of covariances matrices and control weights:
Obtain the closedloop system:
Generate a noisy signal to simulate the process noise:
And another for the sensor noise:
The inputs to the closedloop system:
Properties & Relations (8)
The closedloop poles are the poles of the estimator and regulator:
The poles of the estimator subsystem:
The poles of the regulator subsystem:
The estimator and regulator poles together comprise the closedloop poles:
The closed loop from the exogenous input to the measurement is an output feedback system:
The LQGRegulator:
The estimator regulator model:
The addition and comparator blocks:
The closedloop system from to with the measurement noise :
It can also be obtained as a property:
The closedloop system from to :
The closed loop from the measurement noise to the measurement is a unity feedback system:
The LQGRegulator:
The transfer function of the closedloop system from to :
The controller model with the reference input set to zero:
The transfer function of the positive unity feedback system from to :
It is the same as the one obtained directly:
An LQGRegulator can be assembled using EstimatorRegulator:
Compute a set of optimal estimator gains:
And a set of optimal regulator gains:
Assemble the LQGRegulator using EstimatorRegulator:
LQGRegulator gives the same result:
Construct an LQG regulator from the Kalman estimator and the optimal statefeedback gains model:
Assemble the estimator regulator model manually:
LQGRegulator gives the same result:
The performance of an LQR controller is better than an equivalent LQG controller:
The closedloop system with an LQR controller:
The closedloop system with an LQG controller:
The LQR's response is better than the LQG's:
An LQG controller is less robust than an LQR controller:
A model of an inverted pendulum on a cart:
A set of noise covariance and control cost matrices:
The LQG closedloop systems for the nominal and a perturbed system:
The closedloop systems for the LQR controller:
The closedloop response of the system with the LQG:
The LQR is more robust with less variation between the nominal and perturbed responses:
The performance of the LQG controller can be improved by tuning the covariance matrices:
The closedloop system with the above specifications:
The closedloop system with a tuned set of covariance matrices:
Tuning the covariance matrices results in an improved response:
Text
Wolfram Research (2010), LQGRegulator, Wolfram Language function, https://reference.wolfram.com/language/ref/LQGRegulator.html (updated 2023).
CMS
Wolfram Language. 2010. "LQGRegulator." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2023. https://reference.wolfram.com/language/ref/LQGRegulator.html.
APA
Wolfram Language. (2010). LQGRegulator. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/LQGRegulator.html