dare (Control Design and Simulation Module, MathScript Function)

LabView Control Design MathScript Functions

dare (Control Design and Simulation Module, MathScript Function)

Member of the cdsolvers class.

Syntax

X = dare(A, B, Q)

X = dare(A, B, Q, R)

X = dare(A, B, Q, R, N)

[X, eig] = dare(A, B, Q)

[X, eig] = dare(A, B, Q, R)

[X, eig] = dare(A, B, Q, R, N)

[X, eig, K] = dare(A, B, Q)

[X, eig, K] = dare(A, B, Q, R)

[X, eig, K] = dare(A, B, Q, R, N)

[X, eig, K, res] = dare(A, B, Q)

[X, eig, K, res] = dare(A, B, Q, R)

[X, eig, K, res] = dare(A, B, Q, R, N)

Description

Calculates the positive semi-definite, or stabilizing, matrix X that solves the following discrete algebraic Riccati equation (DARE):
X = A'XA-[A'XB+N]*inv(B'XB+R)*[A'XB+N]'+Q. This function also returns the gain matrix K and the eigenvalues of the matrix (A-BK).

Examples

Inputs

Name Description
A Specifies an n x n state matrix, where n is the number of states. The default is an empty matrix. A is a real matrix.
B Specifies an n x m input matrix, where m is the number of inputs. The default is an empty matrix. B is a real matrix.
Q Specifies the state weight matrix. Q is a real matrix that is symmetric and positive semi-definite.
R Specifies the input weight matrix. The default is the identity matrix. R is a symmetric, positive definite real matrix.
N Specifies the state-input cross weight matrix such that (Q-N*inv(R)*N') is positive semi-definite. The default is an appropriately sized matrix of zeros. N is a real matrix.

Outputs

Name Description
X Returns the solution to the discrete algebraic Riccati equation. X is a real matrix.
eig Returns the eigenvalues of the matrix (A-BK). These eigenvalues are the closed-loop pole locations. eig is a complex vector.
K Returns the gain matrix such that K = inv(B'XB+R)*(B'XA+N'). K is a real matrix.
res Returns the residual, which is the sum of the absolute value of all the elements in all the matrices you specify. The value of the res output specifies the distance between the solution and zero. res is real scalar.

Examples

A = [0.9, 0.1; 0, -0.25]
B = [0; 1]
Q = [2, 0; 0, 2]
R = 1
[X, eig, K] = dare(A, B, Q, R)

Related Topics

care