Optimization-based and moving horizon estimation by murrayrm · Pull Request #877 · python-control/python-control

Conversation

@murrayrm

This PR adds new functionality for computing the optimal estimate for a (nonlinear) I/O system using an explicit cost function of a fixed window of applied inputs and measured outputs. This optimal estimation problem is then used to create a system for solving moving horizon estimation (MHE) problems. Documentation and unit tests are included.

Summary of changes:

  • Added the obc.OptimalEstimationProblem class and obc.create_mhe_iosystem() function, which implement that main new functionality.
  • Added gaussian_likelyhood_cost() to create cost function corresponding to Gaussian likelihoods for use in optimal estimation.
  • Added disturbance_range_constraint() to create a range constraint on disturbances.
  • Moved processing of control and disturbance indices for estimation problems into iosys.py and use that functionality consistently for obc.create_estimator_iosystem and obc.OptimalEstimationProblem.
  • Created a function for processing legacy keywords in config.py and updated legacy keyword processing class to use that functionality.
  • Added a pytest mark for slow tests (@pytest.mark.slow), which can be used during development to skip slow tests by running pytest -m "not slow".
  • Added unit tests, docstrings, and user documentation for new functionality, including a Jupyter notebook demonstrating optimal estimation and moving horizon estimation the PVTOL model system (from FBS2e and OBC notes).
  • Additional small updates to docstrings to fix typos and formatting issues.

@coveralls

Coverage Status

Coverage: 94.533% (-0.3%) from 94.841% when pulling a329323 on murrayrm:oep_mhe-26Feb2023 into 26c44e1 on python-control:main.

sawyerbfuller

:math:`Y[k] \in \mathbb{R}^p`, and :math:`V[k] \in \mathbb{R}^q` and
:math:`W[k] \in \mathbb{R}^p` represent random processes that are not
necessarily Gaussian white noise processes. The estimation problem that we
wish to solve is to find the estimate :math:`\hat x[\cdot]` that matches

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should these be capital X-hat and Y-hat in keeping with the notation above?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Never mind, I realize now they're random processes.

sawyerbfuller

sawyerbfuller

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a great feature, LGTM

Co-authored-by: Sawyer Fuller <58706249+sawyerbfuller@users.noreply.github.com>