@@ -321,15 +321,15 @@ def create_estimator_iosystem(
321321 .. math::
322322
323323 d \hat{x}/dt &= A \hat{x} + B u - L (C \hat{x} - y) \\
324- dP/dt &= A P + P A^T + F Q_N F ^T - P C^T R_N^{-1} C P \\
324+ dP/dt &= A P + P A^T + G Q_N G ^T - P C^T R_N^{-1} C P \\
325325 L &= P C^T R_N^{-1}
326326
327327 or a discrete-time state estimator of the form
328328
329329 .. math::
330330
331331 \hat{x}[k+1] &= A \hat{x}[k] + B u[k] - L (C \hat{x}[k] - y[k]) \\
332- P[k+1] &= A P A^T + F Q_N F ^T - A P C^T R_e^{-1} C P A \\
332+ P[k+1] &= A P A^T + G Q_N G ^T - A P C^T R_e^{-1} C P A \\
333333 L &= A P C^T R_e^{-1}
334334
335335 where :math:`R_e = R_N + C P C^T`. It can be called in the form::
@@ -353,7 +353,7 @@ def create_estimator_iosystem(
353353 state covariance.
354354 G : ndarray, optional
355355 Disturbance matrix describing how the disturbances enters the
356- dynamics. Defaults to sys.B.
356+ dynamics. Defaults to ` sys.B` .
357357 C : ndarray, optional
358358 If the system has full state output, define the measured values to
359359 be used by the estimator. Otherwise, use the system output as the
@@ -430,6 +430,11 @@ def create_estimator_iosystem(
430430 resp = ct.input_output_response(
431431 est, T, 0, [X0, P0], param={'correct': False)
432432
433+ References
434+ ----------
435+ .. [1] R. M. Murray, `Optimization-Based Control
436+ <https://fbswiki.org/OBC`_, 2013.
437+
433438 """
434439
435440 # Make sure that we were passed an I/O system as an input
@@ -480,11 +485,13 @@ def create_estimator_iosystem(
480485 # Generate the disturbance matrix (G)
481486 if G is None :
482487 G = sys .B if len (dist_idx ) == 0 else sys .B [:, dist_idx ]
488+ G = _check_shape (G , sys .nstates , len (dist_idx ), name = 'G' )
483489
484490 # Initialize the covariance matrix
485491 if P0 is None :
486492 # Initalize P0 to the steady state value
487493 _ , P0 , _ = lqe (A , G , C , QN , RN )
494+ P0 = _check_shape (P0 , sys .nstates , sys .nstates , symmetric = True , name = 'P0' )
488495
489496 # Figure out the labels to use
490497 estimate_labels = _process_labels (
@@ -507,6 +514,10 @@ def create_estimator_iosystem(
507514 inputs = measurement_labels + control_labels if inputs is None \
508515 else inputs
509516
517+ # Process the disturbance covariances and check size
518+ QN = _check_shape (QN , G .shape [1 ], G .shape [1 ], square = True , name = 'QN' )
519+ RN = _check_shape (RN , C .shape [0 ], C .shape [0 ], square = True , name = 'RN' )
520+
510521 if isinstance (covariance_labels , str ):
511522 # Generate the list of labels using the argument as a format string
512523 covariance_labels = [
0 commit comments