Skip to content

Nystroem-based Koopman operator regression for linear quadratic control.

License

Notifications You must be signed in to change notification settings

LCSL/nys-koop-lqr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Description

This repository contains the code for the paper "Linear quadratic control of nonlinear systems with Koopman operator learning and the Nyström method", by Edoardo Caldarelli, Antoine Chatalic, Adrià Colomé, Cesare Molinari, Carlos Ocampo-Martinez, Carme Torras, and Lorenzo Rosasco, 2024, submitted to Automatica.

Contact author: [email protected]

Sources

Duffing oscillator

The code simulating the Duffing oscillator contains the Matlab implementation deployed by Milan Korda [https://homepages.laas.fr/mkorda/Eigfuns.zip], accompanying the paper "Optimal construction of Koopman eigenfunctions for prediction and control", M. Korda, I. Mézic, IEEE TAC, 2020.

Cloth simulator

The implementation of the cloth simulation uses the Matlab code deployed by Franco Coltraro, accompanying the paper "An inextensible model for the robotic manipulation of textiles", F. Coltraro, J. Amorós, M. Alberich-Carramiñana, C. Torras, Applied Mathematical Modelling, 2022.

Installation

The required packages can be installed by running the following command:

pip install -r requirements.txt

Project files

Proof-of-concept dynamics

The script benchmark_lqr_hjb.py allows to compare the Nyström-Koopman regression with an exact kernel-based estimator, on the proof-of-concept nonlinear dynamics studied by Guo et al. (2022). The script allows to:

  • cross-validate the regression hyperparameters (regularization constant, kernel lengthscale);
  • validate the open-loop forecasts of the data-driven dynamical system;
  • solve the LQR problem with the data-driven system, computing the optimal Riccati gain;
  • test the state-feedback law with the real nonlinear system.

Duffing oscillator

The script benchmark_lqr_classic.py allows to compare the Nyström-Koopman regression with the spline-based competitor, on the Duffing oscillator simulation. The script allows to:

  • cross-validate the regression hyperparameters (regularization constant, kernel lengthscale);
  • validate the open-loop forecasts of the data-driven dynamical system;
  • solve the LQR problem with the data-driven system, computing the optimal Riccati gain;
  • test the state-feedback law with the real nonlinear system.

In order to evaluate the baseline based on Korda and Mézic, 2020, one needs to run the Matlab script Duffing.m, located in the directory eigfuns.

The results of this simulation are available in the directory duffing.

Cloth manipulation

First of all, the training set for the cloth manipulation experiment can be generated by running the script simulation_cloth.m, located in the directory cloth_simulator.

The script benchmark_lqr_cloth.py allows to compare the Nyström-Koopman regression with the spline-based competitor, on the cloth manipulation task. The script allows to:

  • cross-validate the regression hyperparameters (regularization constant, kernel lengthscale);
  • validate the open-loop forecasts of the data-driven dynamical system;
  • solve the LQR problem with the data-driven system, computing the optimal Riccati gain.

In order to assess the closed-loop behavior with the state-feedback employing the Riccati gain, one can run the file closed_loop_lqr_control.m, located in the directory cloth_simulator. The results of this simulation are located in the directory 8x8_cloth_swing_xyz/sim_results.

Utilities

The file dynamical_systems.py contains the classes used to simulate nonlinear dynamics by Guo et al. (2022) and the Duffing oscillator in Python. The file regressors.py contains the Python implementation of the Nyström-Koopman estimator, the spline-based baseline, the exact kernel-based estimator, and the kernels employed.

Plotting

The remainder of the codes can be used to generate the plots appearing in the article.

Proofs

The directory proofs contains the pdf files with the extended proofs of Lemma 5 and Theorem 7 in the main paper.

About

Nystroem-based Koopman operator regression for linear quadratic control.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published