Releases: do-mpc/do-mpc
Releases · do-mpc/do-mpc
v4.6.4
v4.6.3
Minor changes
- The penalty term (
rterm
) of the MPC formulation can now be customized. For more information, see the documentation - All CasADI integrator options can now be accessed via the
simulator.settings
syntax. For more information see the documentation - The
settings
attribute of theMPC
andSimulator
classes is now called_settings
. It can be accessed via thesettings
method. The user interface remains identical. - Minor bug fixes in the documentation an the
Simulator
class
v4.6.2
v4.6.1
Minor changes
- Fixed #387
do-mpc
can now be installed either as:
pip install do_mpc
or
pip install do_mpc[full]
Only with the full installation, optional features are available, e.g.:
- ONNX conversion
- OPCUA
Backend changes
- Fixed readthedosc configuration according to the new specification
- New setup for requirement files (splitting the pip requirements files according to this description):
requirements.txt
lists the base requirements for the do-mpc core features.requirements_full.txt
is a superset of requirements and includes optional do-mpc features (e.g. ONNX conversion).requirements_docs.txt
is a superset of the full requirements and includes the packages required to build the docs.
v4.6.0
Major changes
For detailed information on the major changes, please visit our website www.do-mpc.com.
OPC UA module
Building on the opcua-asnycio library, do-mpc now facilitates plant communication and software-in-the-loop testing with OPC UA.
- Core MPC modules can automatically derive and OPC UA client
- A local OPC UA server can be configured with namespace derived from clients for testing purposes
Interoperability with deep learning toolboxes through ONNX
do-mpc
now supports the open neural network exchange (ONNX) standard.
- Incorporate neural networks previously trained in Tensorflow, Pytorch, Matlab, etc. (with an option to export ONNX models)
- Convert ONNX models to CasADi expressions (the backbone of
do-mpc
).
Improved interface for settings in the MPC, MHE, Simulator, etc.
All do-mpc core modules now have the important new attribute settings
.
Previously, settings were passed to set_param
. This method is still available and wraps the new interface. The new method has important advantages:
- The
settings
attribute can be printed to see the current configuration. - Context help is available in most IDEs (e.g. VS Code) to see the available settings, the type and a description.
Relaunch of documentation
We have significantly improved our documentation with a polished new look and included typing information for an improved workflow.
v4.5.1
v4.5.0
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 inModel
.
- linearizing a regular (nonlinear)
- 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__
ofSampler
,SamplingPlanner
,DataHandler
that are passed toset_param
. This allows for a more concise setup. SamplingPlanner
methodproduct
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 subfolderdo_mpc/controller/
for large classes - User-facing classes (e.g.
MPC
) imported indo_mpc/controller/__init__.py
.- Imported such that
do_mpc.controller.MPC
still yields theMPC
class - No changes in front-end for users
- Imported such that
- 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.
- Explicitly excluding certain packages (e.g.
- Private files (marked as e.g.
- Many modules (e.g.
v4.4.0
Major changes
- MHE/MPC bounds on optimiziation variables can now be changed after calling
mhe.setup()
andmpc.setup()
respectively (fixes #289). The simplest way to set bounds is themhe.bounds
andmpc.bounds
property (docs) - More granular control over the bounds is now possible, e.g. choosing different values for each time-step of the horizon or for different collocation points (if that makes sense). For this purpose two now properties
lb_opt_x
andub_opt_x
are now documented and accessible to the user. These properties are indexed similarly to the property opt_x. Importantly, setting new values on these structure automatically considers the scaling factors. - The do-mpc model can now be pickled. Pickling is restricted, however and requires (error messages are thrown otherwise):
- the model class must be setup
- the model must use
SX
symbolic variables
- Enhanced warmstarting: The solver is now supplied with a guess for the dual variables
Minor changes
- Bug fix: MPCData.prediction was previously unable to query algebraic states
_z
. - Fixed #283: Algebraic states can now be plotted with the graphics package