Skip to content

Commit d0bfec7

Browse files
committed
Documentation fix: document R is None behaviour
For both standard and generalized case, the behaviour of care() w.r.t. R is the same. Without this change, it's not clear that the care(A,B,Q,R) is a valid call form.
1 parent 38d7125 commit d0bfec7

1 file changed

Lines changed: 12 additions & 10 deletions

File tree

control/mateqn.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -411,25 +411,27 @@ def dlyap(A,Q,C=None,E=None):
411411
#### Riccati equation solvers care and dare
412412

413413
def care(A,B,Q,R=None,S=None,E=None):
414-
""" (X,L,G) = care(A,B,Q) solves the continuous-time algebraic Riccati
414+
""" (X,L,G) = care(A,B,Q,R=None) solves the continuous-time algebraic Riccati
415415
equation
416416
417-
A^T X + X A - X B B^T X + Q = 0
417+
A^T X + X A - X B R^-1 B^T X + Q = 0
418418
419-
where A and Q are square matrices of the same dimension. Further, Q
420-
is a symmetric matrix. The function returns the solution X, the gain
421-
matrix G = B^T X and the closed loop eigenvalues L, i.e., the eigenvalues
422-
of A - B G.
419+
where A and Q are square matrices of the same dimension. Further,
420+
Q and R are a symmetric matrices. If R is None, it is set to the
421+
identity matrix. The function returns the solution X, the gain
422+
matrix G = B^T X and the closed loop eigenvalues L, i.e., the
423+
eigenvalues of A - B G.
423424
424425
(X,L,G) = care(A,B,Q,R,S,E) solves the generalized continuous-time
425426
algebraic Riccati equation
426427
427428
A^T X E + E^T X A - (E^T X B + S) R^-1 (B^T X E + S^T) + Q = 0
428429
429-
where A, Q and E are square matrices of the same dimension. Further, Q and
430-
R are symmetric matrices. The function returns the solution X, the gain
431-
matrix G = R^-1 (B^T X E + S^T) and the closed loop eigenvalues L, i.e.,
432-
the eigenvalues of A - B G , E. """
430+
where A, Q and E are square matrices of the same
431+
dimension. Further, Q and R are symmetric matrices. If R is None,
432+
it is set to the identity matrix. The function returns the
433+
solution X, the gain matrix G = R^-1 (B^T X E + S^T) and the
434+
closed loop eigenvalues L, i.e., the eigenvalues of A - B G , E."""
433435

434436
# Make sure we can import required slycot routine
435437
try:

0 commit comments

Comments
 (0)