dalgriccati (MathScript RT Module Function)
- Updated2023-03-14
- 2 minute(s) read
dalgriccati (MathScript RT Module Function)
Owning Class: cdsolvers
Requires: Control Design and Simulation Module and MathScript RT Module
Syntax
X = dalgriccati(A, B, Q)
X = dalgriccati(A, B, Q, R)
X = dalgriccati(A, B, Q, R, N)
[X, eig] = dalgriccati(A, B, Q)
[X, eig] = dalgriccati(A, B, Q, R)
[X, eig] = dalgriccati(A, B, Q, R, N)
[X, eig, K] = dalgriccati(A, B, Q)
[X, eig, K] = dalgriccati(A, B, Q, R)
[X, eig, K] = dalgriccati(A, B, Q, R, N)
[X, eig, K, res] = dalgriccati(A, B, Q)
[X, eig, K, res] = dalgriccati(A, B, Q, R)
[X, eig, K, res] = dalgriccati(A, B, Q, R, N)
Legacy Name: dare
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).
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. |
Details
The following table lists the support characteristics of this function.
| Supported in the LabVIEW Run-Time Engine | Yes |
| Supported on RT targets | Yes |
| Suitable for bounded execution times on RT | Not characterized |
Examples
A = [0.9, 0.1; 0, -0.25]
B = [0; 1]
Q = [2, 0; 0, 2]
R = 1
[X, eig, K] = dalgriccati(A, B, Q, R)