Skip to content

Repository files navigation

Data-Driven Control Toolbox

License: MIT GitHub issues GitHub contributors

A MATLAB/Simulink toolbox implementing the data-driven and adaptive control methodologies from An Introduction to Data-Driven Control Systems (A. Khaki-Sedigh, Wiley, 2024). Packaged as both a Simulink block library and plain MATLAB classes.

Disclaimer: This toolbox is an independent, unofficial project created by a student of Prof. Khaki-Sedigh. It is not endorsed by, affiliated with, or officially connected to the author or the publisher of the book.

Features

A MATLAB/Simulink toolbox for data-driven and adaptive control, covering:

  • DeePC — Data-Enabled Predictive Control (Willems' Fundamental Lemma)
  • MFAC — Model-Free Adaptive Control (compact-form dynamic linearization)
  • UFC — Unfalsified adaptive switching control (single-model and multimodel)
  • SPSA — Simultaneous Perturbation Stochastic Approximation (online parameter tuning)
  • STR — Direct and indirect self-tuning regulators (adaptive-control baselines)
  • VRFT — Virtual Reference Feedback Tuning (offline, MATLAB-only controller design)

The primary deliverable is a Simulink block library; every stateful algorithm is implemented as a matlab.System class so it can be used both as a Simulink "MATLAB System" block and as a plain MATLAB object (for offline simulation, unit testing, or scripting).

Requirements

  • MATLAB R2024a or newer (recommended), with Simulink for the block library.
  • No third-party toolboxes are required; the test suite is self-contained.

Installation

Install the packaged toolbox from the MATLAB Add-On Explorer, or build it locally (see Packaging):

run('tools/devPath.m')   % add toolbox/ and toolbox/lib to the MATLAB path

For development, see Contributing.

Repository Layout

toolbox/            Packaging root (this folder is what ships as the .mltbx)
  +ddc/              MATLAB package namespace (ddc.deepc.DeePCController, etc.)
  lib/               Simulink library (ddc_lib.slx) + slblocks.m (Library Browser registration)
  examples/          Shipped examples, browsable from the Add-On Explorer

doc/                 Narrative / theory documentation (not shipped)
tests/               matlab.unittest test classes + local test runner (not shipped)
tools/               Dev-only helper scripts (path setup, packaging script)

Developer Setup

From the MATLAB command window, with this repo as your working directory:

run('tools/devPath.m')   % adds toolbox/ and toolbox/lib to the MATLAB path

Do not add toolbox/+ddc itself to the path — only its parent (toolbox/) should be on the path for the ddc.* package to resolve correctly.

Running Tests

run('tests/runAllTests.m')

Packaging

run('tools/buildToolbox.m')   % produces a .mltbx via the Toolbox Packager API

Using the Simulink Library

Open the Simulink Library Browser and look for Data-Driven Control Toolbox (registered by toolbox/lib/slblocks.m). Double-clicking opens ddc_lib showing the category subsystem folders: Common Utilities, DeePC, MFAC, Unfalsified Switching, SPSA, STR Baselines. Or open it directly:

open_system('ddc_lib')

Library sources are regenerated by tools/buildLibraries.m (the script is the source of truth for library contents; re-run it after adding/removing blocks, or hand-edit in the Simulink editor and re-save -- the two are meant to stay consistent).

Naming Convention

All shipped functions/classes live under the ddc package (ddc.<category>.<Name>) and all Simulink library files are prefixed ddc_* to avoid collisions with other toolboxes.

Book Chapter Mapping

Each toolbox component corresponds to a chapter of Khaki-Sedigh (2024):

Component Package Book chapter
Unfalsified switching control ddc.ufc Ch. 3 (Unfalsified Adaptive Switching)
Multi-model switching control ddc.ufc Ch. 4 (Multi-Model Unfalsified Switching)
VRFT controller design ddc.vrft Ch. 5 (Virtual Reference Feedback Tuning)
SPSA-based tuning ddc.spsa Ch. 6 (Simultaneous Perturbation Stochastic Approx.)
DeePC (Fundamental Lemma) ddc.deepc Ch. 7 (Data-Driven Control Based on the Fundamental Lemma)
Model-Free Adaptive Control ddc.mfac Ch. 9 (Model-Free Adaptive Control)
STR baselines ddc.str Ch. 1 (Introducing the classical baselines)

How to Cite

If you use this toolbox in research or coursework, please cite it together with the reference book. See CITATION.cff for a machine-readable citation (BibTeX / APA can be generated from it on GitHub).

Note: Citing this toolbox does not imply endorsement by the book's author.

Contributing

Contributions are welcome! Please read CONTRIBUTING.md for setup, conventions, and the pull request process, and note our Code of Conduct.

License

MIT — see LICENSE.

About

Companion MATLAB/Simulink toolbox for Ali Khaki-Sedigh's 'An Introduction to Data-Driven Control Systems' — DeePC, MFAC, UFC, SPSA, STR, and VRFT, shipped as a Simulink block library.

Topics

Resources

Code of conduct

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages