Major changes
Linear control
- Newly implemented class ``LinearModel``. The linear model can be created by:
- linearizing a regular (nonlinear) ``Model`` instance
- passing system matrices ``(A,B,C,D)``
- creating (linear) equations in ``LinearModel`` with the well known syntax used in ``Model``.
- Discretize a (continuous-time) ``LinearModel``.
- Setup the new discrete-time linear quadratic regulator (``LQR``) controller class
Data-based system identification with neural networks
- Use neural networks as system models in do-mpc
- ``ONNXConversion`` can convert a previously trained and stored neural network to a CasADi graph
- ONNX files can be exported from most major neural network frameworks (e.g. tensorflow, pytorch, matlab, ...)
- Some limitations to the neural network operations apply.
Minor changes
Compile NLP
- The ``MHE``, ``MPC`` classes can now export and compile the NLP.
- Compiled NLPs can be loaded and solved. This may result in faster optimization times.
Improved sampling tools for data generation
- Optional parameters in ``__init__`` of ``Sampler``, ``SamplingPlanner``, ``DataHandler`` that are passed to ``set_param``. This allows for a more concise setup.
- ``SamplingPlanner`` method ``product`` to create cartesian product (grid) of input variables to create test cases.
Simulator
- ``Simulator.make_step()`` can now be called without control input for autonomous systems.
Bug fixes
- Example files now import do-mpc relative path with ``os.path.join`` to yield a OS agnostic implementation.
- ``MHE`` class can now be created without estimating parameters.
- Solves visualization bug described in 340
Backend
- Significant code refactoring
- Many modules (e.g. ``controller.py``) were getting to large
- Individual files (e.g. ``_mpc.py``) in subfolder ``do_mpc/controller/`` for large classes
- User-facing classes (e.g. ``MPC``) imported in ``do_mpc/controller/__init__.py``.
- Imported such that ``do_mpc.controller.MPC`` still yields the ``MPC`` class
- No changes in front-end for users
- Recursive documentation with Sphinx / Readthedocs is fully automated now. Important considerations:
- Private files (marked as e.g. ``_mpc.py``) are not documented
- Imported modules are documented (e.g. the imported ``MPC`` class.
- Importing with ``from casadi import *`` could result in documentation of CasADi package in **do-mpc**. This is avoided by:
- Explicitly excluding certain packages (e.g. ``casadi``) to be documented.
- Marking functions or classes as private with ``_Name``.
- Using the ``__all__ = [...]`` variable to mark in certain files the list of elements that should be documented.