Project Structure#

This section outlines the internal code structure of the project.

Direct Data-Driven MPC Controller#

The project is structured as a Python package, encapsulating the core logic of the Data-Driven MPC controllers within the following modules:

The utility module direct_data_driven_mpc.utilities.hankel_matrix is used for constructing Hankel matrices and evaluating whether data sequences are persistently exciting of a given order.

Model Simulation#

The following utility modules have been implemented to simulate LTI and nonlinear systems:

Controller Creation#

To modularize the creation of Data-Driven MPC controllers, the following utility modules are provided:

Data-Driven Controller Simulation#

The direct_data_driven_mpc.utilities.controller.data_driven_mpc_sim module implements the main control loops for both Data-Driven MPC controllers, following Algorithms 1 and 2 of [1] for LTI systems and Algorithm 1 of [2] for nonlinear systems.

Visualization (Static and Animated Plots)#

Custom functions are provided in direct_data_driven_mpc/utilities/visualization/ to display input-output data in static and animated plots. These functions use Matplotlib for visualization and FFmpeg for saving animations in various formats (e.g., GIF, MP4).

Examples#

The examples directory contains scripts that demonstrate the operation of the Data-Driven MPC controller and reproduce the results presented in the referenced papers.

Configuration Files#

The system and controller parameters used in the example scripts are defined in YAML configuration files in examples/config/. These parameters are based on the examples from Section V of [1] for LTI systems, and from Section V of [2] for nonlinear systems.

A YAML loading function is provided in direct_data_driven_mpc.utilities.yaml_config_loading.

References#

See the full citations of the reference papers in the Citation section.