Skip to content

StanfordASL/Reduced_BMPC

Repository files navigation

Reduced_Bilevel_MPC

Bilevel MPC

Overview

This repository provides MATLAB implementations of the reduced bilevel MPC proposed in our paper, along with several baseline methods for comparison:

  • Hierarchical MPC (P0)
  • Original bilevel MPC (P1)
  • Reduced bilevel MPC (P2)
  • Centralized MPC (P3)
  • Move-blocking variants (P1(M), P2(M))

The code allows users to reproduce numerical results and compare control performance across these formulations.


Background

This repository accompanies the following paper:

"Bilevel MPC for Linear Systems: A Tractable Reduction and Continuous Connection to Hierarchical MPC" Submitted to IEEE CDC

The main purpose of this code is to reproduce the results presented in the paper, including:

  • Toy example
  • Quadrotor example

Features

  • Solve and compare multiple MPC formulations (P0–P3, P1(M), P2(M))
  • Plot state and input trajectories over the prediction horizon
  • Evaluate the effect of move-blocking matrices on performance
  • Compute and visualize upper bounds proposed in the paper
  • Run closed-loop simulations for all methods
  • Reproduce both toy and quadrotor experiments via configurable settings

Repository Structure

.
├── figs/                    # Saved figures
├── bilvlMPC.m               # Main script (OCP comparison & closed-loop simulation)
├── MB_bounding.m            # Script for move-blocking performance bounds
├── ToySetting.m             # Toy example configuration
├── Quadrotor_setting.m      # Quadrotor configuration
└── (other auxiliary files)

Requirements

  • MATLAB R2024b
  • Optimization Toolbox
  • Control System Toolbox

Usage

Step 1: Select problem setting

In bilvlMPC.m, specify the problem:

prob = ToySetting;            % or Quadrotor_setting

Step 2: Select execution mode

In bilvlMPC.m, set:

mode = *;  % choose from below

Available modes:

-1 : Single OCP comparison at x = x0
 0 : P0 (hierarchical MPC) closed-loop simulation
 1 : P1 (bilevel MPC) closed-loop simulation
 2 : P2 (reduced bilevel MPC) closed-loop simulation
 3 : P3 (centralized MPC) closed-loop simulation
10 : P1(M) (move-blocking bilevel MPC)
20 : P2(M) (move-blocking reduced bilevel MPC)

Or, you can specify the execution mode by giving it as an argument, e.g.:

bilvlMPC(1);

Step 3-A: Single OCP comparison

Set mode = -1; in bilvlMPC.m and run

run('bilvlMPC.m')

Or, just

bilvlMPC(-1);

This compares P0–P3, P1(M), and P2(M) for a fixed initial state.


Step 3-B: Move-blocking performance analysis

In MB_bounding.m, select toy or quadrotor setting inside the script, and run

run('MB_bounding.m')

This generates:

  • Optimal values of P1(M), P2(M), and P0
  • Upper bounds proposed in the paper

Step 3-C: Closed-loop simulation

Set mode = 0,1,2,3,10,20; in bilvlMPC.m and run

run('bilvlMPC.m')

Or, just specify it in the argument, e.g.:

bilvlMPC(0);

This executes closed-loop simulations for the selected method and plots the results.


Notes

  • Results may slightly vary depending on solver tolerances.
  • Figures are saved in the figs/ directory.
  • The configuration files (ToySetting.m, Quadrotor_setting.m) define system dynamics, cost, and constraints.

License

MIT License


Author

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages